Running update query only once.

D

Damon Heron

I have the following query execute with a command button before shipping doc
is printed. This updates the inventory transaction table, removing product
as it is shipped. It works fine, but what if the user clicks the button
more than once. Any suggestions on how I could check the Inventory
Transaction table to see if table was already updated, and disable the
command button if true?


INSERT INTO [Inventory Transactions] ( ProductID, LocationID, TCID,
TransDate, OrderID, TransactionDescription, UnitsRemoved )
SELECT DISTINCT [Order Details].ProductID, [Order Details].LocationID,
[Order Details].TCID, Orders.ShipDate, [Order Details].OrderID, [Trans
Types].TransTypes AS Expr1, [Order Details].Quantity
FROM [Trans Types], Orders INNER JOIN [Order Details] ON
Orders.OrderID=[Order Details].OrderID
WHERE ((([Order Details].OrderID)=Forms![Print Bill of Lading]!OrderID) And
(([Trans Types].TransTypes)=Forms![Print Bill of Lading]!cbxUpdate));

Thanks for your help!

Damon
 
Top