Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 10th, 2004, 12:35 PM
Authorized User
 
Join Date: Aug 2004
Location: Harrisburg, PA, USA.
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete Table

Hello Community,
I want to create a delete table to keep track of printers deleted from my database. Is there a way to set up a table like this that when I delete a printer, it moves the deleted printer and it's config information to a separate table which can be looked at to keep track of the printers that were no longer needed?

 
Old September 10th, 2004, 12:59 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: South San Francisco, CA, USA.
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

Where will the field values of the deleted printers be coming from?
For example you have a table with inventory of printers named tblPrinters.
I suggest in this tblPrinters table you create a field name Deleted with Date type Yes/No. Assuming you already created a tblPrintersDeleted, the next step is to create an Append query to
add all records from tblPrinter with Deleted field value of Yes.
Check the result after you run the query. See if all Yes value of Deleted field are in tblPrintersDeleted.
Then created a Delete query to delete all records from the Deleted field value of Yes.
I hope this helps.
john



 
Old September 10th, 2004, 01:24 PM
Authorized User
 
Join Date: Aug 2004
Location: Harrisburg, PA, USA.
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That really sounds like a good idea, however, I would like to make it a little more automated. I could see having a query to do this all in one operation, but is there a way to eliminate the step of having to go into the table to check the Yes box for deleted?

 
Old September 10th, 2004, 01:58 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: South San Francisco, CA, USA.
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

What will be you basis then to do it?
Unless, you have another field to get a criteria. Like 4 example in our email messages, you have a date field msg was received and want to archive messages for more than a year.
john

 
Old September 10th, 2004, 02:22 PM
Authorized User
 
Join Date: Aug 2004
Location: Harrisburg, PA, USA.
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I guess I will need to use VBA in order to do something as complex as what I have in mind.

 
Old September 10th, 2004, 03:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Connersville, Indiana, USA.
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Hello,
I don't think what you are doing requires VBA except for the command button that executes it. Take a look under Access help at "Create an Append Query." This will give you step by step instructions on how to create this query. It is actually pretty easy.

I have a specification database that lists all specifications that our automotive parts must meet. I use this append query every time one of those specifications are obsoleted/inactivated. This pulls the record out of the active spec table and moves it to the obsolete spec table. I think this is exactly what you are wanting to do with your printers.

I hope this helps!

Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
 
Old September 10th, 2004, 04:25 PM
Authorized User
 
Join Date: Aug 2004
Location: Harrisburg, PA, USA.
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Laura,
The problem with the append query, unless I am wrong, is that it will append the data into another table but then you have to go back into the table and delete the data. I may be wrong and I am not trying to argue, but it just seems like that is going to require too many steps. I will try it again though, just to be sure.:)




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete all the records in a table Kai Lai Access VBA 2 March 15th, 2016 07:20 AM
How to delete all data from table TomW Access VBA 5 March 12th, 2008 09:11 AM
Can't Modify or Delete table PatYoda SQL Server 2000 3 December 3rd, 2004 09:41 AM
Delete Printers Table Teqlump VB Databases Basics 1 September 10th, 2004 04:45 PM
How to delete two or more lines in a Table??? thomaz C# 3 July 4th, 2003 02:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.