Update query to insert a new record

  • Thread starter Chris B via AccessMonster.com
  • 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?
 
J

John Vinson

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top