Results 1 to 2 of 2
Thread: updating (Access 2000)
2002-04-19, 16:33 #1
- Join Date
- Jan 2001
- Thanked 0 Times in 0 Posts
updating (Access 2000)
I want to update a field called office in a tabular form called frmUpdate with a function called cash(grossprice, size, code, ddu).
The names in the brackets are controls on the form.My function works fine if i place it in the OnCurrnet event of the
form and then it displays the calculated figure.
I want however to update the entire field in the table through the following command
Me![office] = cash(grossprice, size, code, ddu)
However i receive the message " you cant assign a value to this object"
The record source of my form is the table Products with the following fields
SELECT products.Productid, products.code, products.categoryid, products.size, products.ddu, products.grossprice, products.office
The table products is with a productid as unique number and i have 100 products.
How can i make my code calclulate with my function cash(grossprice, size, code, ddu)just with one click?
May be i must loop through all the products in the form and updtate the field office for each product separately
Can somebody help me ?
2002-04-19, 19:29 #2
- Join Date
- Jun 2001
- Crystal Beach, FL, Florida, USA
- Thanked 34 Times in 34 Posts
Re: updating (Access 2000)
The first question most everyone here will ask is: Why are you storing the calculation in the first place? It is generally not a good idea to store calculated fields, since you can never totally rely on the stored total, since any of the components might have been changed without updating the total.
As to why you are getting that error message. Is there a control on your form by the name of [Office]? If so, what is its controlsource? And can you update the other fields on the form?