• Open Report Code Issue

    Author
    Topic
    #467130

    I am trying to write the code that will open a report and make one field in the supporting query Not Null and another field Null.

    Below is my attempt that does not work. Can someone help?

    DoCmd.OpenReport “rptApplicationDataAll”, acViewPreview, , “Applydate Is Not Null” And “Appwithdrawal is Null”

    Thanks.

    Paul

    Viewing 1 reply thread
    Author
    Replies
    • #1211928

      Paul,

      two aspects. First may just be a matter of finding the right words. Do you really mean that you want to set values in a query, or are you trying to limit the records shown on the report, by applying criteria? I’ll assume the latter.

      So, If you are trying to apply a Where clause to the report, then you need an extra comma before your clause. It’s currently in the named filter position.

      Then, you need to get the syntax right. Easiest way is to prepare a Select query using the normal query designer, then copy the part of the SQL Statement that you need. In this case, it is more likely to look something like “([Applydate] Is Not Null) And ([Appwithdrawal] Is Null)”. You will of course need both fields in the recordsource of the report, even if they are not shown in the printed report.

      Hope this helps put you on the right track.

      Regards,

      Jules

    • #1211931

      Thanks. Your code worked.

      Paul

    Viewing 1 reply thread
    Reply To: Open Report Code Issue

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

    Your information: