Results 1 to 4 of 4
  1. #1
    chris17 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    13

    Trap Errors


    I have a search text box, how can i create a message box to tell the user that entries in the text box does not match any record in the table.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I'd suggest looking at the DCount function.
    If Dcount(..) = 0 Then
    Msgbox "No such record"
    else
    '''''whatever you want to do with found records''''
    end if
    see http://www.techonthenet.com/access/f...ain/dcount.php

    If you are using a search/find function, you could use the NoMatch


    from allen browne's site
    Code:
      rs.FindFirst "City = ""New York"""  
    If Not rs.NoMatch Then        
     'It's okay to keep processing.
    End If

  3. #3
    chris17 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    13
    what should be in (..) in the Dcount

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    You're going to have to tell us more of the table , the text box and the search.

    I have a search text box, how can i create a message box to tell the user that entries in the text box does not match any record in the table.
    Did you look at the examples at
    http://www.techonthenet.com/access/f...ain/dcount.php

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

Similar Threads

  1. Trap Error 2476 Code
    By burrina in forum Forms
    Replies: 1
    Last Post: 01-18-2013, 11:56 AM
  2. Replies: 10
    Last Post: 07-25-2011, 12:07 PM
  3. Building a better mouse trap :)
    By ldodge in forum Access
    Replies: 29
    Last Post: 06-30-2011, 08:15 AM
  4. trying to trap a redundancy
    By jreed72 in forum Access
    Replies: 7
    Last Post: 11-07-2010, 10:43 PM
  5. Using variables to trap write conflicts
    By ajetrumpet in forum Programming
    Replies: 2
    Last Post: 09-07-2010, 12:54 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