Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Posts
    7

    Unanswered: help with parameters

    I am designing a report based on a query. I would like to have a couple of boxes come up and ask for certain data. (ex. Begin Date and End Date). I'm not sure what you call these boxes so I can not find it within "Help". I'm sure this is simple. Can anyone help me
    Thanks,
    Jr.

    PS I would also like a box to come up and ask for input on "Month". This will not be used for search critera but used to put the month on the report. I dont want to use the computer clock for this because I will be running the report about a month behind the current date.
    Thanks

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    The easiest method of dealing with multiple parameters is using a "parameter form". It's just a form with a textbox for all the parameters you want to use, then you can reference the values on the form with forms!yourForm!yourControl
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136
    I am new to Access but I have made several "parameter forms" exactly how Teddy mention above. I don't know if you're new to access or not but if you need step by step instructions on how to do this . . . . . read on.

    It looks like you already have the query setup for your report. You can start by creating your parameter form. Create a form that is not bound to any table or query. On the form place two unbound text boxes. One for the Begin Date and one for the End Date. Make sure you name each text box (first field in the "All" tab of the properties box - you'll need to reference this control name in your query).

    Then open your query that your report is based on and locate the Begin Date field. In the criteria line enter:

    [forms]![yourParameterFormName]![yourBeginDateControlName]

    Since the parameter is for a date, you probably want to enter >= in front of the above statement like this:

    >=[forms]![yourParameterFormName]![yourBeginDateControlName]

    Same idea for your End Date field in the criteria line of the query:

    <=[forms]![yourParameterFormName]![yourEndDateControlName]

    If you notice, the End Date has <= as oposed to >= for the Begin Date.

    I believe you mentioned something about wanting the Month to display on the report. You can add an unbound text box to the parameter form and name it Month. Then in your report you can add an unbound text box and in the Control Source in the properties box you can reference the parameter form and the control name for the month.

    Something like this:

    =[forms]![yourParameterFormName]![yourMonthControlName]

    Or you could have the date range appear on your report instead of the month or even both if you want. It's all up to you.

    I hope this helps and I hope I didn't make any errors in the instructions.
    Last edited by Zenaida; 11-29-05 at 16:46.

  4. #4
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    And here's something I put together that may give you some ideas about making time periods and other criteria dynamic.

    The free downloadable sample database at www.bullschmidt.com/access uses the query by form concept so that on the invoices dialog one can optionally choose a rep, a customer, and perhaps a date range, click on a button that says "Input," and then have the invoice form open up showing all the invoices that match the criteria.
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •