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

Using a combobox to filter between entries? 1

Status
Not open for further replies.

fiel

Programmer
Jun 3, 2007
96
US
I have single table that will hold the following information for ProgrammingCodes: author, version, description, hyper-link to file. I have a combo box for each one set so I can filter through each entry based on any one category. The only thing is I linked my combo boxes to my only table where my data is stored. As a result, when I search based on say authors for example, the same name will appear multiple times for each record I have based on a particular author; this occurs for all other categories as well. Is there so that the combo box will not show the same category mulitple times (example: so that that an author's name only appears once)?
 
I needed to do a GROUP BY Function
Do you use any aggregate function ?
 
Aggregate functions: Sum, Count, Avg, Min, Max, ...
 
Nope, I put the GROUP BY statement in my data properties for my combo box. Everything is working as I need it, but when I delete or add new information, it won't immediately show up in the combo box (unless I reopen the form in some cases). Is there any way to keep the combo boxes always updating to avoid this?
 
Nope
So, you don't need a GROUP BY clause but simply the DISTINCT predicate.

keep the combo boxes always updating
You may try this in the Current event procedure of the form:
Me![name of combo].RowSource = Me![name of combo].RowSource

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
When I tried out that code in the Form's Current event Procedure, it worked at some times but all the time. Would there be a problem in this if my combo boxes were in a main form and the data displayed and entered were shown below in a subform?
 
So, in the Current event procedure of the subform:
Forms![name of mainform]![name of combo].RowSource = Forms![name of mainform]![name of combo].RowSource

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top