G
Guest
I'm trying to use the Month() function to extract the month of the date input
by the user. The user selects their date using a calendar and the calendar
value is placed in a text box on the form. I'm trying to extract the month
from the date in the text box on the form. Here's the code I have:
Private Sub goscalendar_Click()
Dim gosmonth
txtgosdate = goscalendar.Value
txtgosdate.SetFocus
gosmonth = Month(txtgosdate.Value)
goscalendar.Visible = False
End Sub
When I use this code I get the following error:
Run-time error '13':
Type mismatch
Any help appreciated. Thanks.
by the user. The user selects their date using a calendar and the calendar
value is placed in a text box on the form. I'm trying to extract the month
from the date in the text box on the form. Here's the code I have:
Private Sub goscalendar_Click()
Dim gosmonth
txtgosdate = goscalendar.Value
txtgosdate.SetFocus
gosmonth = Month(txtgosdate.Value)
goscalendar.Visible = False
End Sub
When I use this code I get the following error:
Run-time error '13':
Type mismatch
Any help appreciated. Thanks.