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 
Two Where VBA Statements HELP
Tom Kelly 
    
4 years ago
Hello Richard,
In an old post you showed the following and said it should work!

Docmd.OpenForm "SomeFormF",,,"ID=" & ListBox & " AND SomeOtherVal=" & X

I have an AppointmentsListF (continuous form with User, IsOpen, and other fields).

I use a Login Form and pass openargs to the next menu form when I open my Main Menu.  Login Form takes me to Main Menu for the User that is logged on. On my Main menu I want to add My Open Appointments for the logged in user (lngUserID).  When I msgbox I get the correct userID showing.  I see all the appointments in the command to Open Appointments.

DoCmd.Openform "AppointmentsListF", acNormal,, "UserID = " & lngUserID shows me a list of all the Appointments (whether IsOpen is true or false).  

How do I get :
DoCmd.OpenForm "AppointmentListF", acNormal, , "[UserID] = " & lngUserID & " And [IsOpen]=" & "'Yes'"
to work?

I want to see just the Open Appointments for the logged in User from the AppointmentListF form!

Please help! Thank you!!
Kevin Robertson  @Reply  
          
4 years ago
Try this:

DoCmd.OpenForm "AppointmentListF", acNormal, , "[UserID] = " & lngUserID & " And [IsOpen]=True"
Tom Kelly OP  @Reply  
    
4 years ago
Kevin Robertson I can't thank you enough!  I have tried so many different combinations of syntax ... no open and closed square brackets, open and closed parenthesis, double quotes ... single quotes ... no quotes.  I THANK YOU Kevin!! Much appreciated!!!

May I ask another question?  Where does one learn the proper syntax when it comes to the commas, brackets, single quotes and double quotes etc.  Do you have a resource?  THANK YOU!!!!
Scott Axton  @Reply  
        
4 years ago
Quite honestly it is shown a bit at a time through out the courses as it is needed.
Keep on the path and you'll get there.
To get you started start out with  Concatenation
and Double Double Quotes
Tom Kelly OP  @Reply  
    
4 years ago
Thank you Scott!  I will have to revisit those two recommended videos!  Thank you so much for the great work that you do!!
Scott Axton  @Reply  
        
4 years ago
You bet Tom.  Ask questions if you hit a wall.

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:04:47 PM. PLT: 1s