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
200 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 51

Expert Comment

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

=Date()

/gustav
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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

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

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!

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.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

623 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