Pop Up "Time"

  • Thread starter Thread starter crystal
  • Start date Start date
C

crystal

Looking for the ActiveX or Visual Basic behind a pop up time or clock
to act much like the pop up calendar.

Need to enter in standard times in a control box: start time, end time
and a pop up time control would work great, unfortunately I haven't
been able to find it yet.

MSA2000 (unfortunately)

Hints??
 
I can't help with a popup, but for time it's usually not necessary. There
are only 24 hours in a day and only 60 minutes in an hour. If you want to
give the user an option to just point and click, you could put the options
(0-23 or 0-59) in two combo boxes and let them pick. You could then use a
hidden textbox to combine the two selections into one. You would do this in
the AfterUpdate event of each combo box. The textbox would be bound to the
time field in your table. In the form's Current event, you would get the
value from this textbox and use it to prepopulate the two combo boxes with
the currently stored time value. Set 0 (or your desired default time) as the
default value of each combo box.

Example combos to textbox:
Me.txtTime = Nz(Me.cboHour, 0) & ":" & Nz(Me.cboMinute, 0)

If you use AM/PM instead of a 24 hour clock, you would need a third
selection for that. It could be a third combo box or an option group.

Example textbox to combos:
If Not Me.NewRecord Then
Me.cboHour = Hour(Me.txtTime)
Me.cboMinute = Minute(Me.txtTime)
End If

The Hour function will return the hour in 24 hour format, so if it's 10pm,
you will get 22. If you use AM/PM, you would need to subtract 12 from any
value greater than 12 and set the AM/PM selection to PM.
 
Back
Top