Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Location
    Brisbane, Australia
    Posts
    30

    Red face Unanswered: displaying correct date range...

    Hi,

    I am building a database in access 2000 that looks at phone bill records. To generate a bill I just use a form with criteria on it including the phone number, customer name and start and end date then this is passed to a report that uses a query as it's source.

    The stLinkCriteria of the OpenReport function looks something like this (sorry I don't have exact syntax but am just at work at the moment...)

    stLinkCriteria = "[Customer Name] = '" & Me.CustomerName & "' AND [Unit Number] = '" & Me.UnitNumber & "' AND [date] between # " & Me.StartDate & "# AND " & Me.EndDate

    So, this is all working fine however I need to show these start and end dates on the report that are specified on the form. The closest I can get to it at the moment is by using a =min([date]) and =max([date]) on some text boxes however this doesn't give a true reading as it only shows the date of the first and last call within the specified range from the form.

    Is there a way of showing the actual dates specified in the form and stLinkCriteria on the report?

    Any help would be muchly appreciated.

  2. #2
    Join Date
    Jan 2004
    Location
    Jersey, UK
    Posts
    108
    If the form is open when you run the report then you can reference the textbox values on the form and use them in your report.

    Put some textboxes on your report; these will hold the start and end dates. Now use similar code the example below:

    =Forms!formname!starttextboxname

    =Forms!formname!endtextboxname

    As long as the form that has the textboxes is open, the values from those boxes should appear in your report textboxes.


    Regards - Andy

  3. #3
    Join Date
    Oct 2003
    Location
    Brisbane, Australia
    Posts
    30
    It works! Thanks heaps Andy, your a champ.

    I knew there was a simple solution to this problem and it's been annoying me for a couple of days now so much appreciated man.

    Cheers.

  4. #4
    Join Date
    Jan 2004
    Location
    Jersey, UK
    Posts
    108
    Glad to be of help.

Posting Permissions

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