Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  2. #2
    Star Lounger
    Join Date
    Sep 2002
    Location
    Hastings, Sussex, England
    Posts
    67
    Thanks
    0
    Thanked 1 Time in 1 Post
    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

  3. #3
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. Your code worked.

    Paul

Posting Permissions

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