Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2004
    Location
    Lorain, OH
    Posts
    11

    Unanswered: DoCmd.OpenReport Syntax

    Is this a valid syntax for the DoCmd.OpenReport Command? I am most interested in the SQL Where clause.


    strDocName = "WeeklyPullsReport"
    DoCmd.OpenReport strDocName, acViewNormal, , "[Date] BETWEEN [Forms]![EmployeePullsDialogBox]![StartingDate] AND [Forms]![EmployeePullsDialogBox]![StartingDate]"

    Thanks.

    Vincent DeLuca
    VDeluca7@aol.com

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Vincent DeLuca
    Is this a valid syntax for the DoCmd.OpenReport Command? I am most interested in the SQL Where clause.


    strDocName = "WeeklyPullsReport"
    DoCmd.OpenReport strDocName, acViewNormal, , "[Date] BETWEEN [Forms]![EmployeePullsDialogBox]![StartingDate] AND [Forms]![EmployeePullsDialogBox]![StartingDate]"

    Thanks.

    Vincent DeLuca
    VDeluca7@aol.com
    No. Well almost ... Date literals need to be surrounded by # signs ... So:

    ... "[Date] BETWEEN #" & [Forms]![EmployeePullsDialogBox]![StartingDate] & "# AND #" & [Forms]![EmployeePullsDialogBox]![StartingDate] & "#"
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jul 2004
    Location
    Lorain, OH
    Posts
    11

    Unhappy Still not working

    Thank you for the input--it makes sense. However, it still is not working. Here is the current code:

    strDocName = "WeeklyPullsReport"
    DoCmd.OpenReport strDocName, acViewPreview, , "[Date] BETWEEN #" & [Forms]![EmployeePullsDialogBox]![StartingDate] & "# AND #" & [Forms]![EmployeePullsDialogBox]![EndingDate] & "#"

    Still same result--request for parameter values.

    Thanks in advance.

    Vincent DeLuca
    VDeluca7@aol.com

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    When you open this report is your Form EmployeePullsDialogBox also opened or loaded?

  5. #5
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by hammbakka
    When you open this report is your Form EmployeePullsDialogBox also opened or loaded?
    We do have to check for the obvious now don't we????
    Back to Access ... ADO is not the way to go for speed ...

  6. #6
    Join Date
    Jul 2004
    Location
    Lorain, OH
    Posts
    11
    Quote Originally Posted by hammbakka
    When you open this report is your Form EmployeePullsDialogBox also opened or loaded?
    Yep, it is. EmployeePullsDialogBox stays open, with the StartingDate and the EndingDate values still available, the whole time and even after the report is closed.

  7. #7
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Try
    DoCmd.OpenReport strDocName, acViewPreview, , "[Date] BETWEEN #" & CDate([Forms]![EmployeePullsDialogBox]![StartingDate]) & "# AND #" & CDate([Forms]![EmployeePullsDialogBox]![EndingDate]) & "#"

Posting Permissions

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