Results 1 to 3 of 3

Thread: Creating Report

  1. #1
    Join Date
    Sep 2003
    Location
    Raleigh, NC
    Posts
    183

    Unanswered: Creating Report

    I have table with some date field. I would like to create report that would only give me a data from which the date is expiring within next 3 months. Andbody knows how to do this ?


    Thanks in advance!
    Skharva

  2. #2
    Join Date
    Sep 2003
    Posts
    17

    Re: Creating Report

    Originally posted by Skharva
    I have table with some date field. I would like to create report that would only give me a data from which the date is expiring within next 3 months. Andbody knows how to do this ?


    Thanks in advance!
    You can change the source data of report in run time

    sample:
    strSQL="select ........."
    Docmd.echo false
    docmd.openreport "rptYourReport",acViewDesign
    with repots("rptYourRepot")
    .visible=false
    .recodesource=strSQL
    end with

    docmd.openreport "rptYourReport",acViewPreview
    docmd.echo true

  3. #3
    Join Date
    Sep 2003
    Location
    Raleigh, NC
    Posts
    183

    Re: Creating Report

    I'm very new to VBA. Can you tell me how to calculate date field ? For example i have field name "Exp.Date" and i want to create report that will give me all the data that has Exp.Date within next 3 months. I have copy my query below but i think its worng


    SELECT tblSiteInformation.SiteNo, tblSiteNo.SiteName, tblIRBInformation.IRBNo, tblIRBInformation.IRBName, tblIRBReviews.ApprovalDate, tblIRBReviews.ExpirationDate, Format([ExpirationDate]) AS Exp
    FROM tblSiteNo INNER JOIN (tblSiteInformation INNER JOIN (tblIRBInformation INNER JOIN tblIRBReviews ON tblIRBInformation.IRBID = tblIRBReviews.IRBID) ON tblSiteInformation.SiteID = tblIRBInformation.SiteID) ON tblSiteNo.SiteNo = tblSiteInformation.SiteNo
    WHERE (((Format([ExpirationDate]))="=ExpirationDate - Now()"));




    Originally posted by luohualiushui
    You can change the source data of report in run time

    sample:
    strSQL="select ........."
    Docmd.echo false
    docmd.openreport "rptYourReport",acViewDesign
    with repots("rptYourRepot")
    .visible=false
    .recodesource=strSQL
    end with

    docmd.openreport "rptYourReport",acViewPreview
    docmd.echo true
    Skharva

Posting Permissions

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