Results 1 to 14 of 14
  1. #1
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451

    tabbed control with combo boxes

    I have a form with a tabbed control that has a subform in it with combo boxes that are queried from each other. the second combo is based upon the first combo, the third is based on the second. it all works great until I add the form to the tab control as a sub form. as this is my first attempt at using tab controls i'm not getting any results from my combo's? should my where statements for the combo's be worded differently? my statement was


    WHERE (((LocDeptT.LocID)=[Forms]![RequestEditF]![cboloc]))
    requestedit was my form name and cboloc was the combo that this combo is queried from. I have been searching all morning and apparently looking in the wrong places because I can't find any direction. does anyone have experiences with combo boxes based on combo box in a tab control?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    All 3 combos are on the same form?

    Try simply:

    WHERE LocID=[cboloc]
    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
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    thanks june7, all three combo boxes are on the same form. tried the new where and that didn't help. as a page by itself the combo boxes work but when I move the form to the tab control it won't sort off the previous combo. if I pull the where out they work but are unsorted. is there something different about working with tab controls? I don't find much reference to them.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The suggested syntax has worked for me. Try deleting the combobox and creating new.

    Does not matter that subform is on tab control.

    If you want to provide db for analysis ...
    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
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,368
    You probably don't have the reference correct after you made the form a sub form on the tab control. I believe you do not have to worry about controls being on a tab since all controls are referenced with respect to their form container. The syntax for referencing a subform on a form is

    [Forms]![Main form name]![subform control name].[Form]![control name on subform]

    where [subform control name] is the name of your subform control, which is not necessarily the same as your subform name.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The simple reference I provided earlier should work.
    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
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    neither one worked thanks guys

  8. #8
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,368
    I gather that June7 thinks the combo boxes are on the form. While that may be correct, I think they are on the subform which is on a tab of the tab control which is on the form.
    ...a tabbed control that has a subform in it with combo boxes that are queried from each other.
    To say that neither worked without posting what you tried doesn't help us/me to help you. I suppose that's secondary to knowing for sure just exactly what it is you're dealing with.

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    No, I think the controls are on the subform. But it doesn't matter. The simple reference method has worked for me, as long as the dependent controls are all on the same form.

    Again, if you want to provide db for analysis, follow instructions at bottom of my post. I think that is the only way we will be able to help at this point.
    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.

  10. #10
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    tabcontrol.zip

    Thanks guy for the help, sorry for the delay, i was taking a mental break from this and camping. maybe this sample DB will help. Sometimes i don't describe the problem so that someone else can understand. the goal is that in the form requestsapprovemain, the person is reviewing request, if something needs to be adjusted in the request they can use the requestaproveedit form to edit the record. using the command button this worked but once i put it into the tab control i lost it. this is my first attempt at tab control, i like the funtionablility of it, but i don't find a lot of information to pull from so i am struggling with it. Micron, i do remember reading something in the past about having to change the syntax reference to something like you stated but honestly at the time i didn't think i would need it and now i can't find it. do you know of any referance material that explains tab controls a little better?

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The Recordsources are identical for main and sub forms. Why? Are you trying to emulate a split form?

    I did edits as suggested in post 2 and the combos work.

    SELECT [4DepartmentT].DeptID, [4DepartmentT].Department, LocDeptT.LocID FROM 4DepartmentT INNER JOIN LocDeptT ON [4DepartmentT].DeptID = LocDeptT.DeptID WHERE (((LocDeptT.LocID)=[cboLoc])) ORDER BY [4DepartmentT].Department;
    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.

  12. #12
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    Thanks June, as for the record source, great catch, I had overlooked it when I copied my SQL from another test page originally. changed to a simpler version. I swear I did try your method and could not get it to work but changed my SQL to reflect yours and now see my error and thanks to you and all the members here I learned something new again. sometimes I can get so frustrated with trying to learn on my own before asking for help that when I do ask for help I don't see the obvious. make sense? I do remember something about what micron was talking about with the syntax, is that just an option or maybe when referring in VBA?

  13. #13
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The complete reference path should also work, but why bother if simpler does it. It would be necessary if the controls weren't on same form. Same applies to referencing within VBA.
    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.

  14. #14
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,368
    Quote Originally Posted by vicsaccess View Post
    Micron, i do remember reading something in the past about having to change the syntax reference to something like you stated but honestly at the time i didn't think i would need it and now i can't find it. do you know of any referance material that explains tab controls a little better?
    Best suggestion would be to just Google "ms access tab control" and pick a few to look at. I can't recommend anything specific, mainly because you would have to decide for yourself which result suits your level of need or expertise. While you're at it, I recommend you check "ms access form subform load order" to ensure you understand the sequence of events before you pull your hair out trying to reference something that isn't loaded yet (in the future). June7's solution was the best, since I took from your OP that the combos were on the tab control, not the sub form. Some other things I'd recommend after looking at your db:
    1) you should learn the importance of naming database objects and adopt a consistent naming convention -
    https://support.office.com/en-nz/art...7-c3632910068b
    http://access.mvps.org/access/general/gen0012.htm

    2) if you use the form wizard to create a form or report that's fine. I always go into design and rename the controls to avoid issues of ambiguity. Sometimes Access falters deciding if LocID (for example) is a field or control reference. Plus, Combo33 doesn't help much when you're looking at a query design or code window.

    3) in case your last post is asking me for form/subform referencing, see the attached. In this case, it would not be of use, but you may need it later.
    subFormRef.txt

    4) Don't know if you ever tried to open your subform directly, but doing that may have made you realize there was something wrong with the recordsource (i.e. the sources were the same for form and subform). When trouble shooting, test your objects and queries independantly to see if they work. Note that for a query that references a form control, the form has to be open in form view.

    That's all I can think of. Good Luck!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-06-2015, 06:50 AM
  2. Single Control Button for multiple Combo Boxes
    By kingofthekassel in forum Programming
    Replies: 5
    Last Post: 08-05-2015, 02:06 PM
  3. Replies: 11
    Last Post: 08-06-2014, 09:47 AM
  4. Combo Box to Update Tabbed Information ona Form
    By JessicaNicole in forum Access
    Replies: 3
    Last Post: 08-30-2012, 01:56 PM
  5. Replies: 12
    Last Post: 12-13-2011, 04:04 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