I’ve got a form with only an UnBound Combo Box and a cancel button. If an entry is selected in the combo box, another form opens with a filter set to that value.
If Cancel button is selected, I want the same form to open without the filter set.
I’ve been using a variable strFilt on the Open Event of form 2 to check.
DoCmd.OpenForm “frmQuery”, , , , , acDialog
strFilt = Forms!frmQuery![cboSelectID]
If IsNull(strFilt) Then
Me.FilterOn = False
Else
Debug.Print strFilt
Me.Filter = “[Word]=Forms!frmQuery![cboSelectID]”
Me.FilterOn = True
This works perfectly when I have a value in the combo box, but I get an Invalid use of Null in this line
strFilt = Forms!frmQuery![cboSelectID]
if there is no entry in the combo box.
Can anyone tell me where I’m going wrong please.
Thanks