Insert current date button

hjknipp1024

Registered User.
Local time
Today, 18:08
Joined
Nov 20, 2012
Messages
12
I have a form that contains 3 date entry fields. I want to associate a button with each date field so that the users can click the button and populate the current date. I tried to create a command manually and change the "On Click" option to populate the date, but I'm not sure how to associate it with my date fields.
 
for each button, for the On Click event

me.yourtextboxname = Date
me.requery
 
So do I just disable the wizard, insert a blank command button and change the "On Click" option as you specified?
 
No need to disable the wizard, just place the button, and cancel out of the wizard at your first opportunity. Edit the caption name, then simply put your code in the button's On Click event.
 
I added the button, changed the "On Click" expression to read:

me.Due Date = Date
me.requery

When I try to save that, it says, "The expression you have entered contains invalid syntax. You have entered an operand without an operator."
 
Try this:
me.[Due Date] = Date
me.requery

Or change the name of the Due Date control to DueDate then use
me.DueDate = Date
me.requery

NoSpaces in the control name.
 

Users who are viewing this thread

Back
Top Bottom