Automatically fill text box with yesterday's date

P

p-rat

I have an unbound text box. Format to short date. How would I
automatically have this filled with yesterday's date. I've tried
date-1 in the Control Source and in the Default Value, but neither
works. Any help would be appreciated. Thanks.
 
T

Tom Lake

p-rat said:
I have an unbound text box. Format to short date. How would I
automatically have this filled with yesterday's date. I've tried
date-1 in the Control Source and in the Default Value, but neither
works. Any help would be appreciated. Thanks.

If you don't want to be able to override the entry,
a control source of

= Date() -1

should work. Don't forget the equal sign.

Tom Lake
 
A

ArkRoyal

p-rat said:
I have an unbound text box. Format to short date. How would I
automatically have this filled with yesterday's date. I've tried
date-1 in the Control Source and in the Default Value, but neither
works. Any help would be appreciated. Thanks.
Bear it in mind that if you go into the form on a daily basis, the date in
the text box will change accordingly.
 

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