Multiple Search Question? (1 Viewer)

Hydra427

Registered User.
Local time
Yesterday, 22:57
Joined
Mar 9, 2012
Messages
40
I am running the following event procedure and would like to know if it is possible to return more than one selection. As an example on Private Sub Command90_Click() I would like to return "Y99" & "Y98" & "Y97" So that when the "Yesteryear Quick Search Form Query" opens it will return all models with the "Y99", "Y98" & "Y97" designation. Any thoughts would be greatly appreciated.

Private Sub Command90_Click()
Forms![Yesteryear Quick Search Main]![test] = "Y99"
stDocName = "Yesteryear Quick Search Form Query"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub

Thanks, John
 

John Big Booty

AWF VIP
Local time
Today, 12:57
Joined
Aug 29, 2005
Messages
8,263
I think you could use the Or operator to return multiple results.

BTW, your code seems to be missing a few elements :confused:

Also please refer to this post prior to posting code again.
 

Hydra427

Registered User.
Local time
Yesterday, 22:57
Joined
Mar 9, 2012
Messages
40
John, can you explain a little more about the "Or" argument, I have tried several combinations and I can't get any returns when I run the event procedure. Can you show an example of how the "Or" argument should be used.

You also mention that my code is missing a few elements. I am not sure what I am missing but I am open to suggestions.

Thanks, John
 

John Big Booty

AWF VIP
Local time
Today, 12:57
Joined
Aug 29, 2005
Messages
8,263
I'd do something like;

Code:
Private Sub Command90_Click()

Dim stDocName As String
Dim stLinkCriteria As String


stLinkCriteria = "[test] = 'Y99' Or [test] = 'Y89'"
stDocName = "Yesteryear Quick Search Form Query"

DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
 

Users who are viewing this thread

Top Bottom