Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55

    Re-Running a report


    I have created a report with parameters. It is pulling date, location, etc. I am going to need to run the report for several divisions. How can I keep running the report without closing it. Is there a way to refresh so I can add in a new date, location?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Are you trying to get all of the division reports in one report?

  3. #3
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55
    Quote Originally Posted by RuralGuy View Post
    Are you trying to get all of the division reports in one report?
    No, they are separate reports. I do not want to have to close the report and re-open it everytime I run new parameters. I am going to be running data by division and area.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You can automate the opening and closing of the report so I don't think I understand the problem. Are you using a form to provide the parameters?

  5. #5
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55
    Quote Originally Posted by RuralGuy View Post
    You can automate the opening and closing of the report so I don't think I understand the problem. Are you using a form to provide the parameters?
    No, using parameters in the query.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    A query can easily pull its parameters from a form. Have you looked into using a form to automate the process?

  7. #7
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55
    Quote Originally Posted by RuralGuy View Post
    A query can easily pull its parameters from a form. Have you looked into using a form to automate the process?
    I am tried created a form with drop down boxes to run the parameters in the report. I cannot get it to work. I tried using the code below

    First, create a query that will display the fields you wish to show in
    the report.

    Second, create a report, using the query as it's record source, that
    shows the data you wish to display for ALL records.

    Using Clerk_ID and Assigned Clerk field.

    Created a new unbound form.
    Add a combo box that will show the Clerk_ID as well as the
    Assigned Clerk field .
    Set the Combo box's Column Count property to 2.
    Hide the Clerk_ID field by setting the Combo box's ColumnWidth
    property to 0";1"
    Make sure the Combo Box Bound Column is the
    Clerk_ID.
    Name this Combo Box "cboclerks".

    Add a command button to the form.
    Code the button's Click event:
    Me.Visible = False

    Named the form "Form1"

    Go back to the query. As criteria, on the Query's Clerk_ID field
    criteria line write:
    forms!Form1!cboclerks

    Code the Report's Open Event:
    DoCmd.OpenForm "Form1" , , , , , acDialog

    Code the Report's Close event:
    DoCmd.Close acForm, "Form1"

    Run the Report.
    The report will open the form.

    Find the Assigned Clerk in the combo box.
    Click the command button.

    I am still trying to get this to work.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would simply set the RecordSource of your report to your query. Then run the report from the form, either from a button or the AfterUpdate event of the ComboBox. Use the acDialog argument of the OpenReport command to stop the form code until the report is closed.

  9. #9
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55
    Quote Originally Posted by RuralGuy View Post
    I would simply set the RecordSource of your report to your query. Then run the report from the form, either from a button or the AfterUpdate event of the ComboBox. Use the acDialog argument of the OpenReport command to stop the form code until the report is closed.
    Thank you for all your help. If I create a comman button on the form to preview the report should I use the code below.

    DoCmd.OpenReport Forms!frmOpt.Form!RunName.Caption, acViewPreview.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    DoCmd.OpenReport "ReportName", acViewPreview, , , acDialog
    Do you think that Forms!frmOpt.Form!RunName.Caption points to a ReportName?

  11. #11
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55
    No, Sorry copied script. I meant to change it.

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Where does that leave us? Have you got it working yet?

  13. #13
    Alaska1 is offline Advanced Beginner
    Windows Vista Access 2003
    Join Date
    Oct 2010
    Posts
    55
    Quote Originally Posted by RuralGuy View Post
    Where does that leave us? Have you got it working yet?
    I am going to try it later. Thank you for all your help. I will try it this way.

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I'll be around.

  15. #15
    Randy is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Jun 2010
    Posts
    48
    I'm having a similar problem. I have a report that uses a query to get its data and I have a form setup to enter the data (paramaters for the query) with a button that runs a macro that opens the report. The strange thing is, I have another report setup like this that runs fine but the new report only previews an empty report.

    Are you aware of an example on the internet that I could take a look at. I've studied my working report to death but can not figure what is wrong.

    Thank you,
    Randy

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

Similar Threads

  1. Query with a running sum
    By is49460 in forum Queries
    Replies: 3
    Last Post: 09-07-2013, 11:11 PM
  2. Running Cmd problem
    By timpepu in forum Programming
    Replies: 3
    Last Post: 04-09-2010, 10:04 AM
  3. Report with Running Sum by week
    By jbarrum in forum Access
    Replies: 2
    Last Post: 01-20-2010, 01:38 PM
  4. Running counts column
    By diane802 in forum Reports
    Replies: 1
    Last Post: 01-14-2010, 06:12 PM
  5. Replies: 1
    Last Post: 04-06-2009, 12:05 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