Jul 18, 2001 #1 sccice Programmer Apr 5, 2001 4 GB I have a button that updates certain fields within a form and i would like to alter the background color and text color of fields if it updates them
I have a button that updates certain fields within a form and i would like to alter the background color and text color of fields if it updates them
Aug 10, 2001 #2 gyli84 MIS Aug 6, 2001 67 GB In the On_Current Event of the form enter: Private Sub Form_Current() If (Me!txtBox1) <= Me!txtBox2 Then Me!txtBox2.ForeColor = 255 Me!Label1.Visible = True Else Me!txtBox2.ForeColor = 0 Me!Label1.Visible = False End If End Sub This will also display a label (which you could hide as not visible) upon the criteria being met. Set the button to: Private Sub Button1_AfterUpdate() ' Run Form_Current procedure. Form_Current End Sub hope this helps! Upvote 0 Downvote
In the On_Current Event of the form enter: Private Sub Form_Current() If (Me!txtBox1) <= Me!txtBox2 Then Me!txtBox2.ForeColor = 255 Me!Label1.Visible = True Else Me!txtBox2.ForeColor = 0 Me!Label1.Visible = False End If End Sub This will also display a label (which you could hide as not visible) upon the criteria being met. Set the button to: Private Sub Button1_AfterUpdate() ' Run Form_Current procedure. Form_Current End Sub hope this helps!