this does not make much sense:

Originally Posted by
doquan0
this price must be dependent on TourCode and NumberofCustomer which are in table tbl_TourCode
you can look up the price with dlookup, like what I've shown here, but as far as dependencies are concerned, you need to expand a little bit on what exactly the need is.
As far as your query is concerned, this might be what you want:
Code:
SELECT tbl_Booking.BookingID,
tbl_Booking.BookingDate,
tbl_Booking.DepartureDate,
tbl_Booking.TourCode,
tbl_Booking.CustomerID,
tbl_Booking.Numberofcustomer,
DLOOKUP(IIF([Numberofcustomer] = 1, "[1customer]",
IIF([Numberofcustomer] BETWEEN 2 AND 3, "[2to3customer]",
IIF([Numberofcustomer] BETWEEN 4 AND 6, "[4to6customer]",
IIF([Numberofcustomer] BETWEEN 7 AND 10, "[7to10pcustomer]", NULL)))) ,
"tbl_TourCode", "[TourCode] = '" & [TourCode] & "'")
FROM tbl_Booking;
Also, there are numerous problems with your data:
*No of Customers is the currency data type.
*7 to 10 customers field is named 7to10pcustomer. TYPO.
*The data is not normalized.
Try some research on Access. Maybe naming conventions. It will help a lot!