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 / New Users / July 2006

Tip: Looking for answers? Try searching our database.

THE Option Button in the toolbox How i can use it?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
HANA - 24 Jul 2006 17:23 GMT
Hi, is there is such a code to verify is an option button is
selected??
& what is the option group?
& if there is such a code where i wriet it? I mean in which event

thanks for any help
John Vinson - 24 Jul 2006 21:02 GMT
>Hi, is there is such a code to verify is an option button is
>selected??
>& what is the option group?
> & if there is such a code where i wriet it? I mean in which event
>
>thanks for any help

An "Option Box" or "Option Group" control is a box containing several
other controls (which might be checkboxes, option buttons, or toggle
switches). Each such control has an associated number - it might be
three checkboxes numbered 1, 2 and 3 for example.

The Value property of the Option Group control is whichever value the
user selected - if they check the checkbox numbered 3, the value of
the Option Group control will then be 3.

You can put code in the Option Group's AfterUpdate event to detect
that the user has made a selection.

                 John W. Vinson[MVP]
HANA - 25 Jul 2006 01:47 GMT
hi John

thank you for reply I did understand you  verey well, but now my qustion to
you is

when i selecet an Option Button it's number was 16 and the othere was 19
..... be with me in that!!!! ok  frist! Is there is worng in that?
2- Do i wriet this code?
Private Sub Option16_AfterUpdate()
If Me.ogrMyOptionGroup = 1 Then
<OPtion Button Is Selected>
& if itis not What is the right code?
John Vinson - 25 Jul 2006 02:30 GMT
>hi John
>
[quoted text clipped - 3 lines]
>when i selecet an Option Button it's number was 16 and the othere was 19
>..... be with me in that!!!! ok  frist! Is there is worng in that?

You should use the AfterUpdate event *OF THE OPTION GROUP CONTROL* -
not the afterupdate event of each button in that control.

Private Sub ogrMyOptionGroup_AfterUpdate()
If Me!obrMyOptionGroup = 16 Then
  <do something appropriate if button 16 was clicked>
End If

or, more commonly,

Select Case Me!obrMyOptiongroup
 Case 1
   <do something appropriate for option 1>
 Case 2
   <and so on and so on...
...
End Select

                 John W. Vinson[MVP]
HANA - 25 Jul 2006 08:26 GMT
OK THANK YOU VEREY MUCH I WILL TRY THIS

> >hi John
> >
[quoted text clipped - 23 lines]
>
>                   John W. Vinson[MVP]    
 
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.