Best way of highlighting a frame when in a text box

morlan

Registered User.
Local time
Today, 08:05
Joined
Apr 23, 2003
Messages
143
For example, when the user is in the Title box the area turn white. This make it easier for them to see where they are.


I was going to set each text box with an 'on focus' event to change the backround of the give area to white but this seems time consuming.. any ideas.


db01.gif
 
Try the following Function. Copy the Function to a Global Module.


Public Function SetBackColor(PassColor As Variant)
On Error GoTo Err_SetBackColor

Select Case PassColor
Case "W", "0", "WH" '-- white
Screen.ActiveControl.BackColor = 16777215
Case "B", "U", "BL" '-- Blue
Screen.ActiveControl.BackColor = 16764057
Case "LB" '-- Light Blue
Screen.ActiveControl.BackColor = 16764057
Case "YE", "Y" '-- light yellow
Screen.ActiveControl.BackColor = 13434879
Case Else
Screen.ActiveControl.BackColor = PassColor
End Select

Exit Function

Err_SetBackColor:
msg Error
Exit Function

End Function

-----------------

Feel free to change the colors at your discretion. Place the function on the Control_Enter and Control_Exit events. Use the Enter event to set the color to yellow or whatever, and the Exit to change the color back to white, e.g

ON Enter
= SetBackColor("Y")

On Exit
= SetBackColor("W")
 
Thanks m8, that works great but It's not exactly what I'm trying to do. Ideally the whole label box background would turn white as shown in the screenshot above. Would you have any suggestions? Thanks
 
Just in case you didn't know, you've got an incorrect spelling for ADDRESS on your form in a couple of places.
 
Mile-O-Phile said:
Just in case you didn't know, you've got an incorrect spelling for ADDRESS on your form in a couple of places.

Thanks
 
Sorry I didn't read your original email as well as I should have. But the good news is if those boxes are group frames, they also have an enter and exit event. You can hang the function I sent you on them.

If you're using a box, the switch it to a group frame.


Good Luck. Let me know how it works.
 

Users who are viewing this thread

Back
Top Bottom