Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access: change query criteria

Status
Not open for further replies.

sirhobbit

Technical User
Aug 24, 2003
4
AU
Hi all,

I have a access db which holds data for a number of Word mail merge templates. All of these word documents get their data from one query and these word docs are launched by buttons on a form.

Can anybody tell me how to write some code into the launch button which will take the record ID number from the currently displayed record and set it as criteria for the query?

My reason for this is so that the mail merge document has only 1 result instead of 1000.

Any help would be much appreciated.
 
In the query, set the criteria for the record ID field
to look at the active form.

Right click in the criteria area and use the "build" tool
there you can select forms>loaded forms>your_form and choose the record ID field

it will look something like [my_form]![record ID]...

then when the doc looks to the query, the query will look to the active form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top