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

entering data from form into two tables

P: n/a
I'm trying to enter data from a form into two different tables. The
field names are identical in both tables. I only want to enter the
data once from the form. In each table a new record will be created.
Is this possible? Can someone tell me how to do this?

Dec 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
you could use the Before Insert event and use something like

dim strSQL as string
strSQL = "INSERT INTO MyTable(Field1, Field2,...) VALUES (" &
Me.Control.Value & "," & Me.otherControl.Value)
CurrentDB.Execute strSQL
The question is - why are you entering the data into two tables?

Dec 16 '05 #2

P: n/a
Good question. I probably don't need to do that. I should use the
keyed attribute for a 1 to many relationship instead of this field.
I'm new to Access and trying to figure things out. Thanks for the
question.

Dec 16 '05 #3

P: n/a
Ola R:

Yah you should take a step back and take the time to read up and
understand 'normalization'. It will save you mucho griefo down the
road. A Google search will turn up a ton of links. Relational db theory
boils down to three things:

1) every row has and must have a unique key
2) ALL information that can be identified solely by using that unique
key belongs in that table.
3) Information that requires additional information to uniquely
identify it belongs in a related table.

There's a lot of reasons to de-normalize - table size/ query
performance etc. - but it should never be done without good reason. AND
is easy - OR is hard.

King Ron of Chi

Dec 16 '05 #4

P: n/a
"King Ron" <Ki***************@covad.net> wrote
There's a lot of reasons to de-normalize - table size/ query
performance etc. - but it should never be done without
good reason. AND is easy - OR is hard.


But, unlike many other database software packages, particularly desktop DB
packages, you can denormalize in queries, and have those queries still be
updateable So, in Access, there are far fewer times that it is useful to
have a denormalized table, or to denormalize into a temporaty table.

Larry Linson
Microsoft Access MVP
Dec 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.