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 / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

Check Value of Option button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rg32 - 28 Apr 2005 15:52 GMT
I have a single Option button on a form used to indicate a "special
circumstance" which might occurr for some of the records, it is bound to a
yes/no field in the underlying table.  What I need is some way to determine
if this button is already selected for a particular record when the form
opens.  If the button is already selected, and the user de-selects it then I
need an input box to open and the user to be forced to enter a brief
explanation about the special circumstances for the particular record.  I
don't need the input box when they first select the option, only if they
de-select option for a record which it was previously selected.

Any ideas on this would be greatly appreciated, thanks.
Rick B - 28 Apr 2005 16:06 GMT
First, I assume you mean a checkbox, not an option button.  Option Groups
contain multiple radio buttons.  The user can select only one from the
group.  I've never seen a single radio button.

That being said, just add code to the checkbox's CHANGE event to say, If
"no" then...   And display a message box and whatever other code you want to
perform.

Signature

Rick B

> I have a single Option button on a form used to indicate a "special
> circumstance" which might occurr for some of the records, it is bound to a
[quoted text clipped - 7 lines]
>
> Any ideas on this would be greatly appreciated, thanks.
Klatuu - 28 Apr 2005 16:30 GMT
Sorry, Rick.  There is no change event for a check box.  I tried an approach
that works.  In the Current event, set the Tag property of the check box to
the value of the field.  then in the Exit event (May not be the exact best
place depending on what else is happening):

   If Me.Check21.Tag = True And Me.Check21 = False Then
       Present the Input Box
       Put the value returned from the Input Box where you need it
   End If

> First, I assume you mean a checkbox, not an option button.  Option Groups
> contain multiple radio buttons.  The user can select only one from the
[quoted text clipped - 17 lines]
> >
> > Any ideas on this would be greatly appreciated, thanks.
Marshall Barton - 29 Apr 2005 01:49 GMT
I would recommend the AfterUpdate event (it won't fire if
the user just tabs throught the control without changing it.

Also, the control's OldValue property will serve the purpose
without involving the Current event ot the Tag property.
Signature

Marsh
MVP [MS Access]

>I tried an approach
>that works.  In the Current event, set the Tag property of the check box to
[quoted text clipped - 17 lines]
>> > don't need the input box when they first select the option, only if they
>> > de-select option for a record which it was previously selected.
Rick B - 28 Apr 2005 16:07 GMT
Make that the "before update" event.

Signature

Rick B

> I have a single Option button on a form used to indicate a "special
> circumstance" which might occurr for some of the records, it is bound to a
[quoted text clipped - 7 lines]
>
> Any ideas on this would be greatly appreciated, thanks.
rg32 - 29 Apr 2005 22:46 GMT
Actually it is an Option button.  You can use single option buttons without
the option group, which is what I did in this case because I only have one
option.  I suppose the individual option button works pretty much the same as
a check box though.  

The OldValue property in the Before Update event works great.  Thanks.

> Make that the "before update" event.
>
[quoted text clipped - 11 lines]
> >
> > Any ideas on this would be greatly appreciated, thanks.
 
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.