damixa
asked on
update access form field when checked
I have a form with two fields
contacted - a checkbox
contactdate - a date field
i need to update the contactdate to today's date when contacted is checked
Something like this code
any help would be appreciated
contacted - a checkbox
contactdate - a date field
i need to update the contactdate to today's date when contacted is checked
Something like this code
Private Sub Contacted_AfterUpdate()
Set contactdate = Date
End Sub
any help would be appreciated
I would use Date() if I only wanted the date to be stored and Now() if I wanted both date and time.
If Contacted = True then
ContactedDate = Date()
Else
ContactedDate = Null
End If
'if contacted = true' is redundant,
if contacted then contactdate = date() else contactdate =NULL
if contacted then contactdate = date() else contactdate =NULL
'if contacted = true' is redundant,True, but then inline IF - THEN statements are very difficult to read and troubleshoot downstream in massive code blocks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Very well explained, Pat. I agree.
if contacted then contactdate = datevalue(Now()) else contactdate =NULL