Update query to insert a new record

  • Thread starter Thread starter Chris B via AccessMonster.com
  • Start date Start date
C

Chris B via AccessMonster.com

Hi,
Hope this makes sense, i am still learning the lingo and correct terms to use.


I have a form with a subform based on two tables with a one-to-many
relationship.
I have imported data from excell which worked just fine into the main form
table.
I would like to run an update query to insert one record into each records
sub-form table, eg each customer with related purchases will have an entry
saying that they bought eg tomatoes.
So it needs to "create" an entry in each customers purchases table, can this
be done considering there are no purchases records existing in the sub form
table. Any sugestions?
 
Hi,
Hope this makes sense, i am still learning the lingo and correct terms to use.

Well, your subject line doesn't. An Update Query updates existing
records. An Append Query appends new records. They are two distinct
types of queries.
I have a form with a subform based on two tables with a one-to-many
relationship.
I have imported data from excell which worked just fine into the main form
table.
I would like to run an update query to insert one record into each records
sub-form table, eg each customer with related purchases will have an entry
saying that they bought eg tomatoes.
So it needs to "create" an entry in each customers purchases table, can this
be done considering there are no purchases records existing in the sub form
table. Any sugestions?

Use an Append query. Given the information you have provided, I can't
begin to guess just how it would be structured; I don't know the
mainform's recordsource, the subform's recordsource, or where the
information for the new records would originate!

If you're importing the data, or inserting the data automatically
using a Query, I'm not certain why any form is necessary (other than
to view and edit the final product). Am I missingsomething?

John W. Vinson[MVP]
 
Back
Top