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!

Adding records with referential integrity

Status
Not open for further replies.

dtutton

Technical User
Mar 28, 2001
58
DE
Can one use rferential integrity to add a record to two tables? I have tested with delete and it works fine but cannot get to add a recod to both tables ?

David
 
Hi David,
No sir. You can get it to update an existing record but not add. If you work off a form, in the after update event of the "connecting" field, after first saving the record, have it run a query that appends the same value to your other table. Something like:

On Error GoTo err1
DoCmd.SetWarnings False
DoCmd.OpenQuery "NameOfYourQuery"

Exit1:
DoCmd.SetWarnings True
Exit Sub

err1:
MsgBox Err.Description
Resume Exit1

should do! Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top