Select value in control

J

John Barnes

I have a message box which displays a warning for user to
verify date that appears to be incorrect. I used
Me.ControlName.SetFocus in AfterUpdate code. This takes
the user back to the control.

My question is, how do I automatically highlight the
entire value for easy editing. I want the control to be
highlighted as if the user had tabbed into it.

Thanks.
 
D

Dirk Goldgar

John Barnes said:
I have a message box which displays a warning for user to
verify date that appears to be incorrect. I used
Me.ControlName.SetFocus in AfterUpdate code. This takes
the user back to the control.

My question is, how do I automatically highlight the
entire value for easy editing. I want the control to be
highlighted as if the user had tabbed into it.

It doesn't do it automatically? Try this to move the focus to the
control and select the text:

With Me.ControlName
.SetFocus
.SelStart = 0
.SelLength = Len(.Text)
End With
 
Top