Solved

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?

Posted on 2014-10-22
7
189 Views
Last Modified: 2014-12-03
I am trying to get the Current Date on an Access2013 Form.
0
Comment
Question by:Frank Vertin
  • 4
  • 2
7 Comments
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Dim dDate as Date
dDate = Now()

mx
0
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
OR

Dim dDate as Date
dDate = Date()

for just the Date w/o Time
0
 
LVL 49

Expert Comment

by:Gustav Brock
Comment Utility
Or, for a direct display in a textbox, use this expression:

=Date()

/gustav
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Would have posted that, but OP said 'variable' ... but good for OP to know anyway :-)
0
 
LVL 49

Expert Comment

by:Gustav Brock
Comment Utility
Yes. It was to have "appear" covered ... variables normally don't step forward.

/gustav
0
 

Author Comment

by:Frank Vertin
Comment Utility
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
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now