Results 1 to 2 of 2
2002-04-02, 03:27 #1
- Join Date
- Jan 2001
- Thanked 0 Times in 0 Posts
How to loop through a control (Access 2000)
I have a form with 2 controls. The one control is an unbound control called tcash and gives the result of a function. The function is called
cash(grossprice, size, code). In the OnCurrent event of the form i have the following expression
Me![tcash] = cash(grossprice, size, code)
The other control on the form is a bound control called called UnitPrice and is bound with the field UnitPirce in the table Products.
The first control serves me as a suggestion. It suggests a price. The second bound control is my active and real price.
After i have made the suggestion, i want that all my bound controls is equal to the unbound controls. I can write down each price
separately, but surely i might have done it with a code.
I want to make a code that does the following
Make the field UnitPrice receive the function through the code:
DoCmd. Me![office]= cash(grossprice, size, code)
Than loop through all the products in the form(or table] and updates the Unit price with the function and then
save the new price.
I wat that this codes functions not always, but only through a command, so it should not be in the OnCurrent event.
May i have some help?
2002-04-02, 14:07 #2
- Join Date
- Dec 2000
- Sacramento, California, USA
- Thanked 1 Time in 1 Post
Re: How to loop through a control (Access 2000)
I'm not clear on what you're trying to do. Why would you go back and change all your unit price fields to a "suggested" value? I assume that the value you want to save is based on other fields in the record, so you could do it with an update query, but my question still stands. How do you know you should override an existing value?
I have no idea what you're trying to do with this:<hr>DoCmd. Me![office]= cash(grossprice, size, code)<hr>Charlotte