Combobox not emptying when it should

LGRL20

New Member
Joined
Dec 28, 2015
Messages
9
Hi everyone,

Im working on a Userform that has 3 textboxes and a combobox, it will be used for a warehouse so the textboxes are as following:

textbox1=Part Number
textbox2=Qty
textbox3=Unit

the combobox1= batch, the combobox populates correctly dependingon the part number the user choses, ive installed coding in each textbox_change so that anytime you change any data from either textbox the combobox goes blank and the user must choose from the new list generated. I did this so that there wouldnt be a batch number associated to a part number it didnt correspond.

The code works fine when you change one or more number of the part number individually, however I have just noted that if I select the entire number of the partnumber and "PASTE" a number of a differente Part. The combobox never goes blank and it remains with a batch number that does not correspond. How can i Fix this? what kind of coding must I do.

Thanks a lot in advance for the help.

Greetings
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi. I'm not sure if I follow or not, but if you're only concerned about textbox1, and only if it already has a value in it, then you might could use the textbox_enter event to clear the value in the combobox.
Code:
Private Sub TextBox1_Enter()
If Me.TextBox1.Value <> "" Then UserForm1.ComboBox1.Value = ""
End Sub

Is that what you're looking to do?
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top