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 
Filter
Alan Higgins 
      
3 years ago
I have a form where I utilize text boxes to search in the lastname and firstName field. When trying to look up every name that starts with an A i get every name that contains an A. Is there a way to set the criteria to only look at the first letter in the Name field?
Like "*" & [Forms]![VeteransDetailsF]![LastNametxt] & "*" Or Is Null
Alex Hedley  @Reply  
           
3 years ago
Like [Forms]![VeteransDetailsF]![LastNametxt] & "*" Or Is Null
Alex Hedley  @Reply  
           
3 years ago
Example: if you were to type a letter (e.g. "A") in your search box you'd want the criteria to the become A* not *A*
Scott Axton  @Reply  
        
3 years ago
Alan Higgins OP  @Reply  
      
3 years ago
Thank you, the videos were very helpful however i didn't get my answer. I am trying to set my criteria so when i search the last name text box for example a "B" i need it to return all last names that start with a B. What i get is every name that contains a B.
Thank you all for responding, much appreciated.
Scott Axton  @Reply  
        
3 years ago
Alan show us your criteria.

If you put LastName = "B*" you will get all last names starting with B.
If you are using LastName = "*B*"  That will return any last name that has a B anywhere.

Use of wildcards in a search was covered extensively in Access Beginner 5.
You might want to go revisit that course.
Alan Higgins OP  @Reply  
      
3 years ago
I have a form with unbound text boxes that i enter the criteria to query on. I used the example in the search video to make my
database. See attachments
Alan Higgins OP  @Reply  
      
3 years ago

Alan Higgins OP  @Reply  
      
3 years ago

Alan Higgins OP  @Reply  
      
3 years ago
Below the text boxes on the main form is a subform that displays the output.
Alex Hedley  @Reply  
           
3 years ago
You haven't updated your search criteria
Alan Higgins OP  @Reply  
      
3 years ago
If i enter ="B*" in my criteria, i will only get Names that start with a B. I want to be able use the text box to enter on the fly what i am trying to query whether it would be A B C etc.
Alex Hedley  @Reply  
           
3 years ago
My first comment is the code you want to use.
I've updated my second comment, that was an example.
Alan Higgins OP  @Reply  
      
3 years ago
Alex I am an idiot, i kept all the changes you gave me  in notepad as i always do. In reviewing the examples I made a mistake in the criteria. Your code worked after applying them correctly, i wasn't paying attention to details.

Thank you very much....
Alex Hedley  @Reply  
           
3 years ago
Happy to help, it's easily done, lots of moving parts :-)

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/6/2026 4:18:26 AM. PLT: 1s