List box display

cstanley

Registered User.
Local time
Today, 17:09
Joined
May 20, 2002
Messages
86
Hello all,

I would like to control the output of a list box display. I would like to have a single list box that displays values from different queries, based on a button, i.e., if a button was pressed, the list box would display the values from the query that was run by the button... any idea how to code this?

Chris
 
On click of each button:
Me.YourListBoxName.ControlSource = "YourqryNameHere"
 
It keeps giving me an error message that the method or data member is not found :(. Can you help?
 
Is spelling correct?
try:
Me.[YourListBoxName].ControlSource = "YourqryNameHere"
 
OK - the bracketing works. But it won't update the list box display.
 
Just a guess:

Me.[YourListBoxName].ControlSource = "YourqryNameHere"
Me.[YourListBoxName].Requery
 
Click your button then go into design view and check the control source for your list box. Did it change to the query specified ?
 
It did indeed. I tried changing the RowSource rather than the ControlSource for the list box, which worked nicely, but now, when I try to select a value, it says that my list box is bound and I can't edit the control.

*sigh*
 
My Apologies

Me.[YourListBoxName].ControlSource = "YourqryNameHere

Should be:
Me.[YourListBoxName].RowSource = "YourqryNameHere

And the requery is not needed.

Sorry about that.
 
Thanks!!! It works!!!!

Now the real kicker... I would like to have the query that I used take the value that it will filter by from a combo box on the form, thus using a combo box instead of a button (or a series of buttons, as I originally imagined) to dictate the display in the list box.

How about them apples?

Chris
 
ok one query filtered by the value in a combo?

In the criteria for the query
[Forms]![YourFormName]![YourcboName]
 

Users who are viewing this thread

Back
Top Bottom