how do I set conditions for a date macro?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If in a form, there is a date field, and I would like the user to type "t"
and today's date will populate or a "y" and yesterday's date will
populate-can i do this just using a macro? If so, what commands should I use?
If not, what do you recommend?
Thank you so much for your assistance.

Sharon
 
Sharon,

I have never tried this, but I don't think you will be able to enter the
"t" or "y" into the textbox bound to the date field. You might need to
do it in another textbox, probably unbound, instead. In this case, you
could use a SetValue macro on the AfterUpdate event of this textbox to
put the required date in. Another option would be to use a couple of
little command buttons, once again with SetValue macros on their Click
events. You may also like to know that Access has a built-in function
to enter today's date, using the Ctrl+; key combination.
 
Steve,

Thank you so much for your assistance- that is what we thought. We will try
the unbound text box idea.

Thanks again,
Sharon
 
Back
Top