Set Query Criteria based on selection from Form

S

Scott

Hello,

I need some help setting a criteria for a query based on the selection made
on a form.

Background:
When my database opens, I have a form that appears and the user can select
an account for which they can see all transactions. I have a table of
financial transactions that includes about 1,000 accounts and let's say each
account has 20 transactions for a table with a total of 20,000 records. I
also have a query that only shows the 20 transactions for the desired
account.

Problem:
How do I get my query to run the 20 transactions for the account that was
selected on the form? For example, if the user selected account number 675 in
the form, I want 675 to be the Criteria within my query. I don't want to have
1,000 separate queries depending on which account was selected in the form.
Any ideas?

Thanks in advance for your help.

Scott
 
K

Klatuu

Assuming your form will remain open while the query is executed, you can
filter the query based on the value in a control on your form.
Using the query builder, it would be something like:
Forms!MyFormName!MyControlName
in the Criteria row of the query builder for the field you want to filter on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top