output filter string to text box on form

  • Thread starter Thread starter daren
  • Start date Start date
D

daren

I'm trying to output the value of a form's current filter in a text
box on the form. My text box's control source has this expression:

=IIf([Form].[FilterOn],[Form].[Filter],Null)

Unfortunately, the text box displays "#Name?" So I believe there is a
reference error. I followed instructions from another posting on this
group to uncheck and recheck the references in the VBA window. This
didn't help. The references I have checked are:

Visual Basic for Applications
Microsoft Access 11.0 Object Library
Microsoft DAO 3.6 Library
Microsoft ActiveX Data Objects 2.1 Library
OLE Automation

Am I missing some vital reference? Or does anyone have any other
thoughts?

PS: I thought that I had sent this message yesterday, but I couldn't
find it posted, so I'm sending it again. Forgive me if it's a
duplicate.
 
Hi Daren

That should work perfectly.

I suspect that you have named your textbox "Filter", so your expression has
a circular reference.

Try renaming it to "txtCurrentFilter" of some such.
 
Hi Daren

That should work perfectly.

I suspect that you have named your textbox "Filter", so your expression has
a circular reference.

Try renaming it to "txtCurrentFilter" of some such.

--
Good Luck  :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand


I'm trying to output the value of a form's current filter in a text
box on the form. My text box's control source has this expression:
=IIf([Form].[FilterOn],[Form].[Filter],Null)

Unfortunately, the text box displays "#Name?" So I believe there is a
reference error. I followed instructions from another posting on this
group to uncheck and recheck the references in the VBA window. This
didn't help. The references I have checked are:
Visual Basic for Applications
Microsoft Access 11.0 Object Library
Microsoft DAO 3.6 Library
Microsoft ActiveX Data Objects 2.1 Library
OLE Automation
Am I missing some vital reference? Or does anyone have any other
thoughts?
PS: I thought that I had sent this message yesterday, but I couldn't
find it posted, so I'm sending it again. Forgive me if it's a
duplicate.

Thanks for the suggestion, Graham. The textbox name was not Filter (it
is txtFormFilter). I guess my expression is correct but there is
something else tripping things up. Weird.
 
Hi Daren

Do you have anything else on the form which is named either Filter or
FilterOn?

--
Graham Mandeno [Access MVP]
Auckland, New Zealand

Hi Daren

That should work perfectly.

I suspect that you have named your textbox "Filter", so your expression
has
a circular reference.

Try renaming it to "txtCurrentFilter" of some such.

--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand


I'm trying to output the value of a form's current filter in a text
box on the form. My text box's control source has this expression:
=IIf([Form].[FilterOn],[Form].[Filter],Null)

Unfortunately, the text box displays "#Name?" So I believe there is a
reference error. I followed instructions from another posting on this
group to uncheck and recheck the references in the VBA window. This
didn't help. The references I have checked are:
Visual Basic for Applications
Microsoft Access 11.0 Object Library
Microsoft DAO 3.6 Library
Microsoft ActiveX Data Objects 2.1 Library
OLE Automation
Am I missing some vital reference? Or does anyone have any other
thoughts?
PS: I thought that I had sent this message yesterday, but I couldn't
find it posted, so I'm sending it again. Forgive me if it's a
duplicate.

Thanks for the suggestion, Graham. The textbox name was not Filter (it
is txtFormFilter). I guess my expression is correct but there is
something else tripping things up. Weird.
 
Back
Top