Can I use a variable as criteria?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My query appends appropriate fields from "tblAccountsPayable" to
"tblTransactions" (check table) at the touch of a button on a form. Problem
is, it appends the fields from all records in "tblAccountsPayable". I have
saved the primary key of the record I want in a variable. Can I use this
variable as the query criteria? In the query design view? In VBA? or...am I
barking up the wrong tree...
Thank you for your attention to this question. Your help will be much
appreciated.
Cheers,
Gus
 
mscomdex said:
My query appends appropriate fields from "tblAccountsPayable" to
"tblTransactions" (check table) at the touch of a button on a form. Problem
is, it appends the fields from all records in "tblAccountsPayable". I have
saved the primary key of the record I want in a variable. Can I use this
variable as the query criteria? In the query design view? In VBA? or...am I
barking up the wrong tree...
Thank you for your attention to this question. Your help will be much
appreciated.

The easiest way (probably!) is create a Public Function in a module
that returns the variable you're using - you can then use the function
in your query.
 
Back
Top