On my main form when the user enters a field, I highlight the textbox to a yellow easily displaying the current text box.
Lots of applications use this sort of technique. I would really like to display a red border around the current text box the user is working in...but i can't get it to work. I did have this working at one time but I seem to have clobbered that piece of code.
When the user is in a textbox, the gotfocus event fires the following function. But as I said, the bordercolor is not taking.
I dont think that property is available in this context. Hopefully someone can show another way.
Function Highlight(Stat As String) As Integer
Dim ctrl As Control
On Error Resume Next
Set ctrl = Screen.ActiveControl
If Stat = "GotFocus" Then
ctrl.BackColor = 13434363
ctrl.BorderColor = RGB(255, 0, 0)
ElseIf Stat = "LostFocus" Then
ctrl.BackColor = 16777215
End If
End Function
Lots of applications use this sort of technique. I would really like to display a red border around the current text box the user is working in...but i can't get it to work. I did have this working at one time but I seem to have clobbered that piece of code.
When the user is in a textbox, the gotfocus event fires the following function. But as I said, the bordercolor is not taking.
I dont think that property is available in this context. Hopefully someone can show another way.
Function Highlight(Stat As String) As Integer
Dim ctrl As Control
On Error Resume Next
Set ctrl = Screen.ActiveControl
If Stat = "GotFocus" Then
ctrl.BackColor = 13434363
ctrl.BorderColor = RGB(255, 0, 0)
ElseIf Stat = "LostFocus" Then
ctrl.BackColor = 16777215
End If
End Function