AccessRobo
Registered User.
- Local time
- Yesterday, 17:17
- Joined
- Mar 27, 2012
- Messages
- 12
Please help.
When the stock in my sales database is 0 I want a check box to get automatically ticked. I use the check box results to create a list of in stock products, but also just want to know how to do this. I have put the code in my after update event, in the stock control on my form. Forms name is frmOrderDetailSubform. The actual Stock field is numeric. I called the control txtStock. The check box control I called chkPurchaseDetailSoldOut and the field name is PurchaseDetailSoldOut. I have tried putting the code in the check box event, after update. I have tried changing to true and false, -1 or 0, & Yes and No. Here is my best attempt so far. Thank you for any help.
When the stock in my sales database is 0 I want a check box to get automatically ticked. I use the check box results to create a list of in stock products, but also just want to know how to do this. I have put the code in my after update event, in the stock control on my form. Forms name is frmOrderDetailSubform. The actual Stock field is numeric. I called the control txtStock. The check box control I called chkPurchaseDetailSoldOut and the field name is PurchaseDetailSoldOut. I have tried putting the code in the check box event, after update. I have tried changing to true and false, -1 or 0, & Yes and No. Here is my best attempt so far. Thank you for any help.
Code:
Private Sub Stock_AfterUpdate()
If Me.txtStock.Value = 0 Then Me.chkPurchaseDetailSoldOut = 0
Else
Me.chkPurchaseDetailSoldOut = -1
End If
End Sub