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 
Reset Database Video
Julian Kinlaw 
    
7 months ago
Hey folks, hope everyone is well. I am working with the Reset Database Video and have followed Richard's instruction to the letter but getting a compile error of Sub or Function not defined. When that error occurs it highlights the word Status of the following lines. Can anyone help.

Status "Deleting Data..."
    CurrentDb.Execute "DELETE FROM CustomerT"
    CurrentDb.Execute "DELETE FROM ContactT"
John Davy  @Reply  
         
7 months ago
Do the tables exist at that time? If not then you need to check first. Also Delete *  John
John Davy  @Reply  
         
7 months ago
Hi Julian, just to clarify. If you want to delate all records from CustomerT then add the wildcard to your SQL  Delete * From CustomerT  John
Julian Kinlaw OP  @Reply  
    
7 months ago
The tables do exist. I have not tried to delete anything yet because I can't get pass the compile error. My problem is I have typed the entire sub - Private Sub DeleteTables_Click() and so on, exactly the same, word for word, like Richard did in the video. He saved and compiled receiving no errors. When I save and compile, again double checking spelling making sure that it is exactly like the video, I get the compile error, "Sub or Function not defined." I don't want to try and delete anything until I get the compile error fixed. In the video Richard demonstrated using the button to delete all database records without using * not saying that won't work also.
Kevin Robertson  @Reply  
          
7 months ago
Do you have the Status Sub Routine?

Status Box
Global Status Fn
Richard Rost  @Reply  
          
7 months ago
Julian I can always tell when people didn't pay attention in the entire video or watch the prerequisites. I talk about the Status function at time index 6:18 in the Reset Database video. Don't worry. You're not the only one. :)
Julian Kinlaw OP  @Reply  
    
7 months ago
Thanks guys! I did see that you had a status box but didn't realize you have to have a status box in order to make it work. I did start to wonder if I did need to have one but for what I am putting together I do not need one at the moment. I just like the idea of a delete database button for trial purposes to reset the databases. Yea, sometimes, because I like what I am doing, I like to jump to the end creation. Kind of how I do a lot of things without instructions. Thanks everyone for taking the time to right my wrong
Kevin Yip  @Reply  
     
7 months ago
If you have a split database, then you can have a blank backend at the ready.  To "reset" a database, you just link your tables to the ones in the blank backend.  A blank backend can be easily created by copying & pasting table structures only.
Gary James  @Reply  
      
7 months ago
You don't need a Status Box, but if you don't have one, simply comment out the line that calls the associated Status function that places the text "Deleting Data..." in the box
Julian Kinlaw OP  @Reply  
    
7 months ago
Thanks guys. I like the msgbox and inputbox of Richards so I just decided to follow on with the rest. I ended up using msgbox and inputbox with the following and got the same delete databases results.

Dim db As DAO.Database
        Set db = CurrentDb

    DoCmd.RunSQL "DELETE * FROM DatabaseName
Kevin Yip  @Reply  
     
7 months ago
Daniel Pineault at the DevHut website has mentioned a clever way to create blank copies of tables and keep autonumber fields at 1.  The trick is to run a make-table query with a false criteria.  No record will be created due to the false criteria, but a new blank table will be created.  E.g.:

     SELECT Table1.* INTO Table1Copy FROM Table1 WHERE False;

The above query does not create a primary key index.  So you still have to run another query to set the PK.  If your PK field is named ID, then run this to set ID as the PK:

     CREATE INDEX PK ON Table1Copy (ID) WITH PRIMARY

This provides an automated way to create a blank backend if you have a large number of tables.
Richard Rost  @Reply  
          
7 months ago
Great trick.

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: 4/30/2026 7:09:08 AM. PLT: 1s