Solved date() - 1 as default value in a text box control

AnilBagga

Member
Local time
Today, 23:09
Joined
Apr 9, 2020
Messages
223
I would like the default value of a text box to display default date()-1

I tried following expressions in the default control source

=Date()-1
=dateadd("d",-1,date())

Both don't work. I don't get an error, but the displayed date is always the date()

Why don't these expressions work?
 
A default value is different to a Control source? Which is it as your post seems to describe a bit of each.

A default value for yesterday would be

Date() - 1
 
Hi. Either =Date()-1 or just Date()-1 should work. But as @Minty said, you will only see it displayed for new records.
 
If you want to fill it out for existing blank records you would need to run an update query.
 

Users who are viewing this thread

Back
Top Bottom