By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 1,937 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

Insert data into 6 different tables

P: n/a
Hi5
Hi,

Any Idea how, I can make an Insert statement to insert data into 6
different tables, that are all holding all data of my database?

Is there any example?

I would be grateful if you could let me know of the ways to view data
in a query and then add data to database

Many thanks

Nov 13 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Helpful answers require one or more of the following:

1. A Clear and Complete Question with background sufficient that we
have a clue about what you are talking;
2. A Lucky Guess;
3. A Responder who is at the same stage of bewilderment as the poster.

The third may not lead to long term gain.

Nov 13 '05 #2

P: n/a
Hi5
Well Here is the my data tables:
1-Client
2-CChar
3-Category
4-Desc
5-Info
6-Other info (Optional)

relation ships are as follows:
Client 1 to many Ccahr
CLIENT 1 to many info
Info many to 1 to Desc
Cchar 1to many to Info
Cchar many to 1 to category

Now I sopuse the info is more or less soficient!!

Could you plaese help ma?

Many Thanks

Access newbie

Nov 13 '05 #3

P: n/a
Hi5 wrote:
Hi,

Any Idea how, I can make an Insert statement to insert data into 6
different tables, that are all holding all data of my database?


An INSERT statement will insert into just one table, in the reach of my
knowledge.
If the table structure is the same, you made a design error that must be
corrected.

--
Bas Cost Budde, Holland

Nov 13 '05 #4

P: n/a
Hi5 wrote:
Any Idea how, I can make an Insert statement to insert data into 6
different tables, that are all holding all data of my database?


No, an insert statement has a structure such that you insert into ONE table.

You will need six separate statements with criteria to make sure that
you get six separate sets of data.

However, if these six tables have the same data structure, it would be
silly in the extreme to have six separate tables.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #5

P: n/a
Hi5
Hi,
Many thanks for your answer, Of course the datasets are different.
we have the Primary and foriegn keys that are numbers and are the same
in all realated tables,to make it simple I.E.
I need to input client from a dropdown and category from a text box in
one go is there any way of doing that?
many thanks

Nov 13 '05 #6

P: n/a
I cannot think of a way to update or insert into multiple tables
related as many to one.
Typically in Access we use a forms and subforms to edit sych a
relation. I don't use subforms per se, but I believe that six is more
than the Access limit.
Regardless, SQL Insert Statements are very efficient, and running off
six in succession should be almost instantaneous.

Nov 13 '05 #7

P: n/a
Hi5 wrote:
Hi,
Many thanks for your answer, Of course the datasets are different.
we have the Primary and foriegn keys that are numbers and are the same
in all realated tables,to make it simple I.E.
I need to input client from a dropdown and category from a text box in
one go is there any way of doing that?
many thanks


Are you talking here about inputting the client that is chosen from the
drop down - "combo box" in Access - and whatever is in the text box into
a table, as a a single record?

Or, does the client from the combo box tell you what table the text box
needs to made a record of?

Or, will the client choice in the combo box specify what records from
another table need to be inserted into a specific table?

The way to do this is in code, associated with a command button, that
writes the SQL statement you need and the executes it. You can figure
out how to write the SQL statement by setting one up on the Access query
design window and then switching to SQL View (Click View->SQL View).
Copy the SQL and break it up to put in values from the text box and the
combo box in the appropriate places.

If you're not sure how to write the code, respond back with an answer on
the questions I make above and I'll try to show you how to do this -
enough at least, to set you on your way! 8)
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #8

P: n/a
"ly******@yahoo.ca" <ly******@yahoo.ca> wrote in
news:11*********************@f14g2000cwb.googlegro ups.com:
I cannot think of a way to update or insert into multiple tables
related as many to one.
Typically in Access we use a forms and subforms to edit sych a
relation. I don't use subforms per se, but I believe that six is
more than the Access limit.
Regardless, SQL Insert Statements are very efficient, and running
off six in succession should be almost instantaneous.


And likely should be wrapped in a transaction.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #9

P: n/a
Hi5
Hi,
Yes some data is to be selected from drop down and some fields are to
be filled by typing the data in.
That's very kind if you can show me how to code both of them
many thankls

Nov 13 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.