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

Send record fields to a table

Status
Not open for further replies.

Michael57

Technical User
Nov 15, 2005
131
CA
I have code that is used to create quotes from estimates. The code assigns quote numbers through an update query and sends the date to a quote table. I would like to have a table that has two fields one with the estimate number and one with the corresponding quote # but I don't know how to send the data to a table.
 
Either you want to update a record or append a record. Either way a query should be used. Maybe you could create an append query that links the estimate to the quote and produces the association in a table if one does not already exist. Or when producing the quote, use an append query to write a record of the quote and estimate IDs to a table.

To create a dynamic append query, first create the append query using the query builder and sample numbers. Then switch to SQL view so you can copy the code. Then set the sql statement to a string, but replace the sample numbers with the variables with the new IDs. Then use the currentdb.execute command to run the query and add the records.

I can discuss the other method of linking Estimates to Quotes and appending only the records that do not have association if you think that would be a better method. There must be a key to connect the two tables to ensure not duplicating associations. Just repost and ask. But be sure to document the key that can be used for the process.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top