P
Paul
I'm trying to write a line of code that will update a date field (txtDate)
in a form to the current date whenever a value in another field is changed.
To that end, I've tried using the following:
Private Sub Activity_AfterUpdate()
Me!txtDate = Date()
End Sub
but it doesn't do anything. That is, it doesn't enter today's date in
txtDate.
I've also noticed that in the Immediate pane, ?Date() produces the current
Date, but MsgBox Date() produces an error becuase Date() is null.
Why does VBA recognize Date() in the immediate pane as having a value of
today's date, while the MsgBox function thinks it has no value? And what
can I do to reset txtDate to today's date whenever the value in the Activity
field is updated?
Thanks in advance,
Paul
in a form to the current date whenever a value in another field is changed.
To that end, I've tried using the following:
Private Sub Activity_AfterUpdate()
Me!txtDate = Date()
End Sub
but it doesn't do anything. That is, it doesn't enter today's date in
txtDate.
I've also noticed that in the Immediate pane, ?Date() produces the current
Date, but MsgBox Date() produces an error becuase Date() is null.
Why does VBA recognize Date() in the immediate pane as having a value of
today's date, while the MsgBox function thinks it has no value? And what
can I do to reset txtDate to today's date whenever the value in the Activity
field is updated?
Thanks in advance,
Paul