Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repeated Date and Time queries

Status
Not open for further replies.

accessgoat

Programmer
Jul 23, 2002
15
US

Hi!
I need to check the validity of Start date and times entered by the user before I use them for calculation. There are a maximum of 10 fields for each (Start Date and Start Time). I dont want to write 20 queries for this purpose. Is there an easier way to do this? I would appreciate any feedback.

Thanks,
accessgoat. :-{}
 
Let me see if I understand. The user can input as many as 10 start dates and times on a form. You want to verify the validity of the dates and times. How do you validate the dates? Do you have a table containing valid dates and times? Or do you simply want to verify that the values entered are valid date time values and fall within a certain range of acceptable values? A little more detail would be helpful.

I recommend that you join Tek-Tips rather than post as a visitor. There are some benefits that make it worth the small effort to join. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Sorry I wasnt more clear. The user can pick upto 10 Dates and Times corresponding to 10 Items on the form. I need to verify that these dates and times are valid dates and times. I dont have any table for this purpose since these dates and times can fall anywhere in a calendar year and even within a range of years from 2000-2002. Any suggestions to simplify this process would be very helpful.

Thanks,
accessgoat.
 
I would set the format on the date text boxes to an acceptable date format (i.e., "mm/dd/yyyy") so Access will prevent entering malformed dates. Likewise, set the time text box formats to the time format ("hh:mm:ss"). Then in the after_update event of each text box, execute code to validate that the dates fall in an acceptable range. The times should be valid because format will prevent invalid dates. however, if you want to limit tmes to say 8:00AM to 6:00Pm, you cn add code to do this.

I'd create a commaon subroutine to validate dates and timee and call the appropriate routine from the after_update event of each text box. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top