Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
Our Company has Production Lines A, B, and C. On my userform I have two comboboxes. First Combobox is called cmbSDPFLine and the secondCombobox is called cmbPrdCde. If the user selects "A-Line" under the SDPFLine combobox, PrdCde combobox will only display the products run on that line, and so on for the other two lines. The problem that occurs is if the user selects the wrong product or the wrong production line accidentally and clicks on the dropdown menu for either combobox, that combobox will double the selection. For example, if the combobox containing the list of production lines is selected the first time, it displays A-Line, B-Line, C-Line as it is supposed to. But when the user exits that combobox and enters another textbox and returns back to the combobox, the combobox now displays A-Line, B-Line, C-Line, A-Line, B-Line, C-Line. This occurs in both comboboxes and each time I return to a combobox it adds another duplication. How can I fix this issue? I really hope this makes sense. Thank you for your help in advance.
Code:
Private Sub cmbPrdCde_Enter() If cmbSDPFLine.Value = "A-Line" Then
With Me.cmbPrdCde
.AddItem "0095-0-45 (Gelcap Club Pack Rework)"
.AddItem "0096-1-93 (180MG 45CT LBL B)"
.AddItem "0096-1-94 (5MG 55CT LBL BTL)"
.AddItem "0096-1-98 (180MG 45CT LBL B)"
.AddItem "0096-2-05 (5 MG 55 CT B UNLABELED)"
.AddItem "0096-2-07 (5MG 55CT LBL BTL LABELED BOTTLE)"
.AddItem "3510-2-01 (5MG 55CT)"
.AddItem "3510-2-02 (5MG 55CT FROM BRITE STOCK)"
.AddItem "3510-3-01 (5MG 80CT)"
.AddItem "3510-1-01 (5mg 35ct)"
.AddItem "0314-3-10 (150mg 90ct)"
.AddItem "0013-3-40 (Sleep Gel 32ct)"
End With
ElseIf cmbSDPFLine.Value = "B-Line" Then
With Me.cmbPrdCde
.AddItem "4233-3-10 (CHILDRENS ODT 12 CT LAM GRAPHICS)"
.AddItem "4232-6-02 (CHILDRENS ODT 24CT LAM GRAPHICS)"
.AddItem "4233-3-15 (ODT 12ct)"
.AddItem "4131-4-15 (60mg 24ct)"
.AddItem "4131-2-15 (60mg 12ct)"
End With
Else
With Me.cmbPrdCde
.AddItem "4122-0-04 (24 HR GELCAPS)"
.AddItem "4122-7-01 (24 HR GELCAP 8CT)"
.AddItem "4123-5-01 (180MG 15CT - )"
End With
End If
End Sub