Avatar of Dustin Stanley
Dustin Stanley
 asked on

MS Access Change Textbox Background Color Depending on Another Textbox Value On a Continuous Form

I have a subform for notes. In this subform it has a combo box for choosing Private or Public. I would like to have my notes background to change color depending upon if the notes are Private or Public for easy distinction between the two types.

My only issue is how do I make the continuous form have different background colors for each record while they are all showing in a continuous form display?

Something like:
If Me!txtPrivatePublicID.Value = "1" Then
   Me!txtSourceSkuNote.BackColor = vbYellow
 End If
    
  If Me!txtPrivatePublicID.Value = "2" Then
     Me!txtSourceSkuNote.BackColor = vbBlue
  End If

Open in new window


 If Forms!frmSKuSource!frmSourceSkuNotes.Form!txtPrivatePublicID.Value = "1" Then
   Forms!frmSKuSource!frmSourceSkuNotes.Form!txtSourceSkuNote.BackColor = vbYellow
 End If
    
  If Forms!frmSKuSource!frmSourceSkuNotes.Form!txtPrivatePublicID.Value = "2" Then
     Forms!frmSKuSource!frmSourceSkuNotes.Form!txtSourceSkuNote.BackColor = vbBlue
  End If

Open in new window


Thanks for the help!
Microsoft AccessVBA

Avatar of undefined
Last Comment
Dustin Stanley

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
crystal (strive4peace) - Microsoft MVP, Access

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dustin Stanley

ASKER
PERFECT! THANKS!
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes