Docmd.sendoject("query A") where [query A].[Invoice number] = SearchInvNr

MarcelMegens

Registered User.
Local time
Today, 05:31
Joined
Jun 8, 2004
Messages
16
I would like to use the sendobject function but in a way that I only get lines where a certain criteria is met.

E.g.

Dim SearchInvNr

SearchInvNr = "12345"

and then

Docmd.sendoject("query A") where [query A].[Invoice number] = SearchInvNr

note: [Invoice number] is the field name in the query
(and I don't want to put 12345 in the query itself)

Any suggestions?
 
I would like to use the sendobject function but in a way that I only get lines where a certain criteria is met.

E.g.

Dim SearchInvNr

SearchInvNr = "12345"

and then

Docmd.sendoject("query A") where [query A].[Invoice number] = SearchInvNr

note: [Invoice number] is the field name in the query
(and I don't want to put 12345 in the query itself)

Any suggestions?
Use a form to pass the parameters to the query. Open the query and in DESIGN VIEW, and in the criteria use this [changing the names to your actual names, of course]:

[Forms]![YourFormNameHere]![YourControlNameHere]
 

Users who are viewing this thread

Back
Top Bottom