J
Jim Ory
WinXP and Access2002
For world time, only one source is acceptable, Universal Coordinated Time.
It is the same as Greenwich Mean Time. Our computers are based on this time
and we can pick which time zone we are in so the correct time will be on our
screens.
My main form consists of "customers", based on tblCustomers and a sub-form,
based on tblOperations, linked via 'customerID'.
On the sub-form for 'operations' I have three (date/time) text boxes bound
to 'operations' table. (Formatted to display the proper date or time.) One
for the date of the operation, one for the start of operation, and one for
the end of operation.
When I click on each text box, using a macro, I can set each to record; day,
time start, time end. Twice a year I have to modify the macros to add either
4 or 5 hours to Now(). This is the code: DateAdd("h",+4,Now()), or
DateAdd("h",+5,Now()). This works alright and I can easily change the actual
time via the keyboard if it does not correlate to the time I need to input.
My question is, however, how can I make an option group to select between
standard time and daylight savings time (this is the easy part), then use the
option group in the main form to make the selection, standard time or savings
time, so that when I click on the date fields of the sub-form the correct
number of hours will be added to Now()? (And thereby show the time in UTC
format.)
My first thought was make a table to store the results of the option group.
Then write VBA to access the table, return the stored option number (1 or 2),
use that number to apply the proper number of hours in the code to the 'On
Click' event of the time text boxes in the sub-form. Where do I place the
'option group'? Do I need to query the table for the option group result?
Then how do I implement the returned value? This is where I'm struggling.
My next question is; am I thinking that this is the best way to accomplish
this? Or do I need to reassess the means?
Any suggestions are, of course, welcome.
For world time, only one source is acceptable, Universal Coordinated Time.
It is the same as Greenwich Mean Time. Our computers are based on this time
and we can pick which time zone we are in so the correct time will be on our
screens.
My main form consists of "customers", based on tblCustomers and a sub-form,
based on tblOperations, linked via 'customerID'.
On the sub-form for 'operations' I have three (date/time) text boxes bound
to 'operations' table. (Formatted to display the proper date or time.) One
for the date of the operation, one for the start of operation, and one for
the end of operation.
When I click on each text box, using a macro, I can set each to record; day,
time start, time end. Twice a year I have to modify the macros to add either
4 or 5 hours to Now(). This is the code: DateAdd("h",+4,Now()), or
DateAdd("h",+5,Now()). This works alright and I can easily change the actual
time via the keyboard if it does not correlate to the time I need to input.
My question is, however, how can I make an option group to select between
standard time and daylight savings time (this is the easy part), then use the
option group in the main form to make the selection, standard time or savings
time, so that when I click on the date fields of the sub-form the correct
number of hours will be added to Now()? (And thereby show the time in UTC
format.)
My first thought was make a table to store the results of the option group.
Then write VBA to access the table, return the stored option number (1 or 2),
use that number to apply the proper number of hours in the code to the 'On
Click' event of the time text boxes in the sub-form. Where do I place the
'option group'? Do I need to query the table for the option group result?
Then how do I implement the returned value? This is where I'm struggling.
My next question is; am I thinking that this is the best way to accomplish
this? Or do I need to reassess the means?
Any suggestions are, of course, welcome.