03856me
Active Member
- Joined
- Apr 4, 2008
- Messages
- 297
I am running a BeforeUpdate event which validates the entry then if the value is an error it clear the textbox and sets the focus back to the textbox. So far so good - the textbox is the focus but the cursor has disappeared which forces the user to use their mouse to select the textbox for entry. This is not a new problem, there are many posts out there but I have not had any luck finding a solution.
Here's the curious part - it works perfectly when I run it from the Visual Basic editor while in the UserForm code. BUT when I run it from my launch macro the cursor disappears when the SetFocus line is launched.
This is my Launch Macro that is assigned to the button on a menu and resides in a Module:
This is my user form macro:
Your help, as usual, is GREATLY appreciated!
Here's the curious part - it works perfectly when I run it from the Visual Basic editor while in the UserForm code. BUT when I run it from my launch macro the cursor disappears when the SetFocus line is launched.
This is my Launch Macro that is assigned to the button on a menu and resides in a Module:
Code:
Sub EnterEdit()
Frm_Input.Show False
End Sub
This is my user form macro:
Code:
Private Sub txt_specie_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If txt_specie.Value > 15 And txt_specie.Value < 99 Then
MsgBox "Invalid Specie"
txt_specie.Value = ""
Me.txt_specie.SetFocus
With txt_plot
.SelStart = 1
.SelLength = Len(.Text)
End With
Cancel = True
End If
End Sub
Your help, as usual, is GREATLY appreciated!