Use an Easier Autohighlight Method

Use an Easier Autohighlight Method

Most of us have a routine we call to autohighlight the entire contents of a textbox when it receives focus. And most of us type the name of the textbox when we pass it to this routine. Instead of typing the control’s name in each GotFocus event, you can use this sub to highlight the currently active textbox on the passed form. Place this code in a module:

 Sub HiLite(frm As Form)	frm.ActiveControl.SelStart = 0	frm.ActiveControl.SelLength = _		Len(frm.ActiveControl.Text)End Sub

Then place this line of code in your textbox control’s GotFocus() event:

 Private Sub Text1_GotFocus()	HiLite MeEnd Sub

Using this code, you can forget about typing your controls’ names over and over.

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular