Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Filtering on a form
Monty 

16 years ago
I track quantity of supplies in a small business. I have a QOH field on a form showing the quantities of each item in stock. I would like to put a button on my form that when clicked it would popup a message box asking me to enter a number (say 5, maybe even enter <5) and once entered it would open up just those items which have the quantity on hand of 5 in stock or if I entered <5 it would show me all those with <5 in stock. The best I can do right now is use the filter button on the toolbar. Couple of problems with that. The main problem being that I have someone else who uses my database and they are a newbe Access user who know nothing about Access. I need to make this simple as possible. Could use a query myself but I need it all to be done from the form for their part and a button on the form to do this would work. I'm an intermediate Access user and have not been able to figure out how to do this.


Reply from Richard Rost:

Well, one way to do it would be using a tiny bit of SQL and some VB to requery the data in your form. For example, make a button with the following code in it:

'--- begin ---
X = InputBox ("Enter maximum qty in stock")
Me.RecordSource = "SELECT * FROM MyTable WHERE QtyOnHand<=" & X
'--- end ---

That's it. That's all you need. It would prompt the user to enter an amount, and then set the RecordSource property of the current form to show all items with a QtyOnHand greater than or equal to the amount entered.

Try it and let me know if that will work for you. Obviously there are more elegant solutions, but this is a quick one that I think will work for you.

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: 7/26/2026 7:46:33 PM. PLT: 0s