Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Forums > Access
Back to Access Forum    Comments List
Error Handling in Macros Upload Images   Link   Email  
Shelagh Fagan 
I have an Append To history macro that I needed to have controls to stop the user running it twice. I used a composite index key set to "unique". Works great. But when you try to rerun I get a long error message part of which says " unable to append... due to key violations'. To make it user friendly I added an OnError, GoTo Error Message at the top of the macro, bypassing the rest of the macro. It never works. It doesn't do the append correctly but it runs the rest of the macro without my error message. I've tried adding [MacroError].[Description]. No luck. Why doesn't the OnError detect the key violation? I bet Rick has a video on this?
Richard Rost 
Honestly, I really don't like error handling in macros. It's clunky and I've had problems with getting it to work myself in the past. I would try to talk you into rewriting your macro as VBA code and using proper error handling in that. I just covered how to do this in Developer 15, Lesson 2. You can always open the macro up in Design View and then go to Design > Convert to Visual Basic if you don't want to rewrite it yourself.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

 
 
 

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 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 3/28/2024 8:51:25 AM. PLT: 0s