Skip to content

Hide Focus

Add this to the form code, choose the appropriate control for setting the focus. It must be a control that can recieve focus (not a label) but a text control will work, hence txHideFocus can be added.

Private Sub HideFocus()
On Error GoTo Error_Handler
Me.parent.txtHideFocus.SetFocus
Cleanup:
Exit Sub
Error_Handler:
GeneralErrorHandler err, MODULE_NAME, "HideFocus"
Resume Cleanup
End Sub

Doesn’t work on continous forms

Me.ActiveControl.SelLength = 0

is the best option