Hi Guys,
I have an issue when I am updating an inventory table (tblInventory), from a Purchase Order (PO), in that if an Item of the PO is not currently in tblInventory, I use the following code to add the item:
Code:
If cbostocktype.value = 4 Then ' tblinventory
rsInventoryDetail.Close
DoEvents
Set rsInventoryDetail = CurrentDb.OpenRecordset("tblinventorydetail", dbOpenDynaset, dbSeeChanges)
If rsInventory.RecordCount > 0 Then
rsInventory.FindFirst "[ProductID]=" & rsInventoryDetail![productID]
If rsInventory.NoMatch = False Then
DoCmd.RunSQL strSQLCS
ElseIf rsInventory.NoMatch = True Then
DoCmd.OpenQuery "qryTemp", acViewNormal
End If
End If
If rsInventory.RecordCount = 0 Then
DoCmd.OpenQuery "qryTemp", acViewNormal
End If
DoCmd.OpenQuery "qryDeltblCSDetail"
However, I found that items that are not currently in tblInventory, items are not being added as I had expected, so I want to be able to stop the process and check why the items are not being added?
qryTemp is an append query, that should add any items of the PO to tblInventoryDetail, which in turn updates the qty of items in tblInventory.
Hope that makes sense and any advise is appreciated.