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

x
?
Solved

In Access 2010 how can a text box default value equal todays date and a specific time?

Posted on 2014-09-24
2
Medium Priority
?
805 Views
Last Modified: 2014-09-24
I have an Access 2010 database with a form containing two unbound text boxes. I'm referencing the two unbound text boxes to specify from and through date/time criteria for a query. I'm trying to find a way to have the default value of the "from" text box to be yesterday's date at 7AM (Example: "9/23/2014 07:00:00 AM") and the through text box to have a default value of today's date in the same format. If I use the functions "=date()-1" and "=date()" as default values I get the dates I need, but I can't seem to find a way to get the 7AM time to appear. I tried using "=date()-1 " 07:00:00 AM"" but that just generates #type! error.
0
Comment
Question by:Brook_Lane
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 40342564
try

= date() - 1+ #7:00:00 AM#
0
 

Author Closing Comment

by:Brook_Lane
ID: 40342575
That's exactly what I needed.. thank you! I can't believe how quickly you replied too!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

972 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