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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello Experts, I have an applica

Status
Not open for further replies.

vmolasi

Programmer
Aug 13, 2003
12
FR
Hello Experts,

I have an application wherein I have to generate a report based on Date & Time inputs from a form. The date and time inputs must be from combo boxes on a form, such that each date and field value has a combo box viz day, month, year each a has a combo box, and hour minute and second also have their respective combo boxes. The user then has to select the required date and time from these boxes. Any advice on how to achieve this?

Thanks
 
Why so complicated? Why not use something like the Microsoft DateTimePicker ActiveX control (mscomct2.ocx). The control has two modes, Dropdown Calendar and Time Format.
 
vmolasi

First, lets go address some basics...

The date / time data type in Access is
Per Access "Date and time values for the years 100 through 9999." It is a double decimal number using 8 bytes.

It is a special number for two reasons.

- The integer component represents the date and the decimal component represents the time.
- Applications tend to use a "Julian date" which is a number that counts up from Jan 1, 4713 BC. For example, Aug 14, 2003 9:00 AM is 2,452,865.875.
(That is a lot of days)

So when you use a date field to capture a date, you are also capturing a time. =Now() Would give you today's date and time.

Using the format command, it is possible to display the date and time together -- FORMAT(dtStart, "mm/dd/yy hh:mm:ss AMPM")

However, from a user's perspective, I suspect it would be easier to enter the date and the time in two different fields.

So going back to evalesthy comment - "Why so complicated?"

Access has many tools for working with dates and time. To take aadvantage of the tools, your data would need to use the date data type.

From your description, it almost sounds like you want to gather the information without using the date data type -- different fields for year, month ... second.

Access help has a lot of information on Date and time. A lot of Tek-Tips deal with various date and time issues. There are even some real slick ways of tieing a calendar popup to a combo box.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top