Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to use the code again (Access 2000)

    I have a very long but useful function called Fncmonths which after defining different criteria actually runs down to opening the report rptSalesSites:
    Public Function FncMonths()
    criteria.... not written for the sake of calrity
    strDocName = " rptSalessites"
    DoCmd.OpenReport strDocName, acPreview, , strCriteria
    End Function
    I want to use the same function to open other reports.I tried to put the following
    Public Function FncMonths(StrReportName As Criteria)
    stDocName = " rptSecondSales"
    but then i didnt know how to proceed.
    Could somebody help me with adding the code i miss?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how to use the code again (Access 2000)

    Public Function FncMonths(StrReportName As String)
    strCriteria = .... not written for the sake of calrity
    DoCmd.OpenReport strReportName, acPreview, , strCriteria
    End Function

    When you want to call the report, use :
    FncMonths("rptSecondSales")
    or
    FncMonths("rptSalessites")
    Just put the name of the report in the parentheses with quotes
    Francois

Posting Permissions

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