Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

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.
0
Frank Vertin
Asked:
Frank Vertin
  • 4
  • 2
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Dim dDate as Date
dDate = Now()

mx
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
OR

Dim dDate as Date
dDate = Date()

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

=Date()

/gustav
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Would have posted that, but OP said 'variable' ... but good for OP to know anyway :-)
0
 
Gustav BrockCIOCommented:
Yes. It was to have "appear" covered ... variables normally don't step forward.

/gustav
0
 
Frank VertinAuthor Commented:
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
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Where exactly did you put that?

If in the Control Source property for a Text box on a Form ... you would just have:

=Date()

No double quotes ....
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now