Results 1 to 4 of 4

Thread: where condition

  1. #1
    Lounger
    Join Date
    Apr 2010
    Location
    Sofia
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I want to open a report where the field "turndown" = True but i cannot make
    it.I have tried the following:
    Dim stDocName As String
    stDocName = "rptVisits"
    DoCmd.OpenReport stDocName, acPreview, , Where Reports!rptVisits!TurnDown =
    True

    But i receive errors.Can you help me ?

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    The "Where" in your filter should not be there, and the filter needs to be treated as a string. See the OpenReport in VBA help for details and an example.
    Wendell

  3. #3
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    So your Call to the Where bit on the OpenReport action ought to be

    DoCmd.OpenReport stDocName, acPreview, , "[TurnDown]=True"
    Andrew

  4. #4
    Lounger
    Join Date
    Apr 2010
    Location
    Sofia
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you !!

Posting Permissions

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