Results 1 to 5 of 5
  1. #1
    Dan Kenton is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    12

    Parameter Query - No Null Record Msg

    I've designed a form based on a parameter query that works nicely however I've discovered that if a user enters a response that is not contained in the control source, Access displays a blank datasheet instead of a Null message. How can I get Access to display something telling the user that the data they entered does not exist and returns them back to the parameter box?



    Thanks

  2. #2
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I don't think you can. queries can't do it, I don't think. But you can do that alt. action. And that is, giving your own popup box with a small form object, and validating the input in code. If valid, open the form and change the recordsource to the sql of the query you have now. If not valid, close the form and open it again in code:
    Code:
    if notvalid then
        docmd.close acdataform, me.name
        docmd.openform "formname"

  3. #3
    Dan Kenton is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2011
    Posts
    12
    Thanks AJ, that's what I figured. However, I'm not quite understanding your solution. Where is this code supposed to reside? In a macro? I can't see where a macro has an user-input command.

    Thanks!

  4. #4
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    it's supposed to go behind the form's load event. that's the way I have done it in the past.

  5. #5
    a1061 is offline Novice
    Windows 8 Access 2003
    Join Date
    Feb 2014
    Posts
    1
    I am new to access and I have this exact issue. How did you get it resolved. I see the code that was included but am not sure where this goes and what other code is missing. I did put this in an expression on the on enter form, but it did not work. Any help is greatly appreciated. Thanks!

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

Similar Threads

  1. Replies: 3
    Last Post: 01-15-2011, 02:39 AM
  2. Populating Null data with Next Available Record
    By Kimbertha in forum Queries
    Replies: 5
    Last Post: 10-07-2010, 07:54 PM
  3. Populating Null Data with Next Available Record
    By Kimbertha in forum Programming
    Replies: 6
    Last Post: 09-25-2010, 11:02 AM
  4. bypassing passing parameter when null
    By cowboy in forum Queries
    Replies: 11
    Last Post: 04-14-2010, 09:59 PM
  5. Null vs New Record
    By jversiz in forum Access
    Replies: 2
    Last Post: 02-20-2008, 12:02 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 - Senior Forums