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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display listbox contents based on selection in another list box 1

Status
Not open for further replies.

StayAtHomeMom

Technical User
Sep 6, 2003
41
0
0
US
Hello all,

I have a form in my DB with several list boxes (where the sources are each simple Select queries from a table). The user clicks on selections within each list box, then clicks a command button that runs VB code to create a report based on their selections.

I want to add a new list box, whose displayed contents will be dependent on the selection in the list box immediately to the left of the new box. When the form first opens, that new list box would be blank, and I'm guessing what will spur the display action will be the On_Exit event from the list box to the left, when the user makes a selection.

I'm confused what the syntax would be for the source of the new list box. It will be a query of a table, with the "where" clause will be what was selected by the user.

I guessed at something like this for the row source:

SELECT BranchID.Br_Name
FROM BranchID where BranchID.DistName=Me!Distributor.Column(0,1)

Of course it didn't work, but am I close? THANKS!
 
faq702-4289 same for listbox

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
THANK YOU ZmrAbdulla! I had tried searching for clues before I wrote my question, but I was using "list box" instead of "combo box". Thanks for the tip.

After many dumb syntax errors on my part, I got my form/code to work correctly. Thank you again!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top