By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,519 Members | 2,416 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,519 IT Pros & Developers. It's quick & easy.

Using Form Data in User-Entered Query Search Criteria

P: n/a
I am attempting an access database which tracks blood components in our
medical facility. When a component is issued to a patient there is a
button to push which links to a report that runs a query. (The report
is basically a paper that gets put in the medical record.) The user
must enter the unique key for the component at a promt, which ensures
the report generated will be for that component only. My question is if
there is a way to capture and use that key automatically when pressing
the button. Currently the user must retype it or copy it from the form
and paste it in the prompt. If I need to clarify something, please let
me know--I may not have the Access developer lingo down yet...

Dec 21 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I should have mentioned:

MS Access 2003 on Win XP

Dec 21 '06 #2

P: n/a
The report is based on a query, which needs a parameter to be filled when
the report is open.

Apparently, that value is already on the form that you use to call the
report.

The easiest way to solve this is to set the parameter equal to the control
on the form that contains the data you need:

In SQL:

WHERE table.component_key=[Forms]![MyForm]![txtKeyField]

You can also use the query grid to just fill in the parameter portion,

[Forms]![MyForm]![txtKeyField]
--
Darryl Kerkeslager

<nj*********@gmail.comwrote
>I am attempting an access database which tracks blood components in our
medical facility. When a component is issued to a patient there is a
button to push which links to a report that runs a query. (The report
is basically a paper that gets put in the medical record.) The user
must enter the unique key for the component at a promt, which ensures
the report generated will be for that component only. My question is if
there is a way to capture and use that key automatically when pressing
the button. Currently the user must retype it or copy it from the form
and paste it in the prompt. If I need to clarify something, please let
me know--I may not have the Access developer lingo down yet...

Dec 21 '06 #3

P: n/a
I knew it had to be something easy. I used the second solution and it
works beautifully. Thank you!
Darryl Kerkeslager wrote:
The report is based on a query, which needs a parameter to be filled when
the report is open.

Apparently, that value is already on the form that you use to call the
report.

The easiest way to solve this is to set the parameter equal to the control
on the form that contains the data you need:

In SQL:

WHERE table.component_key=[Forms]![MyForm]![txtKeyField]

You can also use the query grid to just fill in the parameter portion,

[Forms]![MyForm]![txtKeyField]
--
Darryl Kerkeslager

<nj*********@gmail.comwrote
I am attempting an access database which tracks blood components in our
medical facility. When a component is issued to a patient there is a
button to push which links to a report that runs a query. (The report
is basically a paper that gets put in the medical record.) The user
must enter the unique key for the component at a promt, which ensures
the report generated will be for that component only. My question is if
there is a way to capture and use that key automatically when pressing
the button. Currently the user must retype it or copy it from the form
and paste it in the prompt. If I need to clarify something, please let
me know--I may not have the Access developer lingo down yet...
Dec 21 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.