Using Multiple parameters from dropdown for Query inside a form (1 Viewer)

HisDudeness

New member
Local time
Today, 02:09
Joined
Mar 25, 2022
Messages
2
Hello, im pretty new to access and im trying to make a Form that has two dropdowns. One specifies the hotel the client wants to look at, and the other specifies which week he wants to look at.

I got the form and Query working with a dropdown to select a hotel. but i cant find a way to add a second combobox which has a defaultvalue (you only need to specify the hotel) for which week you want to see the query results.

SELECT TOP 4 *
FROM tbl_dailyStatistic
WHERE (((tbl_dailyStatistic.HotelSelected)=[Formulare]![SelectDailyHotel]![HotelSelected]))
ORDER BY tbl_dailyStatistic.Date_today DESC , tbl_dailyStatistic.Morning DESC , tbl_dailyStatistic.Catégorie;

Thats the query im using right now, id like have another WHERE condition which takes its value from another combobox which has a default value.
Can someone give me a hint how i can achieve that?

Btw great forum, already helped me a lot so far!
 

Ranman256

Well-known member
Local time
Yesterday, 21:09
Joined
Apr 9, 2015
Messages
4,339
Point to the combo on the form,
where [field] = forms!fMyForm!cboHotel

use the BUILDER to get it right.
 

HisDudeness

New member
Local time
Today, 02:09
Joined
Mar 25, 2022
Messages
2
Point to the combo on the form,
where [field] = forms!fMyForm!cboHotel

use the BUILDER to get it right.
currently not at home to try out. thanks for the quick answer though!
can i somehow give a default value with it? client only rarely needs a specific value and mostly default would be enough. maybe with the cbo itself? :)
 

Users who are viewing this thread

Top Bottom