highlight field function

xaviermobius

Registered User.
Local time
Today, 20:16
Joined
Jul 25, 2006
Messages
12
I am trying to code a function which will highlight the text box while its being edited.

The function highlight() is placed in the OnGotFocus property of the field so it is called when the field is in focus.

I am new to VBA and dont know how to select the currently selected field i.e. the field which the cursor is currently in.

Function highlight()
Dim highlightcolour As Long
highlightcolour = RGB(255, 255, 0)
Selection.BackColor = highlightcolour
End Function

As you can see above i need to replace the word Selection with the command to select the currently selected field.

Any help would be greatly appreciated.
 
Hi xaviermobius,

What if you replace your Selection with Forms![frmName].[fldName]

Not sure if this will work?

Robert88
 

Users who are viewing this thread

Back
Top Bottom