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
197 Views
Last Modified: 2014-12-03
I am trying to get the Current Date on an Access2013 Form.
0
Comment
Question by:Frank Vertin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 75
ID: 40397678
Dim dDate as Date
dDate = Now()

mx
0
 
LVL 75
ID: 40397680
OR

Dim dDate as Date
dDate = Date()

for just the Date w/o Time
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 40397805
Or, for a direct display in a textbox, use this expression:

=Date()

/gustav
0
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!

 
LVL 75
ID: 40397822
Would have posted that, but OP said 'variable' ... but good for OP to know anyway :-)
0
 
LVL 50

Expert Comment

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

/gustav
0
 

Author Comment

by:Frank Vertin
ID: 40414167
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 - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 40414238
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server views 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 Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

734 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