Coding in a subform in response to an event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am a new comer...I am building a form with a subform. In the subform, when
a conditional event occurs, like the number entered is more than 12, the
number turns red and a msgBox pops up with a warning. Here is the code:

Private Sub strHGB_BeforeUpdate(Cancel As Integer)
With Me!strHGB
If (.Value >= 12) Then
Me!strHGB.ForeColor = 255
MsgBox "Review DOQI Guidelines for HGB >= 12."
Else
Me!strHGB.ForeColor = 0
End If
End With

End Sub--

My problem is that the forecolor change does not occur in the subform
(datasheet view). It will turn red in form view or continuous view, but only
the msgBox comes up in datasheet. Is there any way to fix this? Thank you.
Kbelo
 
My problem is that the forecolor change does not occur in the subform
(datasheet view). It will turn red in form view or continuous view, but only
the msgBox comes up in datasheet. Is there any way to fix this? Thank you.

Formatting of individual textboxes in a Datasheet or Continuous view Form is normally done with Conditional Formatting.
Click on the control in Design view, then select Format - Conditional Formatting from the menu. See the online help
topic for information on using CF.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Thank you!..it worked perfectly.
--
Kbelo


Scott McDaniel said:
Formatting of individual textboxes in a Datasheet or Continuous view Form is normally done with Conditional Formatting.
Click on the control in Design view, then select Format - Conditional Formatting from the menu. See the online help
topic for information on using CF.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
Back
Top