Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Programmatically reset option groups selection in ms access 2007 VBA

Posted on 2013-11-21
3
2,723 Views
Last Modified: 2013-11-21
I have 3 option groups with 3 radio buttons each group. The default (selected) radio button in each group is the #1 (First button). I would like to create a button that will reset all the option selections to option #1 in each group
I have tried:
Me.MyOptionGroup1 = 1
Me.MyOptionGroup1.Value = 1
But nothing seems to work
0
Comment
Question by:Cobra967
  • 2
3 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 333 total points
ID: 39666040
this should work

Me.MyOptionGroup1.Value = 1

are you sure that the name of the option group is "MyOptionGroup1"
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 167 total points
ID: 39666056
I think both statments should work, assuming three things:

1.  That OptionGroup1 is the name of the correct control... the name of the *frame* that encloses the options

2.  That you haven't modified the 'values' of the options that are set by default when you create an option group.

3.  That your event procedure for the button is actually running.  Make sure that code/macros are enabled and double check that 'Event procedure' is showing up in the command buttons property sheet next to  On Click.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 333 total points
ID: 39666061
better use vba codes to that

private sub btnReset_click()
Dim ctl As Control
For Each ctl In Me.Controls
     If ctl.ControlType = acOptionGroup Then
          ctl.Value = 1
     End If

Next
end sub
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question