Filter Listbox From MonthView

R

Rick Stambach

I have a form with a listbox and a monthview and I'm trying to filter the
listbox by clicking on the date in the monthview control. New at access and
don't know where to start. I do know some vba and I have access 2000. I'm
looking for some sample code to get me started.
Thanks RS
 
S

storrboy

I've not actually used the MonthView, but there is likely a Click or
AfterUpdate event. It may not be listed in the property sheet, but if
you open the code window for the form, you should be able to choose it
from the dropdowns at the top of the screen.

Easiest thing to do is to change the Rowsource of the listbox. Apply a
new sql statement to it in the Click event of the MonthView.
Example....

Dim sqlStr As String
sqlStr = "SELECT ..... FROM .... WHERE (fld = #" & Me!MonthViewName &
"#);"
Me!ListBoxName.Rowsource = sqlStr
Me!ListBoxName.Requery
 

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