Open a specific report from a drop down box (not based on any criteria)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Melody Rivera
    New Member
    • Jan 2011
    • 2

    #1

    Open a specific report from a drop down box (not based on any criteria)

    I want to create a drop down box that allows the user to open a specific report.

    I want to list only certain reports and to list them by a user friendly name (not the back end naming convention that is not meaningful to the user).

    These reports are already written and run on a query that is already written, the user is not running the report based on criteria just opening the report, preferably in report view not print preview.

    Any feedback is appreciated.
  • Lysander
    Recognized Expert Contributor
    • Apr 2007
    • 344

    #2
    A simple solution, not the most elegant, but it should work.

    Create a table with two fields, rptName and rptDesc, where rptDesc is the friendly name you want to display.

    Poplualte the table with the reports you want the user to open.

    Base a combo box on this table with two columns, rptName and Desc and make the 1st column 0 width.

    This combo box, say, cboRpt, will show the friendly names

    On the after update event of cboRpt

    docmd.openrepor t cboRpt, acPreview,,,acD ialog

    (I probably have the commas in the wrong place, but you get the idea.

    Comment

    • Lysander
      Recognized Expert Contributor
      • Apr 2007
      • 344

      #3
      oops, missed the bit about not printpreview. Just use whatever option you want.

      Comment

      • Melody Rivera
        New Member
        • Jan 2011
        • 2

        #4
        Fantastic! Works perfectly. I spent the whole day yesterday trying to get this to work properly. Thank you so very much.

        I did update it as follows to open the Report View:

        Private Sub cboRpt_AfterUpd ate()
        DoCmd.OpenRepor t cboRpt, acViewReport, , , acDialog
        End Sub

        Comment

        • Lysander
          Recognized Expert Contributor
          • Apr 2007
          • 344

          #5
          You are most welcome. That's what the group are here for, to solve each other's problems:)

          Comment

          Working...