Hello:
And thanks for all the help this week. As I mentioned, it's been several years since I have done VBA, in favor of .NET applications. I think this question is hopefully easy??
The title says it all, re, error 3265. It appears to be happening at string creation time, which really puzzles me.
Code:
sql = "SELECT * FROM tblocalApprovalLog " & _
"WHERE empid = '" & rs.Fields("empid") & "' " & _
"AND dayDate = '" & Forms!frmTimeCard.txtDate.Value & "' " & _
"AND weekDate = '" & Forms!frmTimeCard.txtPeriodStart.Value & " - " & Forms!frmTimeCard.txtPeriodEnd.Value & "' "
Here is the entirety of the sub...
Code:
Private Sub chkApprove_Click()
Dim rs As adodb.recordset
Set rs = New adodb.recordset
Dim sql As String
sql = "SELECT * FROM tblocalApprovalLog " & _
"WHERE empid = '" & rs.Fields("empid") & "' " & _
"AND dayDate = '" & Forms!frmTimeCard.txtDate.Value & "' " & _
"AND weekDate = '" & Forms!frmTimeCard.txtPeriodStart.Value & " - " & Forms!frmTimeCard.txtPeriodEnd.Value & "' "
Debug.Print ("sql: " & sql)
rs.Open sql, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
If Not rs.BOF Then
rs.MoveFirst
If Me.chkApproved = False Then
rs.Fields("approved") = True
End If
End If
rs.Close
Set rs = Nothing
End Sub
Again, much thanks for all the help!