Trying to filter a form by VBA

J

JohnC

I am trying to filter a form from an unbound combo box on that form

Combo68 is the combo box having a drop down of months ie Jan, Feb,
Mar....
frm COMPLAINTS is the name of form
month is a field having values Jan, Feb, Mar....


..............................................................
Private Sub Combo68_AfterUpdate()
Dim xXy As string

xXy = [Combo68].Value


DoCmd.OpenForm "frm COMPLAINTS", , , Month = xXy
End Sub


I know I can do the same thing many other ways but would like to know
what is wrong with this

John C
 
B

Bob Darlington

John,
In addition to Peter's comment, I'd avoid using the word 'Month' as a field
name as it is also the name of an Access function.
 

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