Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 15th, 2005, 06:50 AM
Registered User
 
Join Date: Dec 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default User date and time select and pass to query

I have a query and in the criteria field want to add a date and time, where the user can select from a form calendar. I know I can create a form where the user can select both the date and time using the Microsoft date and time picker control 6, but how do i:

1. Have the format in say 15/12/2005 16:00:00 (I've tried playing around with the custom format on the date and time picker under properties but not sure if its a bug or me!)

2. Pass the date and time into the query criteria

thanks for any help!




 
Old December 15th, 2005, 09:56 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hiya,

   In order to change the Date/Time format, you need to change it on your system. Access (all apps) use the system time format, so perhaps this is effecting your ability to change this parameter.

If you are using a form field to hold the Date and Time (I don't know if it is one field or two) then in the query design, in the criteria for the date (and time) field(s), put this code:

[Forms]![YourFormName].[DateFieldName]

When the query is run, it will look for the criteria the user has selected on your form.

You may want to put a check on the button that calls the query or the report to see if the field is populated, otherwise the user will get an error.

HTH

mmcdonal
 
Old December 16th, 2005, 08:59 AM
Registered User
 
Join Date: Dec 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Thanks very much for your help. As I can't change the system time date format, I've used the calendaer control 9, and a second Text box with time validation format.

I've set-up a third text box that is bounded and combines the two selections, the first one being the date from the calendar selected and the second one being the Time Input

=[ActiveXCtl0] & " " & [Time_Input]

How do I update the third text box so that if the user selects a different date from the calendar this is what is displayed? I've tried various options but not managed to figure this out??

The query runs fine as you suggested..

thx !








Similar Threads
Thread Thread Starter Forum Replies Last Post
date and time in EST time zone anboss XSLT 1 May 21st, 2008 01:42 PM
Help for Select SQL Query with date filter pushpa SQL Server DTS 0 February 6th, 2007 10:06 AM
Unable to pass Query to report at run time jdaulagar VB Databases Basics 0 November 14th, 2006 08:07 PM
Syntax to query Date/Time in MS ACCESS chiuyianl Access 4 March 31st, 2005 09:08 AM
insert system date. no date and time jimmy Access VBA 6 November 20th, 2003 01:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.