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

Filter records in a ComboBox.

Status
Not open for further replies.

3535

Programmer
Dec 19, 1999
18
US
In the properties section for my ComboBox the RowSourse code looks like the following.<br>
<br>
SELECT[Table1].[CompanyID],[Table1].[Name]<br>
FROM Table1 ORDER BY [Table1].[Name];<br>
<br>
Would like some help on adding a WHERE [Table1].[Terr] = Text59, but I cannot get code right. <br>
<br>
What I am trying to do is filter the ComboBox to only names that are in Territory # 9 or whatever number is in Text59 (Text59 is an Unbound text box) Any help appreciated. Ray<br>
<br>
<br>
<br>

 
Have you remembered to refresh the Combo Box? Press F9 or place code in AfterUpdate event of Text59: YourComboBoxName.Requery <br>
<br>
Al
 
I always build my SQL stmt by clicking on the (...) Build button and modifying the query in design mode. I find this much faster for trouble shooting, for instance to find if I need to enclose my value in quotes, make a reference to a specific form (Forms! frmOneOfTwo!cboText59), etc.
 
Thank you Lehtoant and Elizabeth. The build button helped me get my code stright and I put in Combo39.requery. I think it may just work. thanks again Ray <br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top