[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 580
  • Last Modified:

Dynamic checkbox control array access2k3 form

On an access form I want to have a control array of checkbox's that will only allow 1 checkbox from the control array to be selected. The count of checkbox's on the form and the caption's of the checkbox's need to be driven from a query recordset which contains a name and a value.

Depending on which checkbox is selected I will run an event using the value from that checkbox. Below is the query I want to build the checkbox's on the form


SELECT campaign.name, campaign.status, campaign.campaignID
FROM campaign
WHERE (((ncts_campaign.campaign_type)="O"));

The campaign.name field would be the caption of the checkbox, the campaign.status would be whether the checkbox was checked or unchecked, the campaign.campaignID would be the value that I would use to relate back to the record in order to update the campaign.status field.

Please help with the VBA needed to make this happen, I have searched online but cant find anything close to what I'm trying to do.
0
Dalexan
Asked:
Dalexan
  • 2
  • 2
1 Solution
 
peter57rCommented:
Access does not have control arrays which is possibly why you can't find anything about it.

I am not about to produce any code for this, but the nearest equivalent would be an Option Group control, set up to use checkboxes.  However use of 'exclusive' check boxes is not really in line with the standards everyone else uses, is it.
'Radio buttons' is the normal UI to present in such a case.


0
 
DalexanAuthor Commented:
So can anyone help me with the VBA necessary to make this happen with a radio button option group control. I am unfamiliar with this....
0
 
Jeffrey CoachmanCommented:
<No Points wanted>

Like Pete I try to shy away form posting solution that too far afield from what is commonly done.
I have never seen a application that used "Exclusive" checboxes.

Checkboxes will signify a list of selections.
EX:
Select your uses for this product:
a. Work
b. Home
c. School
Here checkboxes would be used, because you can select more than one use.

An example of an Option group would be:
Select your Shipping method:
a. UPS
b. Fed Ex
c. USPS
...here you can only make one selection...Hence option buttons are commonly used.

So using exclusive checkboxes would create a counter-intuitive, non-standard user interface.

If you used option buttons you could use the Option group wizard as Pete stated and be done.

But hey, you can wait, perhaps an expert will be be willing to take this on...


JeffCoachman
0
 
Jeffrey CoachmanCommented:
As far as Control Arrays go, ...they are not available in VBA, though strangely enough, they are in VB6

In Access you have to "loop" (enumerate) the controls

Dim ctl as control
For each ctl in me.controls
    If ctl.Controltype=accheckbox then
        'Do Something
    Else
        'Do something else
    end if
Next ctl
0
 
DalexanAuthor Commented:
Oh well, I will go ahead with figuring out the option group control.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now