How do I chain forms in Access? (pass values between them)

Posted by jeff porter on Stack Overflow See other posts from Stack Overflow or by jeff porter
Published on 2010-06-03T06:08:09Z Indexed on 2010/06/03 6:14 UTC
Read the original article Hit count: 288

Filed under:
|

Hello,

I'm using Access 2007 and have a data model like this...

Passenger - Bookings - Destinations

So 1 Passenger can have Many Bookings, each for 1 Destinations.

My problem...

I can create a form to allow the entry of Passenger details, but I then want to add a NEXT button to take me to a form to enter the details of the Booking (i.e. just a simple drop list of the Destinations). I've added the NEXT button and it has the events of

RunCommand SaveRecord
OpenForm   Destination_form

BUT, I cant work out how to pass accross to the new form the primary key of the passenger that was just entered (PassengerID).

I'd really like to have just one form, and that allow the entry of the Passenger details and the selection of a Destination, that then creates the entries in the 2 Tables (Passenger & Bookings), but I can't get that to work either.

Can anyone help me out please?

Thanks Jeff Porter

© Stack Overflow or respective owner

Related posts about ms-access

Related posts about ms-access-2007