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

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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now