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

Ugggh: Linking query to table

Status
Not open for further replies.

spongie1

Technical User
Nov 24, 2003
57
US
I want to discuss possible solutions to my problem. I cannot see how to solve my problem, elegantly.

I have a query that lists a date, shift, and machine. The date and shift are taken from a production table. Those two fields represent a unique listing of all times that product was generated in the department. The machine field lists all machines in the department.

The resulting query is a listing of all machines in the department joined with all dates and times production occured in the department.

I want to take that query and associate a comment next to each individual entry in the query. If I create a table whose only fields are an ID field and a comment field, how do I link the query to the table?

I was thinking along the lines of a make table query, but that doesn't quite do what I want...

I am not familiar with how an append query works...

I am thinking that I have to find some way of generating a unique ID for the query that I can then link to the other table.

Whether that is by using the query to generate a table... or what I am not sure.

If I generate a table I am also concerned about erasing my previous data, or generating duplicate entries.

Could someone steer me in the right direction. Ugggh, I find this very frustrating
 
Maybe I could characterize this problem differently...

I want to use a query to update a table. I only want to update the table with new data. By new I mean data that exists in the exists in the query but not in the table.

This would probably do what I want.
 
Ok, I solved another one of my posted problems before getting an answer.

The solution involves using an append query with code similar to this...

Code:
INSERT INTO Table1 ( ID, Shift, LnNmMachine )
SELECT xxx.ID, xxx.Shift, tblStdLineName.LnNmMachine
FROM xxx, tblStdLineName
[b]WHERE (((Exists (SELECT Table1.ID FROM Table1))=False))[/b]
ORDER BY xxx.Shift, tblStdLineName.LnNmMachine;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top