D
Deki
This is my code:
Private Sub cmdEdit_Click()
Dim get_hour As String
Me.cmdPrevious.Visible = True
Me.cmdNext.Visible = True
Me.cboOwner.ControlSource = "OwnerID"
Me.dtDate.ControlSource = "DateWorkedOnProject"
get_hour = Hour(Me.txtTimeStart.Value)
If Len(get_hour) = 1 Then
get_hour = "0" & get_hour
End If
Me.cboHourStart.Value = get_hour
Me.cboMinuteStart.Value = Mid(Me.txtTimeStart, 3, 2)
Me.cboAmPMStart.Value = Right(Me.txtTimeStart, 2)
get_hour = Hour(Me.txtTimeEnd.Value)
If Len(get_hour) = 1 Then
get_hour = "0" & get_hour
End If
Me.cboHourEnd.Value = get_hour
Me.cboMinuteEnd.Value = Mid(Me.txtTimeEnd, 3, 2)
Me.cboAmPmEnd.Value = Right(Me.txtTimeEnd, 2)
End Sub
Time format for txtTimeStart is hh:nnAM/PM.
How can I add "0" to cboHourStart and/or cboHourEnd if it is a single digit,
but I don't want time to be displayed as military time (2:00 vs 14:00). As
you can see, I tried with Hour but I'm getting military time.
Thanks in advance
Private Sub cmdEdit_Click()
Dim get_hour As String
Me.cmdPrevious.Visible = True
Me.cmdNext.Visible = True
Me.cboOwner.ControlSource = "OwnerID"
Me.dtDate.ControlSource = "DateWorkedOnProject"
get_hour = Hour(Me.txtTimeStart.Value)
If Len(get_hour) = 1 Then
get_hour = "0" & get_hour
End If
Me.cboHourStart.Value = get_hour
Me.cboMinuteStart.Value = Mid(Me.txtTimeStart, 3, 2)
Me.cboAmPMStart.Value = Right(Me.txtTimeStart, 2)
get_hour = Hour(Me.txtTimeEnd.Value)
If Len(get_hour) = 1 Then
get_hour = "0" & get_hour
End If
Me.cboHourEnd.Value = get_hour
Me.cboMinuteEnd.Value = Mid(Me.txtTimeEnd, 3, 2)
Me.cboAmPmEnd.Value = Right(Me.txtTimeEnd, 2)
End Sub
Time format for txtTimeStart is hh:nnAM/PM.
How can I add "0" to cboHourStart and/or cboHourEnd if it is a single digit,
but I don't want time to be displayed as military time (2:00 vs 14:00). As
you can see, I tried with Hour but I'm getting military time.
Thanks in advance