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 
Error Message on Form Load
Tim Elbert 
      
8 months ago
I have a form set up with a button to open an order form.  If I click on the button to open the form, and there is no order for that person, I get an error message.  I would like to have the button do nothing if there is no order.  Would I set up something in the macro?  See photos. Any help would be appreciated.
Tim Elbert OP  @Reply  
      
8 months ago

Tim Elbert OP  @Reply  
      
8 months ago

Kevin Yip  @Reply  
     
8 months ago
If there is no order, the button should not be clickable (i.e. should be disabled), so it won't trigger the error -- and save the user the extra step of having to click the button.  VBA would be better suited here.  Whenever a customer is selected (Current event), check if the customer has any orders (with DCount), then enable or disable the button (by setting the button's Enabled property).  You can even show a tiny red text next to the button that says "No Order."
Tim Elbert OP  @Reply  
      
8 months ago
Kevin Thanks Kevin.  I have not gotten into VBA much yet.  Do you have a suggestion for one of Ricks videos that i can watch, or perhaps a suggested line of code...
Kevin Yip  @Reply  
     
8 months ago
Here is a Tech Help video on the Current event: https://www.youtube.com/watch?v=LgCbKyOr7lA .  The video requires you watch "Intro to VBA" first ( https://www.youtube.com/watch?v=uvmtcjJeBe4 ).  If you have done programming in other languages, it may be easier to pick up VBA.  VBA is based on Basic, one of the oldest and also the easiest language to learn.  In the early 80s, I was taught Basic in the 10th grade.  I've never taken any of Richard's courses, so I'll defer to him and his students regarding the exact path of taking his courses.

John Davy  @Reply  
         
8 months ago
Hi Tim, Which form are you on when you try to open the order? In Richard's App the user navigates from Customer to  Orders for that customer, where the open button is. HTH John
Bill Carver  @Reply  
      
8 months ago
Tim is thay double = signnormal?   try getting it down to 1 to start
Tim Elbert OP  @Reply  
      
8 months ago
I had an Aha moment and queried the customer list to include only those with orders, simplifying the list and making it easier.  Thansk for the help though.  I stillhave a lot to learn and I am having fun learning it!

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 10:34:06 PM. PLT: 0s