chanman525
IS-IT--Management
Hey all. I have a Calendar control and 2 text boxes. The user is trying to gather information for certain days between 6:00 am of the 1st date and 6:00 am of the second.
First they click the textbox and then they select the date they want to start. This enters that date in the corresponding checkbox. They then do the same for the second.
The problem I'm having is, I want it to show 6:00:00 am right after the date in that check box, and I'm not sure how to go about it. Can anyone help?
Below is the code I have so far:
Option Compare Database
Dim datebox As TextBox
Private Sub txtenddate_Click()
Set datebox = txtenddate
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(datebox) Then
ocxCalendar.Value = datebox.Value
Else
ocxCalendar.Value = Date
End If
End Sub
Private Sub txtstartdate_Click()
Set datebox = txtstartdate
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(cboOriginator) Then
ocxCalendar.Value = datebox.Value
Else
ocxCalendar.Value = Date
End If
End Sub
Private Sub ocxCalendar_Click()
' Copy chosen date from calendar to originating combo box
datebox.Value = ocxCalendar.Value
' Return the focus to the combo box and hide the calendar and
datebox.SetFocus
' Empty the variable
Set datebox = Nothing
End Sub
Thanks for any help you can provide.
First they click the textbox and then they select the date they want to start. This enters that date in the corresponding checkbox. They then do the same for the second.
The problem I'm having is, I want it to show 6:00:00 am right after the date in that check box, and I'm not sure how to go about it. Can anyone help?
Below is the code I have so far:
Option Compare Database
Dim datebox As TextBox
Private Sub txtenddate_Click()
Set datebox = txtenddate
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(datebox) Then
ocxCalendar.Value = datebox.Value
Else
ocxCalendar.Value = Date
End If
End Sub
Private Sub txtstartdate_Click()
Set datebox = txtstartdate
ocxCalendar.Visible = True
ocxCalendar.SetFocus
If Not IsNull(cboOriginator) Then
ocxCalendar.Value = datebox.Value
Else
ocxCalendar.Value = Date
End If
End Sub
Private Sub ocxCalendar_Click()
' Copy chosen date from calendar to originating combo box
datebox.Value = ocxCalendar.Value
' Return the focus to the combo box and hide the calendar and
datebox.SetFocus
' Empty the variable
Set datebox = Nothing
End Sub
Thanks for any help you can provide.