philljp390
Registered User.
- Local time
- Today, 19:13
- Joined
- Sep 7, 2003
- Messages
- 64
(I had posted this in the forms section, but its more of a VBA problem)
Im using a search from the sample database:
http://www.access-programmers.co.uk...ead.php?t=62853
I have adapted one form so that it has 2 text boxes:
txtDetails and txtCity
The current code, which works, is this:
If Not IsNull(Me.txtDetails) Then
strWhere = strWhere & " (tblInfo.Company) Like '*" & Me.txtDetails & "*' AND"
End If
If Not IsNull(Me.txtCity) Then
strWhere = strWhere & " (tblInfo.City) Like '*" & Me.txtCity & "*' AND"
End If
However, I would like txtDetails to search more than one field. Something along the lines of:
If Not IsNull(Me.txtDetails) Then
strWhere = strWhere & " (tblInfo.Company) OR (tblInf
rganisation) Like '*" & Me.txtDetails & "*' AND"
End If
This does not work, but hopefully someone can suggest a solution?
Im using a search from the sample database:
http://www.access-programmers.co.uk...ead.php?t=62853
I have adapted one form so that it has 2 text boxes:
txtDetails and txtCity
The current code, which works, is this:
If Not IsNull(Me.txtDetails) Then
strWhere = strWhere & " (tblInfo.Company) Like '*" & Me.txtDetails & "*' AND"
End If
If Not IsNull(Me.txtCity) Then
strWhere = strWhere & " (tblInfo.City) Like '*" & Me.txtCity & "*' AND"
End If
However, I would like txtDetails to search more than one field. Something along the lines of:
If Not IsNull(Me.txtDetails) Then
strWhere = strWhere & " (tblInfo.Company) OR (tblInf
End If
This does not work, but hopefully someone can suggest a solution?