Loading a default date

Jim Stanicki

Registered User.
Local time
Today, 11:55
Joined
Aug 7, 2007
Messages
36
I would like to load the current date into "survey date" if the status indicates the survey has been done and the survey date is empty. As must be obvious I am new to Access.
This is the code I put in the change event. Any help will be greatly appreciated. I am using Access 2007


Private Sub Status_Change()
If [site survey requests.status] = "Available" And
[site survey requests.survey date] = Null
Then [site survey requests.survey date] = Date
End Sub

Thanks
 
Use the AfterUpdate event of the status control instead and put:
Code:
If Me![site survey requests.status] = "Available" And IsNull([site survey requests.survey date]) Then 
   Me![site survey requests.survey date] = Date
End If
 
Great .. Thanks

Works perfect
 

Users who are viewing this thread

Back
Top Bottom