how do I set conditions for a date macro?

S

skaufman

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
 
S

Steve Schapel

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.
 
S

skaufman

Steve,

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

Thanks again,
Sharon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top