Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Record Not Found (cont.)
Mark Kaply 
       
4 years ago
Here is the screen shot of my code for my previous post...
Mark Kaply OP  @Reply  
       
4 years ago

Mark Kaply OP  @Reply  
       
4 years ago

Richard Rost  @Reply  
           
4 years ago
You'd want to check if RoadName is NULL at that point, or better yet, check to see if the ID for that record is null.

If IsNull(CustomerID) then...
Mark Kaply OP  @Reply  
       
4 years ago
Thanks for responding so quickly. Unfortunately I've tried every iteration of the code that I  can think of...
If IsNull(TblID) Then ... BEFORE the Me.Filter = True   statement and after,  and I tried If IsNull(Roadname) Then ...
in different places within the FindRoadBtn subroutine but the result is always the same if the entered Filter value or character string is NOT in my database, and my form completely goes blank but is set to a "Filtered" state, and I have to click on the 'Toggle Filter' button to "reset" my Form. I would like to be able to tell the user that they searched on a value that is NOT in the database
Mark Kaply OP  @Reply  
       
4 years ago
and AUTOMATICALLY RESET the Form Filter (Me.Filter = False).
Kevin Robertson  @Reply  
          
4 years ago
Richard Rost  @Reply  
           
4 years ago
Yeah, that's the best bet. Like Kevin said, perform a DLookup to check if that value is in there.
Mark Kaply OP  @Reply  
       
4 years ago
Gentlemen, once again, THANK YOU. However I found a much simpler solution to my problem (in my opinion since I am a novice at this) which did not involve the use of either the NZ nor the DLookup...  (See my code below...)
Private Sub FindRoadBtn_Click()

    Dim RdNam As String
    
    RdNam = InputBox("Please Enter All or Part of the Road Name:", "Search For Road Name", RoadName)
    
    If RdNam = "" Then
        MsgBox "The Road name you entered was NOT FOUND !", vbInformation, "Record Not Found"
        Exit Sub
    End If
        
    Me.Filter = "RoadName LIKE """ & RdNam & "*"""
    Me.FilterOn = True
    
    If Me.Recordset.RecordCount = 0 Then
        MsgBox "The Road name you entered was NOT FOUND !", vbInformation, "Record Not Found"
        Me.FilterOn = False
        Exit Sub
    End If
          
End Sub

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/1/2026 9:53:40 PM. PLT: 0s