I have used this code for years -- had to modify it for 2007+ but it still works great. Allows users to use a simple time picker to populate time fields.
All date fields in question (in the application and form where the code works as well as this one, the form in question) are "Medium Time"
From a main form I have a clock button next to time fields. If they click on it I send the existing time information to the time selection form where the user can change it. Despite the fact that both the table and the forms fields are formatted as "Medium Time" one form only sends the Hour Portion of the time as military time. I have attached screen shots.
Private Sub cmdEndTime_Click()
DoCmd.OpenForm "fClockPopUp", , , , , , "frmSessions - EndTime"
If IsNull(Me.EndTime) = False Then
Dim strAmorPm As String
Forms!fClockPopUp!theTime = Me.EndTime
Forms!fClockPopUp!cboAMPM = UCase(Format(Me.EndTime, "am/pm"))
Forms!fClockPopUp!txtHour = Format(Me.EndTime, "hh")
<<< line in question
If Minute(Me.EndTime) < 10 Then
Forms!fClockPopUp!txtMin = "0" & Minute(Me.EndTime)
Forms!fClockPopUp!txtMin = Minute(Me.EndTime)