A
accessuser1308
I currently have a form with approximately 20 text fields. I would like to
find some VBA code that will allow me to format the current/active field on
the form (change border to blue and text to bold) and return to normal when
it loses focus. I know how to do this for each individual field...
Private Sub Text1_GotFocus()
Me.ActiveControl.BorderColor = vbBlue
Me.ActiveControl.BorderWidth = 2
End Sub
Private Sub Text1_LostFocus()
Text1.BorderColor = vbBlack
Text1.BorderWidth = hairline
End Sub
Is there somewhere on the form itself I can use this code, or something like
it, so I do not have to place this code in the got focus and lost focus
events of every field on the form. If I add fields at some point I don't
want to have to remember to add this code.
Thank you for your help
find some VBA code that will allow me to format the current/active field on
the form (change border to blue and text to bold) and return to normal when
it loses focus. I know how to do this for each individual field...
Private Sub Text1_GotFocus()
Me.ActiveControl.BorderColor = vbBlue
Me.ActiveControl.BorderWidth = 2
End Sub
Private Sub Text1_LostFocus()
Text1.BorderColor = vbBlack
Text1.BorderWidth = hairline
End Sub
Is there somewhere on the form itself I can use this code, or something like
it, so I do not have to place this code in the got focus and lost focus
events of every field on the form. If I add fields at some point I don't
want to have to remember to add this code.
Thank you for your help