I have an inventory database. I want to delete out-of-stock items
from the main database, but keep them in a separate table so
that I can reference data about them.
I created a copy of the item table, structure only, no data.
Then I query the item table for the ones I want, and attempt
to copy them to the out of stock item table. The 'paste' fails
all the time. On the theory that the ItemId (Autonumber in the main
table) is the culprit, I've tried to paste with the itemid in the
out of stock table defined as autonumber, number and text, failing
each time.
Can anyone point me in the right direction? (I just know I'm
missing something obvious.)
Scott 4 2209
Make the corresponding field in the archive table a Long Integer, not an
AutoNumber field. Use two Queries: one an Append Query to select all the
out-of-stock records in your main table and append them to the archive
table; then another (make sure you don't run it until after you manually
verify that the append did work) that deletes those out of stock records
from the main table.
But, until you are looking at records in the high hundreds of thousands or
millions, Access can handle the situation very nicely. Thus, you might
consider just leaving the records there (obviously "out of stock" is
something you can determine; perhaps you'd want to add a separate
"discontinu ed" indicator) and using Queries to access only the ones that are
in stock and not discontinued, instead of using a separate archival table.
Certainly, any business decision processing you may do that requires both
active and archived data will be simpler if you have it all in the same
table.
Larry Linson
Microsoft Access MVP
"Scott Kinney" <sa******@ix.ne tcom.com> wrote in message
news:iI******** ************@co mcast.com... I have an inventory database. I want to delete out-of-stock items from the main database, but keep them in a separate table so that I can reference data about them.
I created a copy of the item table, structure only, no data. Then I query the item table for the ones I want, and attempt to copy them to the out of stock item table. The 'paste' fails all the time. On the theory that the ItemId (Autonumber in the main table) is the culprit, I've tried to paste with the itemid in the out of stock table defined as autonumber, number and text, failing each time.
Can anyone point me in the right direction? (I just know I'm missing something obvious.)
Scott
Larry,
Thank you. I wrestled with just adding an instock/out of stock
indicator. It's lazy of me, but moving the out of stock
items to a separate table seems easier than adding a
new criteria to the fairly large number of queries I have.
Scott
"Larry Linson" <bo*****@localh ost.not> wrote in message
news:jM******** ***********@nwr ddc02.gnilink.n et... Make the corresponding field in the archive table a Long Integer, not an AutoNumber field. Use two Queries: one an Append Query to select all the out-of-stock records in your main table and append them to the archive table; then another (make sure you don't run it until after you manually verify that the append did work) that deletes those out of stock records from the main table.
But, until you are looking at records in the high hundreds of thousands or millions, Access can handle the situation very nicely. Thus, you might consider just leaving the records there (obviously "out of stock" is something you can determine; perhaps you'd want to add a separate "discontinu ed" indicator) and using Queries to access only the ones that
are in stock and not discontinued, instead of using a separate archival table.
Certainly, any business decision processing you may do that requires both active and archived data will be simpler if you have it all in the same table.
Larry Linson Microsoft Access MVP "Scott Kinney" <sa******@ix.ne tcom.com> wrote in message news:iI******** ************@co mcast.com... I have an inventory database. I want to delete out-of-stock items from the main database, but keep them in a separate table so that I can reference data about them.
I created a copy of the item table, structure only, no data. Then I query the item table for the ones I want, and attempt to copy them to the out of stock item table. The 'paste' fails all the time. On the theory that the ItemId (Autonumber in the main table) is the culprit, I've tried to paste with the itemid in the out of stock table defined as autonumber, number and text, failing each time.
Can anyone point me in the right direction? (I just know I'm missing something obvious.)
Scott
I have an argument in favor of leaving the records in the main table. If
you put the out of stock records in a separate table and the main table has
an autonumber field for it's primary key it is possible for an id number
that is in the out of stock table to be used again in the main table for a
different item. I ran across this exact situation with a main inventory
table and an out of stock table (they weren't called that but the effective
system was the same) that only totaled about 80,000 records. Trust me, I
thought as large as a long integer is that this was very unlikely, but it
did happen. Admittedly, it was only a handful of records, but they created
problems for reporting. I was attempting to build a report to show the
current retail market value of the inventory at the time it happened.
This is a pretty good example of what Larry meant in the last paragraph of
his answer.
--
Jeffrey R. Bailey
"Larry Linson" <bo*****@localh ost.not> wrote in message
news:jM******** ***********@nwr ddc02.gnilink.n et... Make the corresponding field in the archive table a Long Integer, not an AutoNumber field. Use two Queries: one an Append Query to select all the out-of-stock records in your main table and append them to the archive table; then another (make sure you don't run it until after you manually verify that the append did work) that deletes those out of stock records from the main table.
But, until you are looking at records in the high hundreds of thousands or millions, Access can handle the situation very nicely. Thus, you might consider just leaving the records there (obviously "out of stock" is something you can determine; perhaps you'd want to add a separate "discontinu ed" indicator) and using Queries to access only the ones that
are in stock and not discontinued, instead of using a separate archival table.
Certainly, any business decision processing you may do that requires both active and archived data will be simpler if you have it all in the same table.
Larry Linson Microsoft Access MVP "Scott Kinney" <sa******@ix.ne tcom.com> wrote in message news:iI******** ************@co mcast.com... I have an inventory database. I want to delete out-of-stock items from the main database, but keep them in a separate table so that I can reference data about them.
I created a copy of the item table, structure only, no data. Then I query the item table for the ones I want, and attempt to copy them to the out of stock item table. The 'paste' fails all the time. On the theory that the ItemId (Autonumber in the main table) is the culprit, I've tried to paste with the itemid in the out of stock table defined as autonumber, number and text, failing each time.
Can anyone point me in the right direction? (I just know I'm missing something obvious.)
Scott
Thanks for the real-life example, Jeffrey.
I was thinking of queries that needed both the "live" and "archived"
inventory information, in which case, you'd have to use a UNION or UNION ALL
query if the information is stored in two tables.
BTW, MVP Allen Browne's site http://allenbrowne.com/tips.html has some
excellent discussion of Inventory applications.
Larry Linson
Microsoft Access MVP This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: C Kirby |
last post by:
I'm running a DB using MSDE (2000) that is interfaced by 2 different
ades running on PCs with Access 2000 Runtime. One of the ADEs is a
package accounting system that is very solid and stable, the other is
a custom application that I wrote (much less solid and stable). The
custom app only deals with a select few tables in the database, and...
|
by: Robert Brown |
last post by:
Our customer (of our ecommerce system) wants to be able to preserve
deleted entities in the database so that they can do reporting,
auditing etc.
The system is quite complex where each end user can belong to multiple
institutional affiliations (which can purchase on behalf of the user).
The end user also has a rich trail of past...
|
by: GordoBR |
last post by:
I have an A2K app that I deplyed a year ago in a multiuser environment
(only 3-4 users max). The users recently drew my attention to a very
odd thing:
For one of their records a "Comments" field now has the text
"#Deleted." They wanted to change it to input the proper comments but
when they try Access gives them a warning that you are about...
|
by: DaveDiego |
last post by:
I've had a user delete one of the client records, I do have a version of
the DB with all records intact before the deletion occured.
Whats the best approach to getting all the related records in each of
the tables? I have about 12 tables to put data back into and multiple
records for each. Would I need to make an append or update query for...
|
by: Grant |
last post by:
Hi
Is there a way to recover deleted records from a table. A mass deletion has
occurred and Access has been closed since it happened
Louis
| |
by: KC |
last post by:
I am using Access 2002, with a database template from MS Office. The
Orders Management Database. I have tweaked this for use with our
company. It is a small database with close to a 1000 records in our
Orders table. Within this table are 80 records that I decided to
delete to clean it up a bit. When I went into my data entry form, I...
|
by: musicloverlch |
last post by:
I have a DB2 table and when I open it, all the records show up as
#Deleted. I went here: http://www.techonthenet.com/access/tables/del_err_linked.php
and tried this, but I don't get a pop-up box to choose any primary
keys. The kicker is that the table works fine in Crystal Reports.
What is wrong with Access? Why doesn't it work?
Thanks...
|
by: Taco |
last post by:
Dear forum,
First, this is my first post here, so please be kind. I have been taking a look over this place for a while now and it seems like the right place to be.
Alright the issue at hand:
There is an Informix DB that was on a Sun system. It worked just fine.
Due to issues with the server, it was moved to an IBM (AIX) system.
Users...
|
by: marcf |
last post by:
Hi Everyone,
Hopefully someone will be able to offer a suggestion to this problem.
I have a multi user CMS running at work which I wrote. Aside from a few bugs everything has been going fine except for one annoying problem. Heres the info:
Windows XP workstations connecting to a windows 2003 server with roaming profiles for each user....
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |