Results 1 to 3 of 3
  1. #1
    frksdf is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    12

    Runing a report from combobox


    Hi All;
    My question is really simple for the experted user rahter than dummies like me.
    I have three reports
    • REPORT1
    • REPORT2
    • REPORT3
    And i create a form with a combobox. You can see the list of the reports in the combobox's drop-down list. Also this form has a button.
    I want to select a report name from combobox and click the button to run the report.
    I couldn't find a suitable code. Could you please show me a code and which module type i will insert in, class or standart module?

    Thank you very much.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Code goes in the Click event of button or eliminate the button and use AfterUpdate event of the combobox.

    DoCmd.OpenReport "[" & comboboxname & "]"

    This will send report straight to printer (the default action). Check out the other arguments of the OpenReport method in VBA Help.
    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
    TinaCa is offline Advanced Beginner
    Windows Vista Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    87
    You may need to delete any code the combo box created. sometimes when you create the combo box will create a macro, so check the properties under the Event tab and delete the macro from the- probably- on change, or on click event. Then put the code above - in the afterupdate event.

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

Similar Threads

  1. Runing a quey in the back end?
    By jbr87 in forum Access
    Replies: 7
    Last Post: 07-25-2011, 08:30 AM
  2. Report Filter by ComboBox
    By Piddy in forum Reports
    Replies: 1
    Last Post: 05-11-2011, 04:56 PM
  3. Runing Moduels from Macro's - Access 2003
    By damo1995 in forum Access
    Replies: 7
    Last Post: 02-10-2011, 03:40 AM
  4. Combobox to filter report
    By Sharkun in forum Reports
    Replies: 25
    Last Post: 02-03-2011, 05:05 PM
  5. combobox on report?
    By RedGoneWILD in forum Reports
    Replies: 3
    Last Post: 07-08-2010, 11:22 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