Link to home
Start Free TrialLog in
Avatar of Frank Vertin
Frank Vertin

asked on

In Access 2013, How can I get current Date to appear on a form in a variable that I could use both for reference for date calculations?

I am trying to get the Current Date on an Access2013 Form.
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Dim dDate as Date
dDate = Now()

mx
OR

Dim dDate as Date
dDate = Date()

for just the Date w/o Time
Or, for a direct display in a textbox, use this expression:

=Date()

/gustav
Would have posted that, but OP said 'variable' ... but good for OP to know anyway :-)
Yes. It was to have "appear" covered ... variables normally don't step forward.

/gustav
Avatar of Frank Vertin
Frank Vertin

ASKER

I tried the simple one,  "=Date()" and got the error posted when I put it in the field in design mode. It came when I changed to Form mode. Am I not doing it right?
Error-by-date.docx
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial