ClaraBarton
Registered User.
- Local time
- Today, 03:35
- Joined
- Oct 14, 2019
- Messages
- 685
I have a form of Accounts with a subform of register. The subform is Parent/Child Account number.
I'd like to tie the register background color to the account color. I can't figure out which event to use.
Change of account triggers the Parent/Child connection.
So I tried the Current Event.
Placing a txtbox of the color on the parent form never triggers on change.
I tried including it in the date and account filters but that didn't work.
I'd like to tie the register background color to the account color. I can't figure out which event to use.
Change of account triggers the Parent/Child connection.
So I tried the Current Event.
Placing a txtbox of the color on the parent form never triggers on change.
I tried including it in the date and account filters but that didn't work.
Code:
Private Sub Form_Current()
Dim frm As Form
Set frm = Me.Parent.Register.Form
[SelectedID] = Me.AccountID
frm.Detail.BackColor = DetailColor(Me.fColorID)
End Sub
Public Function DetailColor(ID As Long)
Dim bckColor As String
Select Case ID
Case 13
bckColor = &H131313
Case 14
bckColor = &H5149E9
Case 15
bckColor = &H9E949A
Case 16
bckColor = &H7DFB37
Case 17
bckColor = &HFAFFF7
Case 18
bckColor = &HE583D9
Case 19
bckColor = &HF2F244
End Select
End Function