Form design help (1 Viewer)

aron.ridgway

Registered User.
Local time
Today, 22:57
Joined
Apr 1, 2014
Messages
148
i need to run a condition that compares 2 field quantities together based on the same item. If they both equal the same then i want it to run a code and change a property for that record.

I will have a OrderQty and a Total receivedQty when these 2 equal each other then it updates the items Status to Received

what is the best way to accomplish this? in vba or queries/sql?
 

BlueIshDan

☠
Local time
Today, 18:57
Joined
May 15, 2014
Messages
1,122
Your query will end up looking like

Code:
     UPDATE [table]
     SET status = "[something]"
     WHERE [field1] = [field2]
 

aron.ridgway

Registered User.
Local time
Today, 22:57
Joined
Apr 1, 2014
Messages
148
thanks for your suggestion, i have tried the following; the query is only readonly as it sums the recieve qty. So when i try and run the query i get a message 'Operation must use an updateable query' any way i could get round this?

Code:
UPDATE tblOrderDetail INNER JOIN qryReceiveRunningTotal ON tblOrderDetail.OrderDetailPK = qryReceiveRunningTotal.OrderDetailPK 
SET tblOrderDetail.Statusfk = 2
WHERE (((tblOrderDetail.qty)=[qryReceiveRunningTotal].[TotalReceive]));
 

aron.ridgway

Registered User.
Local time
Today, 22:57
Joined
Apr 1, 2014
Messages
148
i have solved this by creating a temp table to hold the summed qty, thaks for your help
 

Users who are viewing this thread

Top Bottom