Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Populate Field with Date

Status
Not open for further replies.

spaceherpe61

Technical User
Feb 1, 2005
8
US
I am looking to populate a field named "Date Called" with the current date. Based on a Yes/No named "Called" changing from No to Yes. I have tried a few different attempts at modules, but none of them seem to be working. Any suggestions would be greatly appreciated.
 
In the AfterUpdate Event for the Called Yes/No Control, add

If CalledControlName = True Then
DateCalledControlName = Format(Date(),"mm/dd/yyyy")
End If

PaulF
 
Assuming the Yes/No field is a checkbox control on your form called chkYesNo and the field you want to show the current date is textbox called txtDateCalled, you could put this in the click event of chkYesNo:

If chkYesNo.Value = true then
txtDateCalled = Date()
Else
End if

You can expand on this code by having txtDateCalled put to another date if the user 'unchecks' chkYesNo, i.e. chkYesNo.Value = False.

Hope this helps.
 
See thread702-1043484

________________________________________
Zameer Abdulla
Visit Me
There is only one perfect child in this world. Every mother has it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top