?
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
Medium Priority
?
271 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
[X]
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
  • 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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 85
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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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