P
Paul R
I am trying to update a field in a table with the date() (today). I have
tried to use the following code but the code to update the true / false
field works, the code for the date filed does not?
Paul
Dim sSql
Dim sdSql As Date
Dim stOption As String
Dim chkOption As Boolean
stDocName = "rpt_membership_card"
If Me.chk_a < 0 Then
stOption = "[Surname] Like 'A*' Or [Surname] Like 'B*' Or
[Surname] Like 'C*'"
chkOption = True
End If
DoCmd.OpenReport stDocName, acPreview, , stOption
' update the print card field to Yes
sSql = "UPDATE Member_Detail SET membership_card_print = -1 WHERE
membership_card_print = 0 AND " & stOption
' update the date print card field to Today
sdSql = "UPDATE Member_Detail Set membership_card_date = Date() HERE
membership_card_print = 0 AND " & stOption
DoCmd.SetWarnings False
DoCmd.RunSQL sSql
DoCmd.RunSQL sdSql
tried to use the following code but the code to update the true / false
field works, the code for the date filed does not?
Paul
Dim sSql
Dim sdSql As Date
Dim stOption As String
Dim chkOption As Boolean
stDocName = "rpt_membership_card"
If Me.chk_a < 0 Then
stOption = "[Surname] Like 'A*' Or [Surname] Like 'B*' Or
[Surname] Like 'C*'"
chkOption = True
End If
DoCmd.OpenReport stDocName, acPreview, , stOption
' update the print card field to Yes
sSql = "UPDATE Member_Detail SET membership_card_print = -1 WHERE
membership_card_print = 0 AND " & stOption
' update the date print card field to Today
sdSql = "UPDATE Member_Detail Set membership_card_date = Date() HERE
membership_card_print = 0 AND " & stOption
DoCmd.SetWarnings False
DoCmd.RunSQL sSql
DoCmd.RunSQL sdSql