I’m setting up a (firebird embedded) database for a tourist operator. The forms have sub forms. A booking (dsBooking) is linked to one or more accommodations (dsAccommodation), in a specific order (dsBookAcco). While tourists go from one hotel to the next on foot, without their luggage, that has to be transported from one hotel to the next (dsLuggage). The ‘from’ and ‘to’ fields are to be selected via a (sql) list box with the selected accommodations for that booking. All subforms are linked (via master/slave fields) by the bookingID.
Unfortunately the list box displays all the existent combinations of booking_ID’s and accommodations, not just the hotels of the applicable booking.
(For building purposes I used this concatenation now) Whether I use this SQL code
SELECT DISTINCT "Book_ID" || ' ' || "nr" || ' ' || "Acco_ID", "nr"
FROM "BookingAcco"
ORDER BY "Book_ID" ASC
or this one
SELECT DISTINCT "B"."ID" || ' ' || "BA"."nr" || ' ' || "BA"."Acco_ID", "BA"."nr"
FROM "Booking" "B", "BookingAcco" "BA"
WHERE "B"."ID" = "BA"."Book_ID"
ORDER BY "BA"."Book_ID" ASC
Looks like it should have a simple solution, but I can’t find it …
Any help appreciated,
Thanks in advance
Challenge.odb (13.1 KB)