Hi,
I'm still having a couple problems with searches.
I have a search form, frm_Search.
The form I am trying to filter, frm_Form1
An unbound combobox on frm_Search, Cbo_Permit
6 different fields bound to tbl_Table1 within frm_Form1, fld_Permit1, fld_Permit2...
The 6 bound fields are within a custom made "option group" so that users can select the related permit(s) via check boxes. I understand this is a poor design because of multiple fields in the table but it looks good on the form and each record can have multiple permits.
What I would like, is to use an unbound combobox within frm_Search, Cbo_Permit, using the names of the fields I shown above. The user then selects a permit within the combobox and presses a command button to open frm_Form1 filtered to that particular permit.
I need to know if this is possible as it will be one of the main searches users will make.
With other searches I've used the code:
The problem is, this code only filters by one field and I need to filter by multiple fields.
Any help would be great,
Leigh
I'm still having a couple problems with searches.
I have a search form, frm_Search.
The form I am trying to filter, frm_Form1
An unbound combobox on frm_Search, Cbo_Permit
6 different fields bound to tbl_Table1 within frm_Form1, fld_Permit1, fld_Permit2...
The 6 bound fields are within a custom made "option group" so that users can select the related permit(s) via check boxes. I understand this is a poor design because of multiple fields in the table but it looks good on the form and each record can have multiple permits.
What I would like, is to use an unbound combobox within frm_Search, Cbo_Permit, using the names of the fields I shown above. The user then selects a permit within the combobox and presses a command button to open frm_Form1 filtered to that particular permit.
I need to know if this is possible as it will be one of the main searches users will make.
With other searches I've used the code:
Code:
Private Sub SOMEBUTTON_Click()
Dim MyVar
MyVar = "[SOMEFIELD] = " & SOMECOMBOBOX.Value & "" 'This is the filter
DoCmd.OpenForm "SOMEFORM", WhereCondition:=MyVar 'This opens the form with the filter above.
End Sub
Any help would be great,
Leigh
Comment