Filter Listbox From MonthView

  • Thread starter Thread starter Rick Stambach
  • Start date Start date
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
 
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
 
Back
Top