Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    WhereCondition argument (Access 2000)

    I apply a very interesting and elegant solution to open report, suggested by Hans from the present
    Forum, Post 412635 , using the WhereCondition argument of DoCmd.Openreport :

    DoCmd.OpenReport "NameOfTheReport", acViewPreview, , "Customers.Afid
    = " & Me.Office


    I wanted to apply it in my report rptCalls like that:

    DoCmd.OpenReport "rptCalls", acViewPreview, , "Calls.Afid " = " & Me.Office"

    The report is opened without error, but it is blank, so my WhereCondition argument is not written properly.
    The record source of the report is:

    SELECT Calls.CallID, Calls.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: WhereCondition argument (Access 2000)

    If your field Calls.afid is a text field use :
    <pre>DoCmd.OpenReport "rptCalls", acViewPreview, , "Calls.Afid = '" & Me.Office & "'"</pre>

    If your field Calls.afid is numeric use :
    <pre>DoCmd.OpenReport "rptCalls", acViewPreview, , "Calls.Afid = " & Me.Office</pre>

    Francois

Posting Permissions

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