Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Kenton, Delaware, USA
    Thanked 0 Times in 0 Posts

    Report Variables (2000)

    I hope this post is not to involved to handle in this forum. Here is what I want to do. Have a user open a pop-up form, have the user enter the Report Title then the beginning and ending dates of the Report. The entered data would then enter a title on the report and set the criteria for the date ranges for the query that is driving/feeding the report. The way I am handling it now is to have the report write to a table use the table to supply the title to the report (when the form opens it deletes the old titlle from the table and is ready for a new one). Then the query asks for the dates. This works ok but if I can learn how to do it right, well then I can add more criteria for the user to choose from. I only have a minimum knowledge of VBA.

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 41 Times in 40 Posts

    Re: Report Variables (2000)

    >>I hope this post is not to involved to handle in this forum. <<

    Nope. It can be done fairly easily with minimal VBA. You of course need 3 text boxes on your form, let's call them txtTitle, txtBeginDate, and txtEndDate. If you use the wizard to create a button on the form to open a report, you will notice that there is a strCriteria field. You will need a little VBA code to fill that. I'll use "datefield" to denote the fieldname in your table containing the dates you want to look at. YOu need a line of code that is like this:

    strCriteria = buildcriteria("datefield",dbdate, _
    "between " & txtbegindate & " and " & txtenddate)

    In your report, you need 3 textboxes. Put them in either Page Header to appear once on every page, or Report Header to appear once. The control sources will reference the controls for your frontend form. So, you can have a txtTitle control on report whose control source is:

    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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