Results 1 to 6 of 6
  1. #1
    Bear is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2011
    Location
    North Carolina
    Posts
    31

    Looking for a VBA code/expression

    Is there a way to tell a query not to print when a record has no data? (blank/no text)

    I am sure I have seen this somewhere but I can't seem to find it right now.

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    What do you mean by "not to print"? A little more info would be helpful. What is the context of the issue?

  3. #3
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    If you're using a report, you can use the report's event (I think it's called):

    'On No Data' or something like that.

  4. #4
    Bear is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2011
    Location
    North Carolina
    Posts
    31
    Quote Originally Posted by TheShabz View Post
    A little more info would be helpful.
    The final product will be a report but I would like to clear up the problem in the query that the report is based upon so that I can create another report in the future (based upon this query) and have the problem already solved.

    The query has several empty (blank/no text) records. I would prefer that the query skip (not print) these and go on to the next record. This would, in turn, cause the report(s) to not have blank areas.

    All I can find in "help" is how to cancel printing when records are blank. I don't want the printing to stop. I just want to skip these blank records and continue printing the records that are not blank.

    I am thinking that something like "NoData NEXT" would do it but I am sure that this is not the proper syntax.
    Last edited by Bear; 08-04-2011 at 12:45 PM. Reason: add info

  5. #5
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,443
    put this

    NOT ISNULL

    in the criteria of your query. It will only report items that have data.

  6. #6
    Bear is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2011
    Location
    North Carolina
    Posts
    31
    Quote Originally Posted by rpeare View Post
    put this

    NOT ISNULL

    in the criteria of your query. It will only report items that have data.
    You know what? My first thought was, "No, it couldn't be that simple!" but I tried it anyway.

    IT WORKS PERFECTLY!!!

    You sure saved my fata__!

    Thank you so much.

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

Similar Threads

  1. Looking for help with an expression
    By CoachBarker in forum Queries
    Replies: 3
    Last Post: 11-25-2010, 05:17 AM
  2. Word code in Access - How to modify my current code
    By Alexandre Cote in forum Programming
    Replies: 0
    Last Post: 11-15-2010, 08:26 AM
  3. Code in combobox, code in text box
    By float in forum Forms
    Replies: 3
    Last Post: 09-29-2010, 07:12 AM
  4. Expression value
    By KWarzala in forum Reports
    Replies: 0
    Last Post: 06-15-2010, 12:35 PM
  5. Help With an expression
    By kylem4711 in forum Queries
    Replies: 2
    Last Post: 04-23-2009, 01:57 PM

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