Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    themidnitereign is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    11

    Need help with option buttons/checkboxes and multipage tabs

    Hi everybody, I'm creating a database for collecting internal combustion engine data and I've been asked to include option buttons/checkboxes to bring up the related tabs. My problem is I can turn the tabs on but I can't turn them back off. I've tried unbound option/checkboxes but they seem to create their own column on the records list. Then I tried bound option/checkboxes and it can pull up multiple pages but then I can't turn the tabs off. Furthermore, if you have more than about 3 tab pages open and try to open more the program struggles for a second to open the additional tabs. It kinda spazzes out for a second.

    Beforehand, I was having the user choose which Noob.ziptest they wanted by list, then select which modification they had through combobox and the tab would pop up. Then people wanted multiple tabs to be open quickly and at the same time. I'm open to any suggestions regarding my problems above or at all.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I have code that sets visibility of tab pages when a form opens but haven't tried setting their visibility after the form is open. I see what you mean about TabCtl1 appearance when code executes.

    The Option Group is intended to allow selection of only one page of tab control at a time? The following will work with OptionGroup. There are 25 radio buttons but 27 pages on TabCtl1. Appear to be missing Water Pump Dyno and Flow Bench Test. Fix this then set the PageIndex of each page and the corresponding radio button OptionValue to the same number 0 through 26. The code:
    Code:
    Private Sub Frame826_AfterUpdate()
    Dim p As Page
    For Each p In TabCtl1.Pages
        p.Visible = p.PageIndex = Frame826
    Next
    Me.TabCtl1.Visible = True
    End Sub
    The label for the OptionFrame is creating an unbound column in the datasheet.

    The comboboxes appear to work correctly.

    If you want to allow multiple tabs, how many - any number? Think check boxes might be needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    themidnitereign is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    11
    Quote Originally Posted by June7 View Post
    The Option Group is intended to allow selection of only one page of tab control at a time?
    That is what the option group is doing but that is not my intended outcome. This is why i think checkboxes might be needed as well.

    There are 25 radio buttons but 27 pages on TabCtl1. Appear to be missing Water Pump Dyno and Flow Bench Test.
    The page numbers go to the pages in TabInfo. I added the dyno and bench test after most everything else was created. And those two categories turned out to need a lot more data than I originally anticipated. I'll probably have to make them their own subform. Great observation though!

    The label for the OptionFrame is creating an unbound column in the datasheet.
    How do I correct this problem?

    If you want to allow multiple tabs, how many - any number?
    I didn't quite understand this question. Can you rephrase it? Thanks for the help I'll try out your suggestions right now and see if I can figure things out alongside you.

    P.S. I have the tab controls turning off and on because I want the user to be able to go back and select another type of test or modification (if they clicked a button accidentally or something) and have it hide all the tabs and pages that are no longer necessary.

    Thanks for the help, again!!!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Do not understand: The page numbers go to the pages in TabInfo.

    The only way I know to prevent the Modifications label from showing as a column in the datasheet is to delete the label.

    My question should have been: If you want to allow multiple tab pages, how many - any number?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    themidnitereign is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    11
    The names of the tabs went from TabCtrl1 where there was "page 1-27" then if you go up to TabInfo the page numbers continue from "page 28-33." Regardless, I just renamed everything like you said so it's a moot point.

    I tried deleting the Modifications label and it worked but then it put "Frame 826" in as a column. So I just right clicked and hid it.

    If you want to allow multiple tab pages, how many - any number?
    I'm still having trouble understanding this question. I'm interpreting it as saying "If you want to allow multiple tab pages, how many would you like to add? Choose a number."

    or "If you want to allow multiple tab pages, you need to code it like this: # of pages desired minus 1 so you are always equal to the PageIndex."

    The code you posted is working but I still need to do the second part of keeping tab pages visible that have been clicked until the same tab page is clicked again in which case it should disappear.

    Noob V2.zip

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    The OptionGroup will allow only one TabCtrl1 page open at a time. This is the purpose of OptionGroup, to allow only one item to be selected at a time. If you want to allow users to select any assortment of pages to have open, think that would require checkboxes or toggle buttons - not placed in an OptionGroup. Do you really think this is more convenient for users? To me, clicking desired tab directly is just as easy as clicking in OptionGroup. Actually, means two clicks instead of just one - click OptionGroup to select item then click the tab to activate it. And it is a programming headache. I like to design forms that can be navigated without mouse clicks. I make extensive use of shortcut keys (Alt+key) for this, even on tab control tabs.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    themidnitereign is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    11
    Actually, I completely agree with you. My first version of the database was done through the comboboxes. Those worked fine like you said but when I presented this to the end users they wanted to be able to click every modification that was a part of their test/record so they see everything they needed to all at once. Also, the user may have very similar tests back to back and may only have on small thing that changed between the two tests. They wanted to easily be able to just make that one change while having the rest of the data fields be the same. Hopefully this makes sense.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Doesn't quite get me to understand the need for setting tab pages as visible/not visible.

    In my database, the reason for opening form with hidden tab pages is that users are entering data for an existing record. Only the tab pages necessary for data entry are made available. It is known which tab pages are needed because test procedures were selected when the material sample was logged in. So by hiding unnecessary tab pages, easier for user to navigate through the controls for data entry. However, they don't turn tab pages off/on, all pages pertinent to the sample record remain available and users enter/edit data as appropriate.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    themidnitereign is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    11
    Ok, I can definitely understand your confusion about the visibility of the pages. I made the decision to do that because the end users are easily scared away from what they determine to be a complicated program. We're talking about guys that rarely touch computers so I have to make the program look very simple and only show the tab pages the user wants to see. When I presented just the comboboxes method they were cool with that because it was straightforward and simple. When I showed them how many tab pages there actually were their eyes glazed over and they sat back in their seats with their mouths open. That's just an idea of what I'm dealing with here. I also want it to be visually simple so that users keep coming back to it and want to input their data.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Rarely touch computers? These guys don't even browse the internet at home? Time for them to educate and adapt? After all, it is the 21st century!LOL
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    themidnitereign is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    11
    Ok, so I'm now using a multivalue checkbox that isn't really working as intended. Again, my goal is to be able to have multiple selections make my tab control pages visible when checked. So far the code below will open up the first selection but does nothing else beyond that as in it doesn't move on to the next itemselected nor does ever open another tab page without resetting the form. Any assistance is appreciated.

    Code:
    Private Sub Modifications_3_Click()
    
    
    For Each vItem In Modifications_3.ItemsSelected
                TabCtl1.Pages(vItem - 1).Visible = True
                Next vItem
                
          
    End Sub

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I am not having luck with multi-select combobox, not even to create one with Access 2007. Seem to remember doing this before but not cooperating today.

    A multi-select listbox is another matter. This code works.
    Private Sub List56_Exit(Cancel As Integer)
    Dim x
    For Each x In Me.List56.ItemsSelected
    Debug.Print Me.List56.ItemData(x)
    Next
    End Sub

    I will look at this again later using your db and Access 2010.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    themidnitereign is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    11
    Quote Originally Posted by June7 View Post
    I am not having luck with multi-select combobox, not even to create one with Access 2007. Seem to remember doing this before but not cooperating today.

    A multi-select listbox is another matter. This code works.
    Private Sub List56_Exit(Cancel As Integer)
    Dim x
    For Each x In Me.List56.ItemsSelected
    Debug.Print Me.List56.ItemData(x)
    Next
    End Sub

    I will look at this again later using your db and Access 2010.
    Greatly appreciated. Here's the most recent:

    Noob_v3.zip

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Okay, it is a listbox bound to a multi-value field. Set the Multi-Select property of listbox.

    Can't have the values in two columns. Each row of listbox is a single item. The value of the BoundColumn will be saved to field.

    You have ModID as first item in list but since the RowSource is a ValueList, not a table or query, this has no meaning.
    This is a very long ValueList. A table of these values to use as RowSource would probably be easier. However, saving an ID to multi-value field instead of the descriptive value will cause problems. Multi-value fields work best if the data is short and descriptive, not lookup ID's. I refuse to use multi-value fields.

    I edited the ValueList and all values are in one column but the empty rows won't go away even when I delete the empty strings from the ValueList nor will ModID because the Lookup settings of the field in table are enforcing the listbox settings. Must be aspect of multi-value field.

    Listbox RowSource index values do not agree with TabCtl1 page index values. I select Air Inlet and Camshaft page opens. I select Other and FPR opens. When you get the ValueList items properly ordered, add this line after the loop code: Me.TabCtl1.Visible = True
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    themidnitereign is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    11
    So, I've been trying for the past few hours to make the changes you suggested and doing so somehow either ends up making the entire form disappear except the blue background or the form just won't open anymore at all. Sometimes all I try to change is the listbox or just make a new listbox completely. Ends up in failure but it seems to happen after I have been tinkering with multi-value fields for a few minutes...

    To clear up your questions though:
    ModID is meant to be a hidden item that the user won't know about.

    Since the index values are zero based I just subract by 1 and the listbox finds the right tab page to open that way for me.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Option Control to hide/show page tabs
    By tandridge in forum Forms
    Replies: 3
    Last Post: 12-08-2011, 10:15 AM
  2. How too use check boxes and option buttons
    By newtoAccess in forum Forms
    Replies: 0
    Last Post: 12-03-2010, 04:41 PM
  3. Option buttons
    By chazcoral2 in forum Forms
    Replies: 11
    Last Post: 09-13-2010, 07:53 AM
  4. option group radio buttons
    By ManC in forum Forms
    Replies: 9
    Last Post: 03-08-2010, 03:46 AM
  5. VBA Code in Access w/ option buttons
    By WebKiid in forum Access
    Replies: 1
    Last Post: 07-16-2009, 12:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums