I have a dropdown combo box on my form and I'm trying to prevent the user from entering a leading <space> into it. This is the code I'm using, but there seems to be something wrong with my logic:
If (cboStockName.Text) Like "" Then
If Asc(e.KeyChar) = 32 Then
e.Handled = True
End If
End If
I've tried debugging it and it never makes it into the first if statement when I enter a leading <spacebar> into the combobox.
If (cboStockName.Text) Like "" Then
If Asc(e.KeyChar) = 32 Then
e.Handled = True
End If
End If
I've tried debugging it and it never makes it into the first if statement when I enter a leading <spacebar> into the combobox.