Help with forms

  • Thread starter Thread starter C Tate
  • Start date Start date
C

C Tate

I have created a small reservations database. The main booking form has been
created from a query based on several tables (eg, customer, booking,
excursion, passengers).

I now want to create another form (probably based on another query -
bookings and payments) for payments. I want to put a command button on the
main booking form linking to this form.

My problem is this. When I open the new payment form from the booking form,
how can I ensure that I am at the same bookingID? In other words, I want to
ensure that the payment I am entering is for the relevant booking!

I can't see an obvious way to do this. I did try but when I open my payment
form I think I am taken to the first bookingID.

Hope this all makes sense. Thanks in advance.
 
You could either make the Payment form a subform and link child and
parent fields, and your Payments form would become a part of the main
form. If you'd rather have it separate from the main form, you could
write a little bit of VBA code for that. I would choose the latter.
Again, you have options. You could pass the bookingID as OpenArg to the
form being launched or, alternatively, you could put something like this
in the Current event of the Payments form (this is what I'd do):

IF Me.NewRecord THEN Me!bookingID = Forms!MainBookingForm!bookingID

This will allow you to enter more than one payment record on the Payment
form for the same ID on the Bookings form.

Pavel
 
Back
Top