Results 1 to 5 of 5
  1. #1
    yotamoo is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    7

    Post Printing non-null fields only in MS Access 2003 report

    I am trying to generate a report whose source is a form and that only prints fields that are not null.



    To do so I have two text-boxes for every field. They are both resizealbe (can shrink/grow). The first text-box is for the caption, and its source is


    =IIf([record] Is Null,"","Caption:")

    The second is the record value itself. If record is null then the value of both text-boxes is "" and null and they do not appear nor take any space in the form.
    Two question:

    1. This doesn't seem like the smartest way to do it. Anyone has a better idea?
    2. The report also contains check-boxes, and this method only works if I check/uncheck at least one check-box before I generate the report. Otherwise all captions appear anyway. This is very weird - anyone has any idea why it happens?

    Thanks!

  2. #2
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    1. On top of my head, maybe you can try this with one text box:
    =IIf([record] Is Null,"","Caption:" & vbCrLf & [record])

    2. Unless your checkbox is tristate, otherwise, it is only True(-1) or False(0) normally.

  3. #3
    yotamoo is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    7
    Thanks...
    Problem with 1 is that Access thinks vbCrLf is a source, and therefore require a value when I generate the report. Any way to override it?

  4. #4
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    Try Chr(10) for new line.

    Not sure if this is the best way using string concatenation, it's more of a hack.

  5. #5
    yotamoo is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2013
    Posts
    7
    I'll try it, but in general checking for value and then setting source accordingly is the right way?
    Thanks anyway

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need Grid lines on null fields in report
    By lpkorn423 in forum Reports
    Replies: 1
    Last Post: 12-27-2012, 08:45 AM
  2. Null as Character in MS ACCESS 2003 Queries
    By shanmugamgsn in forum Queries
    Replies: 3
    Last Post: 07-16-2012, 05:27 AM
  3. Export from Access 2003 to Excel 2003 - missing fields
    By Jack Sheet in forum Import/Export Data
    Replies: 1
    Last Post: 02-29-2012, 04:09 PM
  4. Access: Updating Null Fields with values
    By bmaz in forum Queries
    Replies: 2
    Last Post: 10-11-2011, 05:18 PM
  5. Dont show null fields in report
    By senna in forum Reports
    Replies: 4
    Last Post: 03-03-2011, 02:30 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums