Combo box filter on continuous form

G

Guest

Hello from Japan.

I'm working on an event for a combo box named [Combodate], I wanted
this combo box to filter a continuous form using a data field. I placed this
combo box on the Header and used a Getfocus and ApplyFilter macro where the
setting for the macro was:

Afterupdate, Get Focus : [Date]
Applyfilter, Where Condition: ([Date]=[ComboDate])

But this setting kept popping out an "Enter parameter value" box - which i
have to type in the date value even though I selected it from the combo
already.....it does work this way but it beats the purpose of the combo box
filter

So I tried this Event Procedure from another thread, that says I should put
this code afterupdate:
Me.Filter = "date = " & Me!combodate
Me.FilterOn = True

but now I get a" Runtime
Error 2448, ..you cant assign a value to this object" , and when I debug, I
get a higlighted
" Me.Filter = "Date = " & Me!Combodate

Sorry I had to repost here, as I cant get a response when i added this to an
existing post.
 
J

John Vinson

Hello from Japan.

Ohaio gozymas!
I'm working on an event for a combo box named [Combodate], I wanted
this combo box to filter a continuous form using a data field. I placed this
combo box on the Header and used a Getfocus and ApplyFilter macro where the
setting for the macro was:

Afterupdate, Get Focus : [Date]
Applyfilter, Where Condition: ([Date]=[ComboDate])

Try WhereCondition: ([Date] = [Forms]![yourformname]![combodate])
But this setting kept popping out an "Enter parameter value" box - which i
have to type in the date value even though I selected it from the combo
already.....it does work this way but it beats the purpose of the combo box
filter

So I tried this Event Procedure from another thread, that says I should put
this code afterupdate:
Me.Filter = "date = " & Me!combodate
Me.FilterOn = True

but now I get a" Runtime
Error 2448, ..you cant assign a value to this object" , and when I debug, I
get a higlighted
" Me.Filter = "Date = " & Me!Combodate

Date is a reserved word. What Access thinks you're trying to do here
is set the Date() function - that is, today's date - to the value of
the combo box. The Time Machine option isn't yet available in Access
so this won't work. <g>

Either use square brackets around Date, or - much better - rename the
field so it's not a reserved word.



John W. Vinson[MVP]
 

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