L
larry
I want to give my users an option to set a default date without allowing
them to go to the properties of the control.
Using the following seems to work, but I wonder if it'll cause problems
using a string (from the inputbox) in a date field. Will access make the
conversion automatically?
Private Sub cmdSetDefaultDate_Click()
Dim strDate As String
strDate = InputBox("Enter default date", "Set Date")
Me![myDate] = strDate
End Sub
Also, the command button cmdSetDefaultDate will be on a main form & the
field myDate is on it's subform. Would I still refer to the control with
Me! or does it need to be further identified? What's the proper way to
refer to controls in on a subform vs. a form?
Thanks
them to go to the properties of the control.
Using the following seems to work, but I wonder if it'll cause problems
using a string (from the inputbox) in a date field. Will access make the
conversion automatically?
Private Sub cmdSetDefaultDate_Click()
Dim strDate As String
strDate = InputBox("Enter default date", "Set Date")
Me![myDate] = strDate
End Sub
Also, the command button cmdSetDefaultDate will be on a main form & the
field myDate is on it's subform. Would I still refer to the control with
Me! or does it need to be further identified? What's the proper way to
refer to controls in on a subform vs. a form?
Thanks