469,125 Members | 1,777 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,125 developers. It's quick & easy.

Option buttons allowing multiple selections

2
Windows 7 Access 2007

I am designing a database that has 6 items in a table. The items can only be one of the six. I am using Yes/No data type with textbox for the control. The query is using a Checkbox for the display control.
On the form, I created a sub form based on the query then changed the check boxes to option buttons. I got the buttons but it allows me to select multiple items instead of just one.

Someone PLEASE help me. I did this on another sub form and it works fine!
Dec 20 '15 #1
4 1374
zmbd
5,400 Expert Mod 4TB
You have to place the option buttons in a group box. As you've discovered, what works with one record-set may not work with another. This depends entirely upon the tables/queries used for the record-source.

From the very little information we have, this isn't the design I would suggest for your form and from what little we have from your post it would be highly advisable to read thru: Database Normalization and Table Structures it appears that your overall database design could be (should be) tweaked just a tad.
Dec 20 '15 #2
ka3pmw
2
@zmbd
I have the buttons inside a option group box.
Also neither set of buttons is working right. I am getting data in the wrong records.
If you want, I can post the striped down database.
Dec 20 '15 #3
hvsummer
215 128KB
@ka3pmw:
your options button lets you multi checks mean something wrong.
may be your options button not on the same group ?
and maybe you want to data entry ? if that you have to put data entry property to true then your record'll move to new record, won't affect your current data

I suggest you to change your option control in vba like this
Expand|Select|Wrap|Line Numbers
  1. ...
  2. if me.controls("OptionBox's name" & i).value = true then
  3. Me.Items = choose(i, "item1", "item2", "item3", "item4", "item5", "item6") 
  4. end if
  5.  
merry xmas
Dec 25 '15 #4
zmbd
5,400 Expert Mod 4TB
1) I've re-read your first post six times now and what you have posted doesn't make sense from a database design. Hopefully there is more here than you've posted.

What I have is:
> One table
> Six records
> You can only have one of these records active at a time.
>> You are using a yes/no field to indicate the active record.


2) It sounds as if you added the Option-Group-Frame (OGF) and the option buttons (OPB) as separate elements on the form. Then either dragged the OPB into the OGF or dragged the frame around the OPBs.

In either case, the OPB will not become part of the OGF's control collection. There is an easy way to check this, show the property sheet, select one of the OPBs, the drop-down list in the property sheet should show this control in the drop-down list when either selected on the form or from the property-sheet's drop-list. Once the OPB's properties are showing, select the data tab. OPB that are part of an OGF's collection will have only three properties for data; "Option Value", "Enabled", and "Locked." OPBs that are not part of an OGF will have many more data properties such as "Control Source"

If your OPBs are not part of an OGF there is no easy way to correct this with the controls you have in place without either deleting and recreating the controls or using some fairly esoteric VBA to add the OPB to the OGF collection or a lot of VBA to duplicate the functionality of the OGF and provide that information to your record-set.

3) Before we go off on a "Wild Goose Chase" to correct this issue with code or redesigning your form - we will need a much better understanding of the goal/reason behind your database, what tables you have in the database, and how they are related to each other. If any of that (table being related to each other and how to do that) doesn't make sense then please read Database Normalization and Table Structures

All you need to post for us is something like:
[TableName]
Has field related to [TableName(s)]

Along with the over-all purpose of the database

For example (I'm only referring to tables here no field information, that may be for later, and this is a very simplistic example):

>Goal: Track orders and paid invoicing of products purchase by our customers.

[Customer_AddressBook]
(this may have many related tables)

[Customer_Accounts]
Has field related to [Customer_AddressBook]

[Product]
Has field related to [Manufacture]
Has field related to [PColours]
Has field related to [PSize]
Has field related to [PackagingType]

[COrders]
Has field related to [Product]
Has field related to [Customer_Accounts]

>> PLEASE do NOT attach your database at this point in time. Normally this is not required to provide the needed assistance. Many of our Experts, myself included, work behind firewalls or with IT-Security that usually prohibit downloading such files.
Dec 26 '15 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Craig B. | last post: by
2 posts views Thread by Steffen Loringer | last post: by
18 posts views Thread by =?Utf-8?B?TGkgV2VuZw==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.