View Single Post
  #9  
Old August 26th, 2009, 01:52 AM posted to microsoft.public.access.gettingstarted
deb
external usenet poster
 
Posts: 898
Default Archived records copying multiple times

Hi John:

The "delete query" code is below. Additional questions and information are
below the delete query code.

DELETE 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));

The macro returns one record for each record with either NHA or Archive
checked.

You may be right about the delete query (code above). When I glanced down
through the inventory table, I saw some records with those blocks checked,
and that might be the problem -- the copy to history query is working, but
the delete query is not. That may explain why one record was only duplicated
once (probably the last record archived), but most were duplicated multiple
times. I copied the database and split it on my computer to simulate the way
the client uses it. Checked a few boxes and ran the history query. The
records did not delete until I closed the form. Perhaps you can figure out
from the code above what is going wrong.

As far as the macro goes, where would I set additional SetWarnings? I'm
REALLY struggling with trying to understand macros!! Can you recommend a
macro training source?