Problem with Filter

RonnieODIN

Registered User.
Local time
Today, 14:18
Joined
Jun 15, 2012
Messages
46
Hi all,

I am having troubles getting a filter working.

I have previously had succes setting a filter on a subform from a mainform using the following code:

Code:
Me!subMaskiner.Form.Filter = "[Kundenavn] = [Forms]![frmListeMaskiner]![cboCurrentCostumer]"

Now I have to filter a mainform but I can't make it work.

I am trying the following code:

Code:
Me!Filter = "[Kunde] = Me.[cboKunde]"

Anyone having an idea of what's wrong? :banghead:

-Ronnie
 
Are you filtering the main form from the subform? Where are you filtering it from?

Oh by the way, Me.cboKunde needs to be outside the quotes. It should be concatenated.
 
I am filtering the mainform from the mainform.

I cannot set Me.cboKunde outside quotes.
 
I cannot set Me.cboKunde outside quotes.
Or you mean you don't know how to?

Is Me.cboKunde bound or unbound?

If Kunde is a numeric field, use the first code otherwise use the second:
Code:
Me.Filter = "[Kunde] = " & Me.[cboKunde]
Me.Filter = "[Kunde] = " Chr(34) & Me.[cboKunde] & Chr(34)
And when you apply a filter, remember to turn it on, i.e. Me.FilterOn = True
 

Users who are viewing this thread

Back
Top Bottom