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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create record in one table; related record auto created in another 1

Status
Not open for further replies.

Sherman6789

Programmer
Nov 12, 2002
127
US
Hi,

I need to have two related tables prepared.

Table 1 will contain user ids, names, departments, phone and other info about the users.

Table 2 will contain user ids, passwords, access levels and other restricted information about the users.

Table 2 should be hidden but used to validate input in sign-on dialog box and used to determine which switchboard and dialog boxes are available to the user.

As records are added to Table 1; an equivalent record is added to Table 2.

I've prepared similarly related tables before but I am not able to do it now. I've created a relationship between the tables with 1. Enforced Referral Integrity, 2. Cascade update record checked, 3. Cascade delete record checked.

Can you tell me what I have forgotten or need to do to accomplish the automatic creation of a record in Table 2 when one is created in Table 1?

Thanks.
 
I assume you are using a form to add records to Table-1.
I assume the recordsource for the form is a query which contains both the tables viz Table-1 and Table-2.

In that case just place a Textbox and bind it to a field in Table-2 and set its visible property to false.

Each time a record is added to Table-1, assign some relevant value to the Textbox bound to Table-2 using VB code.

Records get automatically added to Table-2.

In case you are not using a form.
Then you must create a query containing the two tables viz., Table-1 and Table-2 and then enter all data in Table-1 and atleast one field value in Table-2.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top