Question : Duplicate entries in Combo box

Attached are some details but the general question is: I have the possibility of duplicate entries appearing in the combo box..e,g,, job numbers 0035 and 0035. Actually they are not the same since they have different years. The real job extended is 2000035 and 2010035. Originally the job numbers were setup to be 4 digits with the first digit designating the year. Ah, but now they have jobs where the first digit is the same since 2000 and 2010 both end in 0. I created the new extended job number to fix the problem but in the combo box when I type in, scroll down to, or go to next record, I can't get to the 2nd 0035 (I know the FindFirst is part of my problem). How do I move correctly to the 2nd 0035?

Answer : Duplicate entries in Combo box

Have you tried using the JobNumberExt field in the FindFirst code?

    rs.findfirst "[JobNumberExt] = '" & me.cbo_JobNumber.column(2) & "'"

Another way to handle this would be to display the unique job number in the combo box.  Then, in the combo boxes after update event, check to see whether there is more than one [JobNumber] with that value.  If not, then use the FindFirst based on the JobNumber.  If so, popup another form that displays the JobNumberExt to allow the user to select the correct one, then use that field in the find first.

Another method would be to add a FindNext button, and use the FindNext method.


Random Solutions  
 
programming4us programming4us