G
Guest
I have a text box named "Date", with control source "Assigned Date1" which is
the field in the access table it will populate. I have a calendar named
"Calendar1". Visible is set to No. I wish to click on text box - have
calendar appear - click date to populate in text box and have calendar
disappear. I have the following codes for calendar and text box.
Private Sub Calendar1_Click()
'Setdate written to the selected date and hide the calendar.
'MsgBox(ctrname)
'Dt_written.Value = Calendar1.Value
'Dt_written.SetFocus
'msgbox(currtl)
currctl.Value = Calendar1.Value
currctl.SetFocus
Calendar1.Visible = False
Set currctl = Nothing
End Sub
Private Sub Date_MouseDown(Button As Integer, Shift As Integer, X As Single,
Y As Single)
'show Calendar1
'Dim currctl As Control, ctrname As String
Set currctl = Screen.ActiveControl
ctrname = currctl.Name
Calendar1.Value = currctl.Value
Calendar1.Visible = True
End Sub
When I click on text box, calendar appears but when I click on date I get an
error
I would greatly appreciate assistance with this.
Thank you - Ken
the field in the access table it will populate. I have a calendar named
"Calendar1". Visible is set to No. I wish to click on text box - have
calendar appear - click date to populate in text box and have calendar
disappear. I have the following codes for calendar and text box.
Private Sub Calendar1_Click()
'Setdate written to the selected date and hide the calendar.
'MsgBox(ctrname)
'Dt_written.Value = Calendar1.Value
'Dt_written.SetFocus
'msgbox(currtl)
currctl.Value = Calendar1.Value
currctl.SetFocus
Calendar1.Visible = False
Set currctl = Nothing
End Sub
Private Sub Date_MouseDown(Button As Integer, Shift As Integer, X As Single,
Y As Single)
'show Calendar1
'Dim currctl As Control, ctrname As String
Set currctl = Screen.ActiveControl
ctrname = currctl.Name
Calendar1.Value = currctl.Value
Calendar1.Visible = True
End Sub
When I click on text box, calendar appears but when I click on date I get an
error
I would greatly appreciate assistance with this.
Thank you - Ken