Problem with Report Generation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manoj9849967222
    New Member
    • Jul 2007
    • 48

    Problem with Report Generation

    Hi All

    I have a form which has two text box to enter dates & a command button
    now when i click the command button it runs a query and provides me the data between two given dates in the textbox.

    Now i have a report based on query.

    what i want to do is to have a command button on the form, which when clicked should generate a report between two given dates in the textbox.

    Please help

    Regards
    Manoj
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Hi Manoj

    You can add criteria to the Open Report command the same way as you would with the Open Form command. Have a look at the following ...

    [CODE=vb]
    Dim stDocName
    Dim stLinkCriteria

    stDocName = "Report Name"
    stLinkCriteria = "[DateField] BETWEEN #" & Me!DateFrom & "# AND #" & Me!DateTo & "#"

    DoCmd.OpenRepor t stDocName, , , stLinkCriteria
    [/CODE]

    Comment

    Working...