Guest_imported
New member
- Jan 1, 1970
- 0
hi,
I want to be able to search a database using multiple fields, however it will only let me search with on field.
I want the search button to find these fields:
Make
Model
Reg
price
location
Seller type: Trade/private
Automatic/manual
Here is the code for "make" field:
Private Sub testing_Click()
On Error GoTo Err_testing_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Entry"
stLinkCriteria = "[Make]=" & "'" & Me![Make] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_testing_Click:
Exit Sub
Err_testing_Click:
MsgBox Err.Description
Resume Exit_testing_Click
End Sub
So could anyone tell me how to add the other field to this code so the command button will search all the field, instead of 1.
Thanx
I want to be able to search a database using multiple fields, however it will only let me search with on field.
I want the search button to find these fields:
Make
Model
Reg
price
location
Seller type: Trade/private
Automatic/manual
Here is the code for "make" field:
Private Sub testing_Click()
On Error GoTo Err_testing_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Entry"
stLinkCriteria = "[Make]=" & "'" & Me![Make] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_testing_Click:
Exit Sub
Err_testing_Click:
MsgBox Err.Description
Resume Exit_testing_Click
End Sub
So could anyone tell me how to add the other field to this code so the command button will search all the field, instead of 1.
Thanx