Results 1 to 3 of 3
  1. #1
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72

    Pass in parameter rather than having it in a dialog box?

    I have a report with two parameters that are asked for when the report is loaded. Under some circumstances I would like to run this report (via VBA) and set the parameters programatically. Is this possible? At the moment I work around this by having two identical reports one with the parameters and one without, but what I would like to do is just have one report.

  2. #2
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    What you want to do can be done with VBA code. What I normally do is to have a form where the user enters the parameters and then the code behind a button on the form executes the code to open the report based on those parameters entered or not.

    I assume that the recordsources for the 2 reports are queries that differ only in the WHERE clause. Can you post the SQL text of those two queries? Can you also provide more detail on the fields that are tied to the parameters (datatype etc.)?

  3. #3
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72
    Quote Originally Posted by jzwp11 View Post
    What you want to do can be done with VBA code. What I normally do is to have a form where the user enters the parameters and then the code behind a button on the form executes the code to open the report based on those parameters entered or not.

    I assume that the recordsources for the 2 reports are queries that differ only in the WHERE clause. Can you post the SQL text of those two queries? Can you also provide more detail on the fields that are tied to the parameters (datatype etc.)?
    Since writing my post I am adopting this approach but I am running into problems, please see my other posts for details, thanks.

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

Similar Threads

  1. Pass image parameter to stored procedure
    By Kencao in forum Programming
    Replies: 3
    Last Post: 04-28-2010, 11:51 PM
  2. Pop-up Dialog Box
    By DianeG in forum Reports
    Replies: 4
    Last Post: 03-29-2010, 09:51 AM
  3. Unwanted Dialog Box
    By ntallman in forum Programming
    Replies: 3
    Last Post: 03-26-2010, 11:11 AM
  4. Pass list as parameter to in operator
    By bliever in forum Queries
    Replies: 5
    Last Post: 11-11-2009, 03:15 AM
  5. Pass a Parameter From a form to a Query
    By DDillesha in forum Forms
    Replies: 1
    Last Post: 10-28-2009, 12:49 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