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

Similar Threads

Help with Calendar OCX 3
VBA - Monthview working with textboxes 3
ActiveX Problem 2
OCX Question 4
Calendar Issue - Out of Memery 1
No object in control error 2683 2
Bookmark Listbox 4
monthview object or ?? 1

Top