Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

1 form, 2 tables

Status
Not open for further replies.

Geodon7

Technical User
Jun 24, 2002
27
0
0
US
I have one form that asks for information that I want to be entered into 2 tables. I'm pretty sure I have to use "Cascade Update Related Fields" but I'm not sure how to do that? I'm also pretty sure that means the fields have to be related, but I wasn't sure how they should be related (neither of the fields are indexed). The field I want filled in on both tables is a text field that will be filled by the user entering text in a textbox. Any suggestions? Thanks all.

 
Why are you storing the same information in two fields in the same database if they aren't index fields?
 
I take it one of the fields is to be a primary key (i.e. unique identifier for each record) in one table and the other a foreign key (i.e. a link to a record in the first table)in the second table? If so, the primary key one should be set up as such, in which case it will be an index. The foreign key does not have to be an indexed field.

Go to Tools|Relationships in the main database window, ad the two tables, drag the primary key field from one table to the foreign key field in the other table. You will see a dialog that allows you to specify the relationship parameters, including cascade updates/deletes.

However, I am puzzled by your statement that you are "pretty sure" that you want to set these parameters. I would make absolutely sure before doing so, e.g. if someone deletes a record in Table 1 are you ABSOLUTELY SURE that you want ALL records related to the deleted record to be deleted automatically from Table 2, no questions asked, no going back etc, etc. Always be sure before you do something like this. Have fun! :eek:)

Alex Middleton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top