update-button

  • Thread starter Thread starter Steve Miller via AccessMonster.com
  • Start date Start date
S

Steve Miller via AccessMonster.com

On a form I want the color of one textbox to change, when the value in
another textbox is altered (under some condition, e.g. number>100). That
worked well with the exception of one problem: the color change takes only
place when I first go to another recordset and then back again - maybe
that's the case because I have put that code into a Sub Form_Current, but I
don't wanna change that (or should I?).

Instead I tried to create an Update-button and was almost successful with
me!requery.
"almost" because that brought me to the first set of records and not to the
one I have changed.
Now I hope that somebody could give me a hint, how I can update the color
without leaving this particular record.
(btw: refresh, repaint, recalc didn't work)
 
You can leave the code in the OnCurrent event if it's working correctly for
you. You just want to add it to the AfterUpdate event of the control that's
being edited which determines the color of the dependent control.
 
Steve,
Have you tried conditional formatting? Lets say you want txtBox2 to change
color when the value in txtBox1 is > 100. In design view:
select txtBox2
On the Menu, select Format --> Conditional Formatting
In Condition 1 select "Expression is"
Enter [Forms]![frmMyForm]![txtBox1]>100 - (using your real names, of course)
Select the color you want for your background
Click OK
That's all there is to it
 
Thanks a lot for your help! I did it with after_update and it worked
smoothly.
 
Back
Top