N
Nelson
I have 2 text box fields that I'm working with on one of my forms.
They are:
Remarks4 - this is a memo field data type
Remark Date - this is a date/time field data type
I'm trying to use the AfterUpdate Event on the Remarks4 field to validate
that the user has updated the [Remark Date] to today's date. This is
because if they are adding a remark here, they should also change the Remark
Date to today's date. Here is my code:
Private Sub Remarks4_AfterUpdate()
Dim strMsg As String
If Not [Remark Date].Value = DATE Then
strMsg = "Please update the Remark Date."
[Remark Date].SetFocus
MsgBox strMsg
End If
End Sub
It's not working though. Let's say the remark date currently reads
5/8/2003. When I update the Remark4 text box it should run the AfterUpdate
Event (which it does) and it should see that 5/8/2003 does not equal today's
date of 7/30/2003 and it should execute the If Statement (it doesn't do
this, it skips straight from the If line to the End If line without
executing the code in between).
When I debug and open the immediate window I typed in "Msgbox Date" and it
reads 5/8/2003 instead of 7/30/2003.
Does anyone know why this isn't working? I thought the Date function was
always supposed to show today's date?
Thanks,
Chris
They are:
Remarks4 - this is a memo field data type
Remark Date - this is a date/time field data type
I'm trying to use the AfterUpdate Event on the Remarks4 field to validate
that the user has updated the [Remark Date] to today's date. This is
because if they are adding a remark here, they should also change the Remark
Date to today's date. Here is my code:
Private Sub Remarks4_AfterUpdate()
Dim strMsg As String
If Not [Remark Date].Value = DATE Then
strMsg = "Please update the Remark Date."
[Remark Date].SetFocus
MsgBox strMsg
End If
End Sub
It's not working though. Let's say the remark date currently reads
5/8/2003. When I update the Remark4 text box it should run the AfterUpdate
Event (which it does) and it should see that 5/8/2003 does not equal today's
date of 7/30/2003 and it should execute the If Statement (it doesn't do
this, it skips straight from the If line to the End If line without
executing the code in between).
When I debug and open the immediate window I typed in "Msgbox Date" and it
reads 5/8/2003 instead of 7/30/2003.
Does anyone know why this isn't working? I thought the Date function was
always supposed to show today's date?
Thanks,
Chris