shallnotbe
New Member
- Joined
- Oct 27, 2022
- Messages
- 7
- Office Version
- 365
- Platform
- Windows
Good afternoon, I have a userform that has some textboxes and command buttons. one of the text boxes is used to scan a bar code and log in in a field. When it is done i need it to clear and put the focus back on the box. I have accomplished this by doing this code at the end of the exit sub. The problem is, i cannot use the command buttons when this code is present. it won't give up focus of the textbox in order to click on the command button. What is a better way to do this? I hope I am clear.
If CCP_TextBox.Value = "" Then
CCP_TextBox.SetFocus
Cancel = True
End If
Thank you
If CCP_TextBox.Value = "" Then
CCP_TextBox.SetFocus
Cancel = True
End If
Thank you