View Single Post
  #5  
Old August 25th, 2009, 06:49 PM posted to microsoft.public.access.gettingstarted
deb
external usenet poster
 
Posts: 898
Default Archived records copying multiple times

Hi John:

Thanks for responding!

If you select one record, the message box may come back and say "10 records
are being copied". I think the problem is in the Macro that runs the query.
Macros are not one of my strong points.

"John Spencer" wrote:

If you just use the SELECT part of the query, how many records are returned?
I would guess several based on your criteria:
tbl_InventoryListing.NHA=Yes
OR
tbl_InventoryListing.Archive=Yes

Unless you have only one record with one or both those values checked, you are
going to get multiple records returned - any records with NHA = Yes plus any
records with Archive = Yes.


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Deb wrote:
Why would the following query copy one record into the history file anywhere
from six to ten times?

INSERT INTO tbl_History ( ID, ADJTrans, DRMOTrans, RECTrans, SHPTrans,
ReceivedDate, ReceiptDoc, TransactionDate, QtyOnHand, UpdatedQty,
UnitofIssue, PartNo, CageCode, SupplySource, NIIN, UnitCost, Serial, [Index],
ConditionCode, Program, Division, Purpose, EMR, Requisition, Remarks,
DateModified, EnteredBy, ShippingPriority, DestinationUIC, ShippingMethod,
TrackingNumber, NHA, Archive )
SELECT tbl_InventoryListing.ID, tbl_InventoryListing.ADJTrans,
tbl_InventoryListing.DRMOTrans, tbl_InventoryListing.RECTrans,
tbl_InventoryListing.SHPTrans, tbl_InventoryListing.ReceivedDate,
tbl_InventoryListing.ReceiptDoc, tbl_InventoryListing.TransactionDate,
tbl_InventoryListing.QtyOnHand, tbl_InventoryListing.UpdatedQty,
tbl_InventoryListing.UnitofIssue, tbl_InventoryListing.PartNo,
tbl_InventoryListing.CageCode, tbl_InventoryListing.SupplySource,
tbl_InventoryListing.NIIN, tbl_InventoryListing.UnitCost,
tbl_InventoryListing.Serial, tbl_InventoryListing.Index,
tbl_InventoryListing.ConditionCode, tbl_InventoryListing.Program,
tbl_InventoryListing.Division, tbl_InventoryListing.Purpose,
tbl_InventoryListing.EMR, tbl_InventoryListing.Requisition,
tbl_InventoryListing.Remarks, tbl_InventoryListing.DateModified,
tbl_InventoryListing.EnteredBy, tbl_InventoryListing.ShippingPriority,
tbl_InventoryListing.DestinationUIC, tbl_InventoryListing.ShippingMethod,
tbl_InventoryListing.TrackingNumber, tbl_InventoryListing.NHA,
tbl_InventoryListing.Archive
FROM tbl_InventoryListing
WHERE (((tbl_InventoryListing.NHA)=Yes)) OR
(((tbl_InventoryListing.Archive)=Yes));

Please help!