On the form frmOrders i have a button to delete the current order in tblOrders, if no corresponding orderitems exists anymore in tblOrderdetails.
To delete the orderrecord, i use the following code:
Application.Echo False
Call TglVergrendeling(Me, SECTION_DETAIL, False) (= unlocking the controls)
Me.AllowDeletions = True
DoCmd.RunSQL "DELETE * From " & "tblOrders" & " Where [OrderID] = Forms!frmOrders![OrderID];"
After running this code, the data of the deleted order remains visible in the form, the order isn't deleted.
If i add the following code after the runSql hereabove,
Me.requery
i get the following message:
someone else deleted the record.
I could use cascading deletion, but the user of the program prefer to get the possibility to make a choice after deleting all orderitems of an order:
keeping the ordernumber and immediatly entering other orderitems, or deleting the order in the table tblOrders.
To delete the orderrecord, i use the following code:
Application.Echo False
Call TglVergrendeling(Me, SECTION_DETAIL, False) (= unlocking the controls)
Me.AllowDeletions = True
DoCmd.RunSQL "DELETE * From " & "tblOrders" & " Where [OrderID] = Forms!frmOrders![OrderID];"
After running this code, the data of the deleted order remains visible in the form, the order isn't deleted.
If i add the following code after the runSql hereabove,
Me.requery
i get the following message:
someone else deleted the record.
I could use cascading deletion, but the user of the program prefer to get the possibility to make a choice after deleting all orderitems of an order:
keeping the ordernumber and immediatly entering other orderitems, or deleting the order in the table tblOrders.