Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2005

Tip: Looking for answers? Try searching our database.

YesNo control event question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gary Schuldt - 14 Sep 2005 23:12 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.