I believe you need to dynamically build the where clause depending on what search field(s) they enter. This would be onClick on a "Search" Button on form.
' Create "Where: statement from all the criteria boxes that they enter data into on the form.
' DQ = Double Quote, SQ = Single Quote, HT = Hashtag
'For Text fields syntax is = '" & Me!TextField & "'" The quotes around this are (SQDQ & Me!TextField & DQSQDQ)'
'For Numeric fields syntax is = '" & Me!NumericField The quotes around this are (DQ & Me!NumericField)
'For Date fields syntax is = #" & Me!DateFIeld & "#" The quotes around this are (HTDQ & Me!DateField & DQHTDQ)
'For Like Searches syntax is Like '*" & Me!TextField & "*'" The quotes around this are (SQHTDQ & Me!TextField & DQHTSQDQ) This lets you search for any part of the value.
'For your specific program. Assume all are text except BusNumber. If you have spaces in names, use brackets [] around names:
================================================== =======================================
'Code Below, This would be onClick on a "Search" Button on form
Dim strSQL, strWhere As String
If Not IsNull(Me!SearchLastName) Then strWhere = strWhere & " AND LastName= '" & Me!SearchLastName & "'"
If Not IsNull(Me!SearchClass) Then strWhere = strWhere & " AND Class = '" & Me!SearchClass & "'"
If Not IsNull(Me!SearchSection) Then strWhere = strWhere & " AND Section= " & Me!SearchSection & "'"
If Not IsNull(Me!SearchBusnumber) Then strWhere = strWhere & " AND Busnumber=" & Me!SearchBusnumber
If Not IsNull(Me!SearchPhoneNumber) Then strWhere = strWhere & " AND SearchPhoneNumber= '" & Me!SearchPhoneNumber & "'" Assume this is a text field.
'Create SQL statement
strSQL = "SELECT * FROM qryYourQueryName"
'Trim leading " AND " from the where clause. If no criteria select will add no Where clause and return all records.
If Not IsNull(strWhere) And strWhere <> "" ThenstrSQL = strSQL & " WHERE " & Mid$(strWhere, 6)
End If
'Me![SearchFormName].Form.RecordSource = strSQL
'Me![SearchFormName].Requery