Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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?

Reply With Quote
  #2 (permalink)  
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



Reply With Quote
  #3 (permalink)  
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?

Reply With Quote
  #4 (permalink)  
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

Reply With Quote
  #5 (permalink)  
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.

Reply With Quote
  #6 (permalink)  
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!
Reply With Quote
  #7 (permalink)  
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.:)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:24 AM.


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