I have a y/n text (ynGift) on a form. There is another text box txtCost on
the same form.
Here's the logic I want to implement:
If the user "checks" the box, I want to set txtCost.Enabled = False;
If the user "unchecks" the box, I want to set txtCost.Enabled = True;
I'm not sure which ynGift event I should be keying on to invoke the logic:
OnClick? AfterUpdate? Other?
E.g., I'm not sure, when the Click event fires, does ynGift have the
"right" value?
Gary
Ken Snell [MVP] - 14 Sep 2005 23:33 GMT
Use the AfterUpdate event of the checkbox control to set the Enabled
property of txtCost.

Signature
Ken Snell
<MS ACCESS MVP>
>I have a y/n text (ynGift) on a form. There is another text box txtCost on
> the same form.
[quoted text clipped - 11 lines]
>
> Gary
Klatuu - 15 Sep 2005 15:03 GMT
In the After Update event:
Me.txtCost.Enabled = Not Me.ynGift
> I have a y/n text (ynGift) on a form. There is another text box txtCost on
> the same form.
[quoted text clipped - 11 lines]
>
> Gary
Gary Schuldt - 16 Sep 2005 19:13 GMT
Thanks to both.
I could also use Klatuu's code on the Load event if the record is not New.
Gary
> In the After Update event:
> Me.txtCost.Enabled = Not Me.ynGift
[quoted text clipped - 14 lines]
> >
> > Gary
Klatuu - 16 Sep 2005 20:22 GMT
Actually, I think it should go in the Current event. The Load event will
only work for the first record. The Current event fires each time you move
to another record.
> Thanks to both.
>
[quoted text clipped - 22 lines]
> > >
> > > Gary
Gary Schuldt - 17 Sep 2005 07:07 GMT
Makes sense; thanks for pointing out a mistake in-the-making!
Gary
> Actually, I think it should go in the Current event. The Load event will
> only work for the first record. The Current event fires each time you move
[quoted text clipped - 26 lines]
> > > >
> > > > Gary