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 
Cmd button multiple criteria
Mark Budinger 
     
4 years ago
I have a form called Job_Points and a form called frmQCInspections, there is no relationship between them.


I do most of my work in the frmQCInspections form. Both of these forms have a common filed in them "Part_Number"

I would like to create a command button in frmQCInspections that will open the Job_points form via the part number field
and the Job_Open/Closed (Filed in the Job_Points form) field but only if this field is set to Open, Incomplete, RTR

I only know how to do a single filter through the macro builder. When converted to VB this is what I have

DoCmd.OpenForm "JOB_POINTS", acNormal, "", "[JOB_PARTNUMBER]=" & "'" & PartNoID & "'", , acNormal

Any help would be greatly appreciated.



Regards,

Mark
Kevin Yip  @Reply  
     
4 years ago
It looks like you need to add one more criterion to the one you already have, and connect them with the AND operator.  The following code assumes the [Job_Open/Closed] field is a string, and that Open, Incomplete, and RTR are three different, possible values for [Job_Open/Closed]:


Dim crit As String

' The following criterion is true if [Job_Open/Closed] equals to any one of the specified values.
crit = "[Job_Open/Closed] IN ('Open', 'Incomplete', 'RTR')

DoCmd.OpenForm "JOB_POINTS", acNormal, , "[JOB_PARTNUMBER]='" & PartNoID & "' AND " & crit

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/7/2026 2:24:42 AM. PLT: 1s