Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / December 2005

Tip: Looking for answers? Try searching our database.

entering data from form into two tables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ryan - 16 Dec 2005 18:11 GMT
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?
pietlinden@hotmail.com - 16 Dec 2005 18:43 GMT
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?
ryan - 16 Dec 2005 19:00 GMT
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.
King Ron - 16 Dec 2005 21:06 GMT
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
Larry Linson - 17 Dec 2005 04:06 GMT
> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.