Hi folks
Please can someone tell me where I am going wrong to get this error?
I have a main form (frmsearch) which has controls on it that are used to search the records in the subform (frmentries). The subform runs off a query which looks to frmsearch to get the criteria. The controls on frmsearch are a combination of text boxes and combo boxes, and date fields which can be filled in using a calendar contol.
There are two command buttons, one to execute the search, and another to clear all search fields to start again. It's in the clear search command that I get the error.
This is the on click event, the debugger highlights "ctl.value = null":
Private Sub cmdclearsearch_Click()
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox, acListBox, ocxcalendar2
ctl.Value = Null
Case acCheckBox
ctl.Value = False
End Select
Next ctl
Me.Refresh
Form_frmentries.Requery
End Sub
What am I missing here?!
Many thanks
F
Please can someone tell me where I am going wrong to get this error?
I have a main form (frmsearch) which has controls on it that are used to search the records in the subform (frmentries). The subform runs off a query which looks to frmsearch to get the criteria. The controls on frmsearch are a combination of text boxes and combo boxes, and date fields which can be filled in using a calendar contol.
There are two command buttons, one to execute the search, and another to clear all search fields to start again. It's in the clear search command that I get the error.
This is the on click event, the debugger highlights "ctl.value = null":
Private Sub cmdclearsearch_Click()
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox, acListBox, ocxcalendar2
ctl.Value = Null
Case acCheckBox
ctl.Value = False
End Select
Next ctl
Me.Refresh
Form_frmentries.Requery
End Sub
What am I missing here?!
Many thanks
F