I have the following code that works, but I'm wondering if there may be an easier approach code wise. Basically I have 3 radial buttons that the users can select. Once selected they are they prompted for a search criteria. They can have any combination of the 3 radials.
Code:
Dim strCriteria As String
strCriteria = ""
If IsNull(Me.optLoc) = False Then
strCriteria = strCriteria & "[loc_no] ='" & InputBox("Enter State", "Loc") & "' AND"
End If
If IsNull(Me.optAmount) = False Then
strCriteria = strCriteria & "[inv_no] =" & InputBox("Enter Inventory ID", "Amount") & " AND"
End If
If IsNull(Me.optClient) = False Then
strCriteria = strCriteria & "[wr_no] ='" & InputBox("Enter Work Order Number", "Client") & "' AND"
End If
If Len(strCriteria) = 0 Then
Me.Filter = ""
Me.FilterOn = False
Else
strCriteria = Left(strCriteria, Len(strCriteria) - 3)
End If
MsgBox strCriteria
DoCmd.OpenForm "frmEntry", acNormal, , strCriteria
Me.optLoc = Null
Me.optAmount = Null
Me.optClient = Null