I have a form which users choose the required record by selecting from a drop down combo box. I am trying to change the background colour on the whole form depending on the membership type for the record selected in the combo box. The code I have at the moment is:
Private Sub Combo_member_AfterUpdate()
On Error GoTo Combo_member_AfterUpdate_Err
DoCmd.GoToControl "ID_No"
DoCmd.FindRecord Combo_member, acEntire, False, , False, , True
Combo_member_AfterUpdate_Exit:
Exit Sub
Combo_member_AfterUpdate_Err:
MsgBox Error$
Resume Combo_member_AfterUpdate_Exit
Me!Combo_member_AfterUpdate.Requery
End Sub
and what I tried to do was add an if statement above the afterupdate_exit, but couldn't work out how to refer to the membership type box in the if statement. For example, if the membership type is donor the background colour of the form would be green.
I'd be very grateful if anyone could either give me an idea of how to put the code together, or point me in the direction or where to look for info. I've tried looking at conditional formatting on this site, but only seem to find formatting for particular control boxes, not the whole form. But I might be looking in the wrong place.
Any help gratefully received. Thank you.
Private Sub Combo_member_AfterUpdate()
On Error GoTo Combo_member_AfterUpdate_Err
DoCmd.GoToControl "ID_No"
DoCmd.FindRecord Combo_member, acEntire, False, , False, , True
Combo_member_AfterUpdate_Exit:
Exit Sub
Combo_member_AfterUpdate_Err:
MsgBox Error$
Resume Combo_member_AfterUpdate_Exit
Me!Combo_member_AfterUpdate.Requery
End Sub
and what I tried to do was add an if statement above the afterupdate_exit, but couldn't work out how to refer to the membership type box in the if statement. For example, if the membership type is donor the background colour of the form would be green.
I'd be very grateful if anyone could either give me an idea of how to put the code together, or point me in the direction or where to look for info. I've tried looking at conditional formatting on this site, but only seem to find formatting for particular control boxes, not the whole form. But I might be looking in the wrong place.
Any help gratefully received. Thank you.