OnClick event (?) - adds a specific field value from the form to another table

  • Thread starter Melanie S. via AccessMonster.com
  • Start date
M

Melanie S. via AccessMonster.com

I have created a form (based on a query) for adding new records.
On the form there are these fields:

GuestID (Autonumber)
RoomID
Name
Address
DateIn
DateOut
etc...

I have two other tables which both contain field GuestID.
I want to make it such a way that when I click on the 'Add Record' button,
the value of GuestID is added in the other two tables as well.. plz have any
suggestions?
 
W

Wayne Morgan

In the relationships window, right click the link between the tables and
choose Edit Relationship. In the resulting dialog check Enforce Referential
Integrity then also check Cascade Update Related Fields.

This should only be needed if the tables have a one-to-one relationship to
this table. If it is a one-to-many (this table on the One side) then this
shouldn't be needed and may not do what you are intending. If you have set
up a one-to-one relationship, why? There are good reasons to do so, but it's
usually not needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top