cascades and datasheets, oh joy!!!

Crispie38

Registered User.
Local time
Today, 21:31
Joined
Jun 26, 2006
Messages
15
Hey ho

I have a table full of dates and each date has multiple time slots, and each time slot has multiple data values.

What I would like to do is have 2 cascading combo boxes (for date and time), so when you click the date it returns only the information for that date in the datasheet, and then click on the time combo box (which displays only time slots for that date) and returns the specific time slots for that date.

Any help with this would be most grateful!!
 
For the sake of argument, let's call them Combo_date and Combo_time.

If no values are picked from either, the row sources could be, respectively,

Select dateinfo from dateandtimetable;
and
Select timeinfo from dateandtimetable;

When you pick a value from Combo_date you reset the row source in Combo_time as follows, then tell it to refresh:

Select timeinfo from dateandtimetable where dateinfo = {whatever the value is in Combo_date}

You also set the source for the datasheet to just show the values relating to whatever the source in the Combo_date box is.

When you then pick a value from the Combo_time box, you will just reset the datasheet source accordingly.

Personally, I like to add a button called 'Reset' to set both combo boxes back to their original values, in case the user changes his/her mind.

Hope it helps.
 
thanks

We have managed to get it so that the cascading combo boxes work, the first one will jump to the specific date (using VBA: findfirst) and then the 2nd will jump to the specific time slot (VBA: FindNext).

How do we set the data source to just show the records that it is want??.

P.S. Good call on the reset button ;)
 

Users who are viewing this thread

Back
Top Bottom