Help with forms

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.
 
P

Pavel Romashkin

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
 

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