I have it functioning properly now...Thank you for pointing the error in my ways. Now I said it is working probably not the most efficient way of coding it. I modified my code to this:
Sub TestingJ()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim wb As Workbook
Dim upRP As Variant
Dim sDate As String
sDate = Format(Date, "ddd")
upRP = Array("tbl_TryThis")
Set cn = New ADODB.Connection
cn.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=R:\Test.db;"
For q = LBound(upRP) To UBound(upRP)
If sDate = "Fri" Then
Call One(CStr(upRP(q)), cn)
Else
If sDate = "Sat" Then
Call Two(CStr(upRP(q)), cn)
Else
If sDate = "Sun" Then
Call Three(CStr(upRP(q)), cn)
End If
End If
End If
Next q
End Sub
Public Function One(upRP As String, cn)
sql1 = "UPDATE " & tbl_One_Main & " SET tbl_One_Main.Received = 'yes', tbl_One_Main.Received_Date = Date()+1"
cn.Execute sql1
End Function
Public Function Two(upRP As String, cn)
sql2 = "UPDATE" & tbl_One_Main & " SET tbl_One_Main.Received = 'yes', tbl_One_Main.Received_Date = Date()+2"
cn.Execute sql2
End Function
Bookmarks