Option buttons allowing multiple selections

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ka3pmw
    New Member
    • Dec 2015
    • 2

    #1

    Option buttons allowing multiple selections

    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!
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    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.
    Last edited by zmbd; Dec 20 '15, 09:05 AM.

    Comment

    • ka3pmw
      New Member
      • Dec 2015
      • 2

      #3
      Originally posted by zmbd
      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.
      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.

      Comment

      • hvsummer
        New Member
        • Aug 2015
        • 215

        #4
        @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
        Code:
        ...
        if me.controls("OptionBox's name" & i).value = true then
        Me.Items = choose(i, "item1", "item2", "item3", "item4", "item5", "item6") 
        end if
        merry xmas

        Comment

        • zmbd
          Recognized Expert Moderator Expert
          • Mar 2012
          • 5501

          #5
          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_Addres sBook]
          (this may have many related tables)

          [Customer_Accoun ts]
          Has field related to [Customer_Addres sBook]

          [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_Accoun ts]

          >> 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.
          Last edited by zmbd; Dec 26 '15, 04:40 PM.

          Comment

          Working...