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

MS ACCESS:  Want to get Option Group to stop always opening the last selected option 1st instead of the user selected option

Posted on 2014-10-02
9
252 Views
Last Modified: 2014-10-06
I have an "Option Group", wizard created without a default selection, that has this unwanted quirk where it launches the pre-close, last selected option, instead of the user selected option, even though the user selected an alternative option.   When the user exits the unwanted option, the user is then free to satisfactorily select the option(s) desired.
There are 7 options, each launching a 'built' macro that opens a specific Query.
0
Comment
Question by:willjx
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 28

Expert Comment

by:omgang
ID: 40358298
Post the code for the AfterUpdate event of the Option Group.
OM Gang
0
 

Author Comment

by:willjx
ID: 40358337
I know not of what you speak.
I am aware of "the AfterUpdate event of the Option Group".  However, I do not "code", and prefer not to code.
0
 
LVL 28

Expert Comment

by:omgang
ID: 40358391
The Wizard would have coded this for you.  In the properties box for the Option Group, double-click the AfterUpdate event to open the code window.
OM Gang
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:willjx
ID: 40358462
I  "double-clicked the AfterUpdate event to open the code window", and all it did was toggle between Mprogram and EventProcdedure with no apparent Wizard coding.
0
 
LVL 30

Expert Comment

by:hnasr
ID: 40358664
Upload a sample database after removing all objects unrelated to this issue.
Explain what to do to demonstrate the problem.
0
 
LVL 84
ID: 40359131
If you goal is to just launch a query when the user clicks one of the Radio buttons, then I'm not sure you need an Option Group for that. Option Groups are used for "One and Only One" type of selections. like Gender.  Try removing the option buttons from the group (but leave the macros attached) and see if that solves your issue.

To remove them from the group, highlight the Radio button and it's label, and then press Ctrl-X. Then, click on the Detail section and press Ctrl-C.
0
 

Author Comment

by:willjx
ID: 40360612
Scott--Appears to be a better solution.  I did your recommendation:
"..highlight the Radio button(s) and it's label(s), and then press Ctrl-X. Then, click on the Detail section and press Ctrl-V".
Properties auto-showed: "On Got Focus" with the correct embedded macro.
Clicking on the button evoked the appropriate macro/Query.
However, it will not allow me to close the Query, so I can select another button.
  Clicking on the top right cnr, X or right-button clicking 'Close' does nothing.
What do I need to add?
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40361111
Properties auto-showed: "On Got Focus" with the correct embedded macro.
You should run that on the Click event of that control, otherwise if your user tabs through the controls, they'll launch each of them, and that's probably not what you want. Also, in my opinion Radio Buttons are poor choice for this sort of process, as they're generally used to indicate a setting, or a selection of one or more items. A better control for this would probably be a Command Button - but that's up to you.

If you can't close the query, then you've got troubles with the database, or troubles with Access. Before doing any of these suggestions, be sure to backup your database.

1.Compact the database.
2. Compile the database - from the VBA Window, click Debug - Compile. Fix any errors you find, and continue doing this until the menu item is disabled.
3. Compact again.

Sometimes you have to Decompile the database. To do that, create a shortcut with a Target like this:

"full path to msaccess.exe" "full path to your db" /decompile

Run that, then run the 3 steps above again.

You may also need to create a new, blank database and import everything to there. Create the database, then use External Data - Import to locate your old database. Select all objects, and click Import. After you've done that, complete the 3 steps above again.

Finally - be sure your Office and Windows installations are fully up to date, with all Service Packs, and all relevant Hot Fixes installed.
0
 

Author Closing Comment

by:willjx
ID: 40364883
Thanks.  Could not find anything wrong with the DB.
Took your suggestion to just use "Command" buttons in place of 'Options', and all is well
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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 stored procedures 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 Micr…
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…

839 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