Hi all,
Using 1 combobox as an example (there are multiple copies of it).
So I have cmbProd1 and txtQty1.
Once a user selects an item in the combobox list the focus moves to the quantity textbox and the quantity textbox checks for any value that is NOT numeric in the BeforeUpdate sub - this works fine.
What I'm trying to sort now is the Exit sub to check if the combobox has an item from the list selected then the quantity box can not have a number lower than 1.
I'm ok on sorting the number check but what I can't workout is how do I check the combobox has a value to be able to check if a number in the quantity box is required?
I've tried various methods to check the combobox ...listcount, value, >"", ect ect bout nothing seems to work - the code below is a rough test
Thanks for any help offered. Paul
Using 1 combobox as an example (there are multiple copies of it).
So I have cmbProd1 and txtQty1.
Once a user selects an item in the combobox list the focus moves to the quantity textbox and the quantity textbox checks for any value that is NOT numeric in the BeforeUpdate sub - this works fine.
What I'm trying to sort now is the Exit sub to check if the combobox has an item from the list selected then the quantity box can not have a number lower than 1.
I'm ok on sorting the number check but what I can't workout is how do I check the combobox has a value to be able to check if a number in the quantity box is required?
I've tried various methods to check the combobox ...listcount, value, >"", ect ect bout nothing seems to work - the code below is a rough test
Thanks for any help offered. Paul
VBA Code:
Private Sub txtQty1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsNull(ComboProd1) And Not IsNumeric(txtQty1.Value) Or txtQty1.Value = "" Then
MsgBox "nothing"
Else
MsgBox "something"