Check a option in an option group via vba code?

G

Guest

Hello,
I have a little "report generator" form that users can select criteria to
generate a custom report. Beside four of the primary criteria (that are each
combo boxes), I placed a "radio button" (ie, option group). I want to check
the radio button beside the combo box/label whenever they change a particular
combo combo box, so they know that is the type of report they will be
generating. I can't figure out how to "check" an option in an option group
via VBA though. There doesn't seem to be a "checked" property like there is
for (seemingly! haha!) every other language on the planet.

Radio: Label: Combo box:
* Project Title: cboTitles
* Project Manager: cboProjectManagers
* Department: cboDepartments
* Employee: cboEmployees

So when they make a change, say select a project manager from the
cboProjectManagers combo box, I want the radio button beside "Project
Manager" to be checked automatically...

Thanks! -Mike
 
G

Guest

Each radio button has a property called Option Value. In your case the values
of these are probably 1 through 4. To set one of the radio buttons, assign
it's value to the 'Frame' that contains the buttons. e.g. if the Frame
control is called OptionsFrame, then each combo box's AfterUpdate event needs
a statement OptionsFrame = n, where n is the value of the combo box's
corresponding radio button's Option Value (1-4).
 
J

John Spencer

In an option group, you check the value of the Option group control (MS
autonames this Frame if you don't assign a name). This will get the value
associated with checked item in the option group. If you want to force the
item to be checked you set the Option Group's value to one of the check box
control's option value.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top