Results 1 to 8 of 8
  1. #1
    IT_Group is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2012
    Location
    Tulsa OK
    Posts
    4

    Question Create error message for form search results being Null


    I have a form and when it's opened you get 3 different search questions to answer or leave blank. My question is.... If a search parameter is entered but no results are found to match it, how do I create an error message telling the requestor "No Data Found"?

    Thank You.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Something like this maybe

    Code:
    If len(Result & "") = 0 Then
    Msgbox "No data found !"
    End if

  3. #3
    IT_Group is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2012
    Location
    Tulsa OK
    Posts
    4
    Thank you for this info! Would you please tell me where I need to add it to make it work, in the query or form or table?

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    How do you
    If a search parameter is entered
    and how do you start the search?
    How do you test the result of the Search?

  5. #5
    IT_Group is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2012
    Location
    Tulsa OK
    Posts
    4
    A table links to a query and the query links to a form.

    In a query --
    One of the 3 search fields example
    Field: Birthday
    Table: Copy Of Data_Info
    Sort: Ascending
    Show: "blank"
    Criteria: Like [Enter DOB mm/dd/ccyy format] & "*"

    When the form is opened the "Enter Parameter Value" window opens requesting the user "Enter DOB mm/dd/ccyy format" I put in a birthdate and either I see records populate this form or the form comes up with the fields being blank.

  6. #6
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  7. #7
    IT_Group is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2012
    Location
    Tulsa OK
    Posts
    4
    After watching the video I think I maybe going about this the wrong way. It was very helpful and educational.


    Table: Copy of Data_Info defines the name of the table I'm pulling the data from using the query.

    Thank you for all your help!

  8. #8
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    You are welcome. There are many free videos on Datapig---and you can always go back and watch them again.

    I will mark this thread Solved.

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

Similar Threads

  1. Replies: 5
    Last Post: 01-03-2013, 01:38 PM
  2. Replies: 5
    Last Post: 07-13-2012, 01:15 AM
  3. Blank form on null query results
    By JackieEVSC in forum Forms
    Replies: 11
    Last Post: 11-30-2011, 08:39 AM
  4. Replies: 1
    Last Post: 10-24-2010, 04:01 PM
  5. Search Form Results Displayed In Report
    By warrenjburns in forum Forms
    Replies: 1
    Last Post: 03-18-2009, 02:08 AM

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