No Repeat Value In Combo Box

mithani

Registered User.
Local time
Tomorrow, 08:56
Joined
May 11, 2007
Messages
291
Dear All

I have one combo box based on project number from Child Table. So each project number can be repeated number of times. So what I want that when I click combo box, should not repeat same project number(although table container same number hundred times). mean one project should show only one time. Any Help?

Thanks

Mithani
 
Either SELECT DISTINCT or a GROUP BY query.
 
thank pbaldy,

I have tried this code:

SELECT DISTINCT ProjectBudgetChild.project_code FROM ProjectBudgetChild;

Not showing any record.

Any idea?

mithani
 
Are you saying the same query without DISTINCT returns the repeating records?
 
yes the same query without DISTINCT or GROUP BY returns repeating project code. When I put distinct or group by, then no record returns

MY ACTUAL DATA
PROJECT CODE & INVOICE NO
1095 - 139
1095 - 140
1095 - 141
1095 - 142
1096 - 143
1096 - 144
1097 - 145
1098 - 150
1098 - 151

I want my combo box should show only

PROJECT CODE
1095
1096
1097
1098

Thanks
mithani
 
Can you post a sample db? I can't think of why that doesn't work.
 
Repeat Value in Combo Box

pbaldy

My actual db is very big so I have made the example one. when you open the form, just click my combo and you will see project 1095 showing 4 times, 1096 2 times and so on. I want to show each project code only one time. any help?

ameer
 

Attachments

Your existing SQL also pulls an ID field, and your combo has 2 columns, the first hidden. When you switch to the SQL you posted, the single remaining column is now hidden. Fix the column count and widths properties and you're good to go.
 

Users who are viewing this thread

Back
Top Bottom