From one into two?

bdb25

Registered User.
Local time
Today, 16:17
Joined
Feb 22, 2007
Messages
19
hey i was just wondering if data entered into one text box with a form when saved can enter itself into two different fields within two different tables? and if so how? i guess it'd probably involve scripting of some sort but i'm a total beginner

thanks in advance
 
One of the tenants of a Relational DB is that data *only* exists in one place within the db. Having the same data (other than keys) in fields in more than one table flies in the face of this tenant. Do you know how to join two tables in a query so that *all* of the fields from both tables are available?
 
No i dont know how to do that, i have a number of tables into which data is inputted however i have a schedule as well that displays certain data, i basically wanted to have the DeliveryDate CustomerSurname and CustomerFirstName to be almost like copied from the three cells in one database and stored within one cell in the schedule table.

that probably makes no sense but i cant think of how better to explain it
 
If you have a table with a primary key (say an AutoNumber) then you can place the value of that key in another table as a ForeignKey. They're both LongInteger fields. If one table is say Orders and the 1st table was Customers, then you can relate the two tables in a 1:M relationship. One customer can have Many orders. You would go to Tools>Relationships... and put both tables in the set and drag the PrimaryKey from the Customers table to the Orders table to define the relationship. That is the same place where you can turn on Referential Integrity enforcement and let Access make sure that the Order table never has a CustomerID that does not exist in the Customer table. Now you can create an Order query that includes the Customer table fields for First and Last name or whatever you want. They are available as if everything was in one table. Post back if you need further assistance.
 
thanks for your help i'll have a try at it and let you know how it goes
 
Queries are the real power of an RDBMS. Good luck and have fun.
 

Users who are viewing this thread

Back
Top Bottom