title: VBA code that changes the background color of a form after update
body: <p>I need some code that when a check box is unchecked it will change the background color of my form and return it back to its original color when checked. The code i have for the check box currently locks a combo box when a value is chosen. Example below</p>
  
  <pre><code>Private Sub AccessKeyNo_AfterUpdate()
  If MsgBox("Do you want to assign Access Key " &amp; Me.AccessKeyNo &amp; "?", _
          vbYesNo) = vbYes Then
      Me.GuestAccessKeyID = Me.AccessKeyNo
  
      If Me.Dirty Then Me.Dirty = False
      Me.AccessKeyNo.Requery
      Me.AccessKeyNo = Null
  
      Me.MyCheckBox = IsNull(Me.GuestAccessKeyID)
  End If
  End Sub
  </code></pre>