• Should be simple form (2000 SR1)

    Author
    Topic
    #371109

    This should be so simple but I am wondering if anyone can point me in the right direction to find an example of the code needed to: create a form where the user sets a beginning and ending date using the calendar control and these dates are set to a query and report, so when they set the dates, they can then preview or print the report. Thanks!

    Viewing 0 reply threads
    Author
    Replies
    • #589013

      Form (MyForm):
      Textbox: txtStartDate
      Textbox: txtEndDate
      Command Button: btnOpenReport (OnClick – DoCmd.OpenReport “MyReport”, acViewPreview)
      Command Button: btnExit (OnClick – DoCmd.Close acForm, “MyForm”)
      Calendar Control

      Query (MyQuery):
      fldDate: (Criteria: Between [Forms]![MyForm]![txtStartDate] And [Forms]![MyForm]![txtEndDate])
      (Any other data needed in the report)

      Report (MyReport):
      RecordSource = MyQuery

      HTH thumbup

      • #589027

        Works beautifully, thanks Mark!

      • #589355

        It’s amazing how things like this work. Today, I was planning on asking EXACT same question that was posed yesterday! This solution is EXACTLY what I needed! grin

    Viewing 0 reply threads
    Reply To: Should be simple form (2000 SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: