Results 1 to 12 of 12
  1. #1
    ss6857 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2011
    Posts
    8

    Angry Combobox replace navigation tabs to show report

    Hello, I'm going to try to be as detailed as possible without being confusing! I am using the latest version of Access. What I am trying to do is create a form that lists all the reports that I have made. When the user selects the report he wants, it previews the report. Then there will be checkboxes of options such as, convert to excel, convert to pdf, print, email, etc...



    But I am having trouble connecting the combobox and the subform..

    In the original navigation form I chose (the ones with tabs), if I click and drag or type in a report name to the tabs it would preview the report on the subform. But because I have so many reports, having all those tabs would look busy and be less user friendly. So, what I want is if I click on a report in the combobox, I would like it to preview, but I can't seem to make that connection between the combobox and the subform/subreport.

    Right now, the Link Master Fields is Child36 (the name of my subform) and the Link Child Fields is MSysObjects.Name. (this is when I click on my subform)
    For my combobox my rowsourcetype is table/query and my rowsource is SELECT MSysObjects.Name FROM MsysObjects WHERE (Left$([Name],1)<>"~") And (MSysObjects.Type)=-32764 ORDER BY MSysObjects.Name;

    Any suggestions? Thanks for any and all help!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If I'm understanding correctly, you can set the subform's source object property to the name of the report in the combo (in other words you'd use a single subform).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ss6857 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2011
    Posts
    8
    I can't do that.. for example if I have two reports (Apples and Oranges) and I set the source object of the subform to Report.Apples it will only show the Apples report, no matter what report name I choose in the combo box. I want the report showing to change according to the report name chosen in the combo box

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You misunderstand me. I mean you set it in code after the user makes a selection in the combo. That way it changes to whatever report they've selected.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ss6857 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2011
    Posts
    8
    Ok.. Now I understand. Now I'm having trouble with my code!

    So Far I have..
    Private Sub Child36_Enter()
    Dim rn As String
    rn = (Combo7.Value) 'This is showing that rn=2, not rn=Oranges
    Me.Child36.SourceObject = Report.rn 'This is just showing Me.Child36.SourceObject = ""
    End Sub

    I did have Combo7.Text, but then it was showing that rn = ""

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That's odd since the only column you have in the combo is the name (I thought about the parentheses forcing a boolean result, but that wouldn't be 2). For clarity, in case it's confused about objects, try

    rn = Forms!FormName.Combo7.Value
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    ss6857 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2011
    Posts
    8
    nothing changed.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    ss6857 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2011
    Posts
    8
    I made some leeway. I took my code and put in under the combo box under "on click." It is now reading that rn = "Apples" but it still reads the child36 as "".

    Private Sub Combo7_Click()
    Dim rn As String
    rn = Me.Combo7.Text
    Me.Child36.SourceObject = Report.rn
    End Sub

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    This should simply be:

    Me.Child36.SourceObject = rn
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    ss6857 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2011
    Posts
    8
    Private Sub Combo7_Change()
    Dim rn As String
    rn = "Report." & Me.Combo7.Text
    Me.Child36.SourceObject = rn
    End Sub

    Thank you so much for all your patience and help in figuring this out!!

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It's working? I wouldn't have thought the "Report" part necessary, but I've never tried to put a report into a subform.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Combobox to show two field values
    By lnordstrom in forum Forms
    Replies: 2
    Last Post: 03-30-2011, 12:33 PM
  2. show subform depending on combobox
    By d_Rana_b in forum Programming
    Replies: 2
    Last Post: 03-15-2011, 05:09 AM
  3. Replies: 2
    Last Post: 01-15-2011, 10:56 AM
  4. Find and replace tabs from data
    By mentose457 in forum Access
    Replies: 9
    Last Post: 12-06-2010, 09:11 AM
  5. export report to multiple tabs
    By mws5872 in forum Import/Export Data
    Replies: 0
    Last Post: 06-30-2009, 03:07 PM

Tags for this Thread

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