Is there a way to run code against only the current record? I would like to update a date field with the current date only if the field is null.
CODE:
If RequestDate > 0 Then
GoTo GoodBye
Else
DoCmd.RunSQL "UPDATE tblRequests SET tblRequests.RequestDate = Date()"
DoCmd.RepaintObject
End If
I tried placing the code in the OnCurrent property of a form the opens but it still updated all null records not just the current one.
Also, what is the syntax for null date? I tried “If RequestDate is null 0 Then” but it did not work so I went to the >0 option.
Thanks,
SKK
CODE:
If RequestDate > 0 Then
GoTo GoodBye
Else
DoCmd.RunSQL "UPDATE tblRequests SET tblRequests.RequestDate = Date()"
DoCmd.RepaintObject
End If
I tried placing the code in the OnCurrent property of a form the opens but it still updated all null records not just the current one.
Also, what is the syntax for null date? I tried “If RequestDate is null 0 Then” but it did not work so I went to the >0 option.
Thanks,
SKK