Combo Box - Repeat Values

canjfn

Registered User.
Local time
Today, 22:29
Joined
Apr 24, 2001
Messages
28
I have a Drawing Register Table, the drawing can be entered many times but will have an increment in revision

eg.
A765345 Rev A
A765345 Rev B
A765345 Rev C
etc, etc

I am using a combo box on a form to print all records related to the drawing no and it works fine, when dropping down the combo box I get the drawing no listed as many time as its been entered into the table.

I would like it that the each drawing is only listed once, at present using my example above when I use the combo box my drawing A765345 gets listed 3 times.

I have used the search but cannot find anything on it

Thank you
 
Use a query with grouped records as your combobox rowsource. If the revision is in the same field as the drawing, use the left function in the query to peal off the drawing. If drawing numbers are of different length, use the instr function to find the blank and peal off the left portion.
 
Thanks for you anwser but as a novice, I do not understand

I have attached a picture of the form, you can see in the drop down combo box the 1 st drawing is listed 2 times (because it has 2 entries in a table), it could well be that over time it could be entered into the table say 10 times but with a different revision (note revision is in its own field), what I am looking to do is when the combo box is dropped down the drawing number is only listed once.

When the report is printed then it will give details of all revisions of the drawing my report works fine, its just the multiple entries of the drawing in the combo box I wish to stop.

Thanks
 

Attachments

  • combo.jpg
    combo.jpg
    39.9 KB · Views: 181
It appears that the rowsource of your combobox needs modification. You're probably using a table for that purpose.

Use a query of that table for the combobox rowsource. Note that the query should be grouped, i.e. click the sigma symbol in the Query toolbar. Run the query and you'll see the correct rows displayed.
 
change your row source code

in your combo box, goto the row source, and where it says
SELECT blablabla, just do SELECT DISTINCT
 
Thanks for the Help guys.

AnthonyX, that does what I require :)
 
SELECT DISTINCT FieldName FROM YourTable.

by use of DISTINCT keyword, it can get rid of duplicated records.

Set them in the rowsource of your form control.
 

Users who are viewing this thread

Back
Top Bottom