Combo box that display records on subform

  • Thread starter ghostman via AccessMonster.com
  • Start date
G

ghostman via AccessMonster.com

i have a subform that displays the trainig schedule for the current month
based on a query.

in my query, i sorted it by month using Month(Now()) and when i open the main
form, it display records on the current month which is great! ( i always want
to display the current month's training schedule)

but how about i want to display training schedule for next month or next or
next...etc...based on a selection?? like a combo box with list of month names
that the user can select...

i read and tried lots of tutorials here and i can't find it working...can
someone show how to do it?

- i already prepared a combo box with month names [cmbMonth] (i typed the
values i want on this combo box)
- and a subform that will display the records based on my query
[NTS_Schedule_subform]

please help...thanks!
 
P

Piet Linden

i have a subform that displays the trainig schedule for the current month
based on a query.

in my query, i sorted it by month using Month(Now()) and when i open the main
form, it display records on the current month which is great! ( i always want
to display the current month's training schedule)

but how about i want to display training schedule for next month or next or
next...etc...based on a selection?? like a combo box with list of month names
that the user can select...

i read and tried lots of tutorials here and i can't find it working...can
someone show how to do it?

- i already prepared a combo box with month names [cmbMonth] (i typed the
values i want on this combo box)
- and a subform that will display the records based on my query
[NTS_Schedule_subform]

please help...thanks!

The easiest way to filter the subform is to change the recordsource of
the subform on the fly in your code and then requery the subform. In
your case, you should have to just add code to requery the subform.

Me!Subform1.Form.Requery

should do it.
 
G

ghostman via AccessMonster.com

where should i put that code Me!Subform1.Form.Requery ??

also, my combo box already have lists of month (Jan - Dec) from my tblMonth
how can i make my combo box [cmbMonth] linked to my subform
[NTS_Schedule_subform]?

that when i select a month, it will display the training schedules for that
month???

i am new to access...i just started learning by reading tutorials here..


Piet said:
i have a subform that displays the trainig schedule for the current month
based on a query.
[quoted text clipped - 19 lines]
The easiest way to filter the subform is to change the recordsource of
the subform on the fly in your code and then requery the subform. In
your case, you should have to just add code to requery the subform.

Me!Subform1.Form.Requery

should do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top