if filed is not null then input date

OZmc

Registered User.
Local time
Today, 10:11
Joined
Dec 14, 2012
Messages
27
I know how to program in Python but I dont know how to program in VBA. How would I write a function in VBA to do the following:

Begin sub:

If [field1] IS NotNull

Then input date() in [date_check]

end sub

Then as a second function I want a checkbox to compare the current date with the date in [date_check]. If they are equal then evaluate to true and fill the check box. so something like:

begin sub:

if [date_check] = date()

then checkbox = true

end sub:
 
This should get you started:

Code:
If Not IsNull(Field1) Then
  [date_check] = Date()
End If
 
This is what I got is VBA:

Code:
Private Sub Date_check_BeforeUpdate(Cancel As Integer)
If Not IsNull(Date_TIME) Then
    [Date_check] = Date
End If
End Sub
Doesnt seem to work though. Should it be AfterUpdate?
 
Yes, I only use before update for validation.
 

Users who are viewing this thread

Back
Top Bottom