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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to Queries

Status
Not open for further replies.

redbirdofthesouth

Programmer
Jul 18, 2002
13
0
0
CA
I am new to query structure in access although familiar with SQL. I am not even sure if my query will answer my problem.
I am building a form that will enter the data for a computer. Each computer will have multiple components and multiple kinds of software installed on it.
I will be able to search for the computer and generate a report about the computer and all its components and all its software.
I have tables for computers, software and components.
I believe a query will be able to hold all the data for each machine (software.computerID = components.computerID = computers.computerID).
My problem is entering the data and attaching it all together in the data entry stage.
Any ideas? Criticisms? Accusations of brain death?
 
Try creating relationships between your tables (Select Tools, Relationships from the menubar, add the tables to the Relationships window, and drag from the PK in one table to the corresponding field in the second table).

J. Jones
jjones@cybrtyme.com
 
Yeah I've done that. I just am having difficulty in thinking about how it all hangs together.
I think my real difficulty is understanding how the query will look for the right computer: where is that info entered and how do I phrase the query to look for that info?
I have made queries that asked for input but I don't know how I did it and I haven't been able to duplicate that...
 
If you already have the relationships set up, you should be able to do it all graphically from the query design grid.

Add all three tables to the design view of the query. Since you have relationships setup, the relationships between the tables will already be there (that takes care of your joins).

Then, just include the fields you want to see in your query in the query design grid at the bottom. To prompt the user for a particular computer, include a parameter in the criteria for the computer). You can include a parameter by including something like [Enter computer id] in the criteria. Basically, access thinks anything inside of [] is a field, so it will search the tables to find a field named "Enter computer id". If it doesn't find one, it will prompt for it.

If you want to write the SQL, you can use View, SQL View.

Hope this helps... J. Jones
jjones@cybrtyme.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top