How to pull a query on a particular table based on form selection

40 pts.
Tags:
Microsoft Access
Microsoft Access forms
Ok this is not as simple as the title suggest, this is what I'm trying to do: I have a database with about 30 tables (which are actually linked to Excel spredsheets). I need to be able to query each table and make a report only showing certain information for it. I started by doing individual queries for each table and individual reports for each query. That slowed the program down ALLOT! and made it crash all the time because it became so large. I figured out how to get a query for a list of table names using the MSysObjects table but I need to know how to have a user open a form and select a table name and have a query run on that table based on the user's selection. Ex. I have Tables called class A, class B, and class C. In each table is a list of student names, ages, and...height. I want a user to be able to open a form and in a drop down menu (or whatever) select class c and hit a command button that will start a query which will then produce a report listing only the students in that class over the age of 18 and with there name and age only appearing. PLEASE PLEASE HELP!!!!!

Answer Wiki

Thanks. We'll let you know when a new response is added.

How about the possibility of a design change? By design change, we mean that we can also make changes in the schema. This would provide us with a better option. It would be better to have one table for students, and a field to identify what class the student is in.

If that’s not an option, have a look to this Microsoft article, which might help you: How to build a dynamic query with values from a search form in Access 2007, in Access 2003, or in Access 2002.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Brianaaskew
    The only problem with that is I pull the list for all the students from a report that gets put out from an online program and it displays it by class and with the information I said and sometimes it has over a 1000 people in one class. To break it all down would take forever cause this gets updated every month.
    40 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following