Dim strWhere As String
Select Case Me.YourOptionGroupNameHere
Case 0 ' Client
strWhere = "[Client]='" & Me!YourSearchTextBoxNameHere & "*'"
Case 1 ' Site
strWhere = "[Site]='" & Me!YourSearchTextBoxNameHere & "*'"
Case 2 ' Survey Number
strWhere = "[Survey No]='" & Me!YourSearchTextBoxNameHere & "*'"
End Select
DoCmd.OpenForm "YourFormNameHere", acViewNormal,, strWhere
Post your db.
The code I presented would do it, but you have to substitute my field and text box names with your actual field and text box names. If that parameter box is showing up, then you didn't enter the correct field name for Survey No.
Did you zip it up again - this time with Normal Compression instead of Maximum? I still haven't received the second version you sent. I have only received the first one which I couldn't unzip.
Okay, I've been looking at your database.
1. Why do you have a subform on the client search form when you don't need one. You can just put the fields in the main form. Due to the way you have it the code I provided will not work.
2. The Survey number is not even in the recordset of the search form so you can't include that one. If you want to, you can open a different form if the Survey No is selected. That would require moving the code to open the Client Search form into both other Case statements and putting the one to open a Survey search form inside the other Case statement.
3. Change the Select Case statements to
Case 1
Case 2
Case 3
instead of Case 0, Case 1, Case 2 because your controls on the option group have values of 1-3 instead of 0-2 like I was originally thinking.