Solved

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

Posted on 2014-09-24
2
724 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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.
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

752 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