reddevil1
Registered User.
- Local time
- Today, 20:01
- Joined
- Nov 12, 2012
- Messages
- 92
Please could someone advise how I can change the backcolor of a Control to a specified colour when a different Control receives the Focus, APART from when the Form is first opened?
I have the following Controls on my Form:-
ContractID
ContractDetails
When my Form first opens, ContractID receives the Focus (and this is what I want to happen).
I want the backcolor of ContractDetails to change to 9170175 but Not when the Form is first opened. But I do want it to change colour for every other time that ContractID receives the Focus.
This is my current coding:-
I tried to add coding to Form On Current event but this codes seems to be overridden by the opening of the Form when I make ContractID receive the Focus (TabIndex 0).
I have the following Controls on my Form:-
ContractID
ContractDetails
When my Form first opens, ContractID receives the Focus (and this is what I want to happen).
I want the backcolor of ContractDetails to change to 9170175 but Not when the Form is first opened. But I do want it to change colour for every other time that ContractID receives the Focus.
This is my current coding:-
Code:
Private Sub ContractID_GotFocus()
ContractDetails.BackColor = 9170175
End Sub
Private Sub ContractID_LostFocus()
ContractDetails.BackColor = 9800909 (this is the standard colour that I want always, unless ContractID has the focus)
End Sub
I tried to add coding to Form On Current event but this codes seems to be overridden by the opening of the Form when I make ContractID receive the Focus (TabIndex 0).