Solved

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

Posted on 2014-09-24
2
756 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
[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
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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.
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…
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…

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