H
h2fcell
Hello,
I have a form, frmRates with a list box and two subforms, subRatesA and
subRatesB. The first subform, subRatesA has a default view property of
“Continuous Formsâ€. It gets its data using a query Record Source that
filters based on the list box pick.
SELECT tblAcct5_HotelRatesLookUp.hotel_id,
tblAcct5_HotelRatesLookUp.rate_code, tblAcct5_HotelRatesLookUp.hotel_status,
tblAcct5_HotelRatesLookUp.include_exclude_flag,
tblAcct5_HotelRatesLookUp.FromDate, tblAcct5_HotelRatesLookUp.ToDate,
tblAcct5_HotelRatesLookUp.Rate, tblAcct5_HotelRatesLookUp.country,
tblAcct5_HotelRatesLookUp.city, tblAcct5_HotelRatesLookUp.hotel_name,
tblAcct5_HotelRatesLookUp.supplier_id, tblAcct5_HotelRatesLookUp.description
FROM tblAcct5_HotelRatesLookUp
WHERE
((tblAcct5_HotelRatesLookUp.rate_code)=[Forms]![frmRates]![lboRoomTypes])
ORDER BY tblAcct5_HotelRatesLookUp.FromDate;
I’d like to have the second form, subRatesB populate base on three fields
[FromDate], [ToDate] and [hotel_name] of the selected record in subRatesA.
The first thing I need to know is what event should I use to requery
subRatesB every time the user selects a different record in subRatesA. The
second thing I need to know is how to reference the three fields from the
record selected in subRatesA in the query for subRatesB.
I tried the below but get a prompt for
[Forms]![frmRates]![Form]![subRoomRates]![hotel_name] when frmRates first
opens.
SELECT tblAcct5_SupplierID.s_contract_id, tblAcct5_SupplierID.product_set,
tblAcct5_SupplierID.s_product_desc, tblAcct5_SupplierID.hotel_id,
tblAcct5_SupplierID.hotel_name, tblAcct5_SupplierID.FromDate,
tblAcct5_SupplierID.ToDate
FROM tblAcct5_SupplierID
WHERE
(((tblAcct5_SupplierID.hotel_name)=[Forms]![frmRates]![Form]![subRoomRates]![hotel_name])
AND
((tblAcct5_SupplierID.FromDate)=[Forms]![frmRates]![Form]![subRoomRates]![FromDate])
AND
((tblAcct5_SupplierID.ToDate)=[Forms]![frmRates]![Form]![subRoomRates]![ToDate]));
Thanks in advance for your help.
I have a form, frmRates with a list box and two subforms, subRatesA and
subRatesB. The first subform, subRatesA has a default view property of
“Continuous Formsâ€. It gets its data using a query Record Source that
filters based on the list box pick.
SELECT tblAcct5_HotelRatesLookUp.hotel_id,
tblAcct5_HotelRatesLookUp.rate_code, tblAcct5_HotelRatesLookUp.hotel_status,
tblAcct5_HotelRatesLookUp.include_exclude_flag,
tblAcct5_HotelRatesLookUp.FromDate, tblAcct5_HotelRatesLookUp.ToDate,
tblAcct5_HotelRatesLookUp.Rate, tblAcct5_HotelRatesLookUp.country,
tblAcct5_HotelRatesLookUp.city, tblAcct5_HotelRatesLookUp.hotel_name,
tblAcct5_HotelRatesLookUp.supplier_id, tblAcct5_HotelRatesLookUp.description
FROM tblAcct5_HotelRatesLookUp
WHERE
((tblAcct5_HotelRatesLookUp.rate_code)=[Forms]![frmRates]![lboRoomTypes])
ORDER BY tblAcct5_HotelRatesLookUp.FromDate;
I’d like to have the second form, subRatesB populate base on three fields
[FromDate], [ToDate] and [hotel_name] of the selected record in subRatesA.
The first thing I need to know is what event should I use to requery
subRatesB every time the user selects a different record in subRatesA. The
second thing I need to know is how to reference the three fields from the
record selected in subRatesA in the query for subRatesB.
I tried the below but get a prompt for
[Forms]![frmRates]![Form]![subRoomRates]![hotel_name] when frmRates first
opens.
SELECT tblAcct5_SupplierID.s_contract_id, tblAcct5_SupplierID.product_set,
tblAcct5_SupplierID.s_product_desc, tblAcct5_SupplierID.hotel_id,
tblAcct5_SupplierID.hotel_name, tblAcct5_SupplierID.FromDate,
tblAcct5_SupplierID.ToDate
FROM tblAcct5_SupplierID
WHERE
(((tblAcct5_SupplierID.hotel_name)=[Forms]![frmRates]![Form]![subRoomRates]![hotel_name])
AND
((tblAcct5_SupplierID.FromDate)=[Forms]![frmRates]![Form]![subRoomRates]![FromDate])
AND
((tblAcct5_SupplierID.ToDate)=[Forms]![frmRates]![Form]![subRoomRates]![ToDate]));
Thanks in advance for your help.