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 
SetWarnings in Macro
Russ Phillips 
     
6 years ago
Richard I'm trying to create a button on my parts form that will take info from 4 text boxes P/N, Part Name, MFG, and part location and send it to a table PartToPrint I only want the 1 row of lables. so when I export them to excel I can print the one P/N with the name ect.ect. the problem is if the table doesn't have info in it my macro wont run. it will give me an error saying cant run at this time. "because to table is blank".
I have this:in my macro
set warnings off =no
open table =parttoprint
run menu command= record go to first
run menu command=select all records
run menu command= delete records
open query = my query to select the records I want to print  
set warnings= yes
run menu command =export to excel
close window
is there some thing I'm missing that if the table is blank it will bypass and just run the query and not try to delete a record that is not there.  please help
Russ
Richard Rost  @Reply  
      
6 years ago
I'm not following - it gives you an error message on the delete but keeps running anyway? See this is why I don't like macros. I much prefer VBA.
Russ Phillips OP  @Reply  
     
6 years ago
if my table doesnt have any records there is nothing to delete but its looking for something to delete then it will err outall I want to do is run my query to fill the table with one set of records to export to then print a label when Im done and run it again i want the last record to be deleated so I will have a new record to print the next label
Richard Rost  @Reply  
      
6 years ago
Why don't you move the delete to the end of the process? Export your records THEN delete what's in the table. This way you're always sure to have a record there.

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/9/2026 9:31:45 AM. PLT: 1s