Hi all,
I am new to the forum and to Access. I am building a simple database to control stock and sales at my wife's new shop. I have managed to google my way through most of my issues, but I've been banging my head against the wall over this one for a day or two now.
All I want to do is set the value property of a text box in a subform. I know I am referencing the control correctly, because I am doing a calculation using the same control.
The control on the subform is txtNoInStock (this contains info on how many of a certain item are in stock) and the control on the main form is txtAmountSold (this is how many of a particular item are about to be sold). If I do the following calculation to check if there are enough in stock:
If [Forms]![frmSale]![DS].[Form]![txtNoInStock]-[txtAmountSold]<0
It works. I generate a text box to tell the user there are not enough in stock. However, if there are enough in stock, I simply want to subtract the amount in txtAmountSold from the subform control. Kind of like:
SetProperty
Control Name - [Forms]![frmSale]![DS].[Form]![txtNoInStock]
Value =[Forms]![frmSale]![DS].[Form]![txtNoInStock]-[txtAmountSold]
But I always get an error saying that the control is misspelled or doesn't exist!
I hope this is explained well enough and isn't TLDR.
Thanks in advance.
I am new to the forum and to Access. I am building a simple database to control stock and sales at my wife's new shop. I have managed to google my way through most of my issues, but I've been banging my head against the wall over this one for a day or two now.
All I want to do is set the value property of a text box in a subform. I know I am referencing the control correctly, because I am doing a calculation using the same control.
The control on the subform is txtNoInStock (this contains info on how many of a certain item are in stock) and the control on the main form is txtAmountSold (this is how many of a particular item are about to be sold). If I do the following calculation to check if there are enough in stock:
If [Forms]![frmSale]![DS].[Form]![txtNoInStock]-[txtAmountSold]<0
It works. I generate a text box to tell the user there are not enough in stock. However, if there are enough in stock, I simply want to subtract the amount in txtAmountSold from the subform control. Kind of like:
SetProperty
Control Name - [Forms]![frmSale]![DS].[Form]![txtNoInStock]
Value =[Forms]![frmSale]![DS].[Form]![txtNoInStock]-[txtAmountSold]
But I always get an error saying that the control is misspelled or doesn't exist!
I hope this is explained well enough and isn't TLDR.
Thanks in advance.
Last edited: