I have a form with two pulldowns. The user can select number values in the pulldowns, then click a button to filter the form to either or both values. Problem is , if one of the pulldowns is null, I get an error message. I have an identical set up wherein the pulldowns are text values and do not get an error message when one is null.
I can put in some code to ignore one of pulldowns if it is null, but wonder if there is something simpler that I am missing. Any help much appreciated.
Code:
Me.FilterOn = True
Dim phrf1 As Long
phrf1 = Me.PHRFbox1
Dim phrf2 As Long
phrf2 = Me.phrfBox2
Me.Filter = "phrf=" & phrf1 & " Or phrf = " & phrf2 & ""