Date/Time autofill

fireman_gcfd

Registered User.
Local time
Today, 10:27
Joined
Aug 14, 2007
Messages
25
Hello

I am working on a project in which I would like some fields autofilled on the form. The attempt is this...when the person selects "Day" or "Night" shift from a combo box, I would like the start and finish times to automatically fill in (i.e. 0700 and 1900 for day shift and vise versa). The start and finish times being 2 seperate fields of course. Additionally, I would like to have the start and finish date reflect the same way. To clarify, when I input the start date and select night shift from the combo box, the date will add 1 for the finish date.

If you need further clarification of my request please feel free to ask. I appreciate any and all help you can provide.

thanks

Jaz
 
If you put this in the "On Change" event of combo box called "Input" -

Private Sub Input_Change()
If [Input] = "Day" Then
[StartDate] = Date
[EndDate] = Date
[StartTime] = #7:00:00 AM#
[EndTime] = #7:00:00 PM#
Else
[StartDate] = Date
[EndDate] = Date + 1
[StartTime] = #7:00:00 PM#
[EndTime] = #7:00:00 AM#
End If
End Sub

it will update the text boxes called StartDate, EndDate, StartTime, EndTime when the value of "Input" changes from Day to Night. Set the values of the Input combo with a value list, and set the formats of the text boxes to Short Time / Short Date as appropriate.

Chris B
 

Users who are viewing this thread

Back
Top Bottom