Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Open query using parameters in MS Access

Status
Not open for further replies.

cmlr

Industrial
Dec 30, 2008
11
Hi all,

I'm a Control Systems Engineer with not much experience in database programming, but I am trying to create an application using MS Access. I realize I may make a fool of myself asking this question, but I'll just have to risk it.

My database has several tables. The first table contains the panel numbers:

ID | Panel number | Description
-------------------------------------
1 | P-001 | Control panel
2 | P-002 | Network panel
3 | P-003 | Remote I/O panel


The second table contains an overview of materials:

ID | Description
------------------------
1 | Enclosure
2 | Terminals block
3 | Cable gland


In a third table I keep track of the amount of materials per panel:

ID | Panel ID | Material ID | Qty
----------------------------------------
1 | 1 | 1 | 1
2 | 1 | 2 | 40
3 | 1 | 3 | 6
4 | 2 | 1 | 1
5 | 2 | 3 | 7
6 | 3 | 1 | 1
7 | 3 | 2 | 25


I have created a form to show the panel list (i.e. the first table), and want to add a button to this form that will show the materials in the selected panel.
I have already created a query that shows the panel name, material description and quantity for all panels, but I want the query to only show the data of the currently selected table. I know I can open the query with a parameter, but would like to know how I can automatically use the "panel ID" as the parameter?

Thanks for your help.
Caspar
 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor