Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing a stored combobox choice from memory 1

Status
Not open for further replies.

McLiguori

Technical User
Mar 27, 2003
90
IT
I am using Access 2007. I have a table in which the various individuals are classified as to the 'group' to which they belong, e.g. AG = Action Group; BC = Best Chance, etc.

I am trying to use a combo box to allow the user to filter the records by the group {GR} they want to see. I created (using the wizard) a combo [Combo593] and set it to store the value for further use. The combobox draws its values from a table which lists the various groups.

In the after update property of the combobox I used the code builder and have:

Me.Filter = "GR = ???????"
Me.FilterOn = True

I have tried every thing I could think of in the place of the ?????? and nothing works. Can anyone help me with what I need to put there so that the form uses the value of the combo box to filter for the group [GR]?

Also, how can I clear the combobox's stored value, so I can make a second choice from the box and have it filter on that choice?

Thanks for any help you can give.

McLigs
 
How are ya McLiguori . . .

Try:
Code:
[blue]Me.Filter = "GR = '" & Me!Combo593 & "'"
Me.FilterOn = True[/blue]
To clear:
Code:
[blue]Me!Combo593 = Null[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Woops! [blush]

Should be:
Code:
[blue]Me.Filter = "GR = '" & Me!Combo593.Column(?) & "'"[/blue]
Note: column index starts at zero (0).

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top