I have a Y/N field in a table that I want ticked when a report is printed for a record or batch of records. The report filters my record/s for a certain date.
The code I have is this but i'm not sure what the WHERE should be exactly as if fails at that point!
If MsgBox("Would you like to print this report?", vbYesNo) = vbYes Then
DoCmd.OpenReport "LETTER 1", acNormal
DoCmd.RunSQL "UPDATE Sheet1 SET Sheet1.LETTER1YN = True " & _
"WHERE (((Sheet1.RecordID)=Reports!LETTER 1!RecordID));"
End If
but maybe something else would be better?
The code I have is this but i'm not sure what the WHERE should be exactly as if fails at that point!
If MsgBox("Would you like to print this report?", vbYesNo) = vbYes Then
DoCmd.OpenReport "LETTER 1", acNormal
DoCmd.RunSQL "UPDATE Sheet1 SET Sheet1.LETTER1YN = True " & _
"WHERE (((Sheet1.RecordID)=Reports!LETTER 1!RecordID));"
End If
but maybe something else would be better?