Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    tazzzz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2015
    Location
    USA
    Posts
    37

    Combobox in Navigation Form

    Hello all,


    I have a Navigation Form with multiple subforms(tabs). Each subform has a combobox that allows me to view data for a specific piece_number. I would like to eliminate all this comboboxes from tabs and use only one combobox in Navigation Form that will allow me to see data (when I select a tab) for the value selected in main combobox.
    Any advice to achieve this is greatly appreciated.
    Thanks.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    On the ON CHANGE event of the tab,
    change the query / form in the sub form depending on the tab page clicked.
    The combo box can further filter the records in the subform.

    Code:
    Private Sub Tab1_Change()
    Select Case Tab1.Value
      Case 1  'grades
         chd.SourceObject = "frmGrades
        
      Case 2  'students
       chd.SourceObject = "Query.qsStudentList"
      
      Case 3   'Classes
          chd.sourceobject = "frmClasses"
    End Select
    End Sub

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    I don't like and don't use Navigation Form.

    I also don't like and don't use dynamic parameterized queries.

    However, a dynamic parameterized query for each subform might be the simplest approach when using Navigation Form.
    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.

  4. #4
    tazzzz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2015
    Location
    USA
    Posts
    37
    One of my Tab properties shows only "On Selection Change''; "On Data Change" and "On Data Set Change". Which one should I choose?
    Also, What is Tab1? For each tab should be only one case?
    Thank you

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Possibly ranman was thinking of a Tab control. I don't think suggested code will work with Navigation Form.

    I see those events on the main Navigation Form, not on the 'tab'.
    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.

  6. #6
    tazzzz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2015
    Location
    USA
    Posts
    37
    So you think there is no way to select data in tabs based on a combobox in Navigation Form?
    If I keep the comboboxes in tabs is there a way to make them show the same data as the combobox in Nav Form? Basically, selecting something in "main"combobox will make the other to show the same thing?

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    I already suggest one possible approach in post 3. Dynamic parameterized queries would refer to the combobox as filter parameter.
    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.

  8. #8
    tazzzz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2015
    Location
    USA
    Posts
    37
    Parameter query and dynamic parameterized query are different? I am familiar with the first one but I don't know anything about the second one.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Dynamic means the parameter is not static, it is provided by user input. The user input can be from a popup within the query (do not recommend this) or by reference to a control on form.

    Not dynamic:

    WHERE FiscalYear = 2015

    Dynamic with popup:

    WHERE FiscalYear = [enter year]

    Dynamic with control reference:

    WHERE FiscalYear = Forms!MyForm!cbxYear
    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
    tazzzz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2015
    Location
    USA
    Posts
    37
    Ok, thanks for explanations. I have been using all the time dynamic parameter queries without knowing the real name. To call the combobox from the query should I use this: [Forms]![MyNavigationFormName]![Combobox]?

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    That looks good. Try it.

    As I said, don't use Navigation Form. I am not sure if code will be required to requery/refresh the subform after selection in combobox.
    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
    tazzzz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2015
    Location
    USA
    Posts
    37
    I will let you know how is working. Thanks for the help.

  13. #13
    tazzzz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2015
    Location
    USA
    Posts
    37
    [Forms]![MyNavigationFormName]![Combobox] is not working. Is there another syntax to refer to a combo from main Navigation form?
    I can make it work from subforms but not from main Navigation form.

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    What do you mean by 'not working', what happens - error message, wrong results, nothing?

    AFAIK, that is correct syntax. But I've never used Navigation form.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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
    tazzzz is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2015
    Location
    USA
    Posts
    37
    I mean the query will not populate with data when using combo from main Navigation Form. Using combo from subforms works nice without problems. I thought perhaps something is missing on my syntax.

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

Similar Threads

  1. Replies: 8
    Last Post: 09-14-2015, 09:38 PM
  2. Replies: 2
    Last Post: 08-10-2015, 06:47 AM
  3. Replies: 5
    Last Post: 03-02-2015, 02:14 PM
  4. Replies: 1
    Last Post: 11-05-2013, 10:09 PM
  5. Replies: 11
    Last Post: 09-16-2011, 11:47 AM

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