LaughingDev
Registered User.
- Local time
- Today, 10:48
- Joined
- Sep 12, 2011
- Messages
- 11
I am working on a system which manages orders, purchases and the inventory for a small trading company, much like the northwind example.
The db currently has 6 tables: Products, Customers, Orders, OrderDetails, Purchases and PurchaseDetails.
I just realised that the CreateOrder form allows the input of a quantity value which is more than the StockOnHand value. The SOH value is displayed as the third (2) column in a ComboBox which queries the productcode, name and its SOH value.
To correct this I have attempted to add the following code in the AfterUpdate event of the Quantity field:
If Me!Quantity > Me!ProductCode.Column(2) Then
This does not give the correct behaviour, it still allows for values larger than the SOH to be entered. For some reason the condition is not being triggered.
Would appreciate any help on this. Thanks in advance.
The db currently has 6 tables: Products, Customers, Orders, OrderDetails, Purchases and PurchaseDetails.
I just realised that the CreateOrder form allows the input of a quantity value which is more than the StockOnHand value. The SOH value is displayed as the third (2) column in a ComboBox which queries the productcode, name and its SOH value.
To correct this I have attempted to add the following code in the AfterUpdate event of the Quantity field:
If Me!Quantity > Me!ProductCode.Column(2) Then
MsgBox "There is not enough Stock to satisfy this Quantity, you must make a PurchaseOrder or adjust the Quantity", vbExclamation, "Low Stock"
Me!Quantity = ""
End IfMe!Quantity = ""
This does not give the correct behaviour, it still allows for values larger than the SOH to be entered. For some reason the condition is not being triggered.
Would appreciate any help on this. Thanks in advance.