Hi,
I have a form with a number of tick boxes and a textbox which allows the user to select a tick box which may be name as an example and then type a name to match in the search box.
My code on the search button is:
I now would like to make it a combined search so that the user is able to search multiple "tick boxes" for example name and address at the same time. What's the best way to achieve this?
Thanks in advance...
I have a form with a number of tick boxes and a textbox which allows the user to select a tick box which may be name as an example and then type a name to match in the search box.
My code on the search button is:
Code:
Private Sub Command85_Click()
Dim strWhere As String
Dim bSelected As Boolean
bSelected = False
If Check86 = True Then
strWhere = "ArtsQuery1.Medium Like'*" & Me.Text81 & "*'"
bSelected = True
End If
If Check92 = True Then
strWhere = "ArtsQuery1.Notes Like'*" & Me.Text81 & "*'"
bSelected = True
End If
If Check94 = True Then
strWhere = "ArtsQuery1.ArtRef Like'*" & Me.Text81 & "*'"
bSelected = True
End If
If Check96 = True Then
strWhere = "ArtsQuery1.TitleOfWork Like'*" & Me.Text81 & "*'"
bSelected = True
End If
If Check98 = True Then
strWhere = "ArtsQuery1.Inscription Like'*" & Me.Text81 & "*'"
bSelected = True
End If
If Check100 = True Then
strWhere = "ArtsQuery1.Provenance Like'*" & Me.Text81 & "*'"
bSelected = True
End If
If Check102 = True Then
strWhere = "ArtsQuery1.Publication Like'*" & Me.Text81 & "*'"
bSelected = True
End If
If Check104 = True Then
strWhere = "ArtsQuery1.Exhibition Like'*" & Me.Text81 & "*'"
bSelected = True
End If
If Check106 = True Then
strWhere = "ArtsQuery1.Location Like'*" & Me.Text81 & "*'"
bSelected = True
End If
If Not bSelected Then
MsgBox "No search fields are selected. Please try again."
Else
Me.FilterOn = True
Me.Filter = strWhere
End If
End Sub
I now would like to make it a combined search so that the user is able to search multiple "tick boxes" for example name and address at the same time. What's the best way to achieve this?
Thanks in advance...