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!

Combo box query

Status
Not open for further replies.

cmichaud

Technical User
Jul 17, 2006
2
0
0
US
i am having problems populating the row source of a combobox on my form. first combobox i pick users name. second combo box lists the item #'s that person has. this works fine. i select the item number and make a record. if i go and pick the same user again...i dont want the item number i just selected to be in the list.
itemID is coming from tblItem. but i am storing these additional records in tblcheckdeliver under field itemid. so i somehow need to write a criteria, that takes all the possible itemids from tbl item, then looks in tblcheckdelivery.itemid and if an item id is present there doesnt list it. any ideas how?
 
What is the actual SQL code of your second combo box's RowSource ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
To avoid the last item number selected, after the item# is selected from your combo box set a public variable (set up in a module) to the value of the selected item number.

Your query should include the criteria where ItemNbr <> ValuePubItemNbr, assuming PubItemNbr is the public variable and ValuePubItemNbr is a function also in the same module to return the value of the public variable:

Function ValuePubItemNbr() as Integer
ValuePubItemNbr = PubItemNbr
end Function

Don't forget to requery the combo box source before the next selection takes place.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top