I'm still a little fuzzy about what you are trying to do but here is an example of one way you could do what you are asking. Perhaps this will get you started or raise some more questions.
Lets assume you have a customer file with customer name, address, city, state, phone number with a separate area code field and you want to allow a search by some combination of city, state and area code.
First create comboboxes for the city, state and area code fields and populate them with sql like the following:
cboCity - strSQL = "Select Distinct city From tblTable " _
& "Order By city"
cboState - strSQL = "Select Distinct state From tblTable " _
& "Order By state"
cboAreaCode - strSQL = "Select Distinct areacode " _
& "From tblTable Order By area code"
Note: In all of the above cases, you will need to use square brackets [] around any fields or table names which contain embedded spaces (eg [Area Code]).
Then you use the output from the above combo boxes to generate a WHERE clause on the fly something like this:
Dim strSQL As String
Dim strWhere As String
strWhere = " Where "
If cboCity <> 0 Then 'a row was selected
strWhere = strWhere & "city = '" & cboCity & "' And"
If cboState <> 0 Then 'a row was selected
strWhere = strWhere & "state = '" & cboCity _
& "' And"
If cboAreaCode <> 0 Then 'a row was selected
strWhere = strWhere & "[area code] = '" _
& cboAreaCide & "' And"
If cboAreaCode <> 0 Then 'a row was selected
strWhere = strWhere & "areacode = '" _
& cboAreaCode & "' And"
If Len(strWhere) = 7 Then 'Nothing selected - Use all
strWhere = vbNullString
or you might want to require at least one selection
Else
'Strip the last trailing " And"
strWhere = Left$(strWhere, Len(strWhere) - 4)
End If
strSQL = "Select fld1, fld2, etc From tbl1, tbl2, etc" _
& " Where clause1, clause2, etc And " & strWhere _
& " Order By and other SQL statements as needed"
DoCmd.RunSQL strSQL
What you are doing is building a where clause on the fly with the data selected by the user from the combo boxes on your form. A couple things to be aware of: text fields need to be delimited by single quotes ' (see code above for examples of this), date fields are delimited by pound signs # instead of single quotes ' and numeric fields don't require anything.
Hope this helps get you started! Have fun and post how it turns out for you.