I am sure this is a very basic question but I have tried many different ways and I can't seem to get anything to work. Sorry if there is already an answer to this elsewhere, I wasn't able to locate it.
I have an input screen in which the user inputs values in FieldA, FieldB, FieldC and FieldD. I have created a function that will calculate a new value and display it in a second set of fields (next to the first set).
For example user enters:
20 in FieldA, I want to display $400.00 in FieldATTL (next to fieldA)
In my code, I want to only write the total calculation code once --- I want to be able to pass the screen object name (fieldX) to the function and have the function update the appropriate total field (FieldXTTL) be updated with the appropriate value.
Here is the code I have working for updating one field but I don't know how to pass the field name as a variable and get the code to update the .text attribute appropraitely.
Sub UpdateTotal(Fld As Label, Txtval As Float, Multiplier As Float)
Dim x As Float
x =Txtval * Multiplier
FldATTL.Text=NumberFormat2(x,0,2,2,False)
End Sub
In the code above, I want to pass the "FieldATTL" through the UpdateTotal function and use it to update the .text attribute of the object on the screen. I know the red code is where the issues are. Any help is greatly appreicated.
I have an input screen in which the user inputs values in FieldA, FieldB, FieldC and FieldD. I have created a function that will calculate a new value and display it in a second set of fields (next to the first set).
For example user enters:
20 in FieldA, I want to display $400.00 in FieldATTL (next to fieldA)
In my code, I want to only write the total calculation code once --- I want to be able to pass the screen object name (fieldX) to the function and have the function update the appropriate total field (FieldXTTL) be updated with the appropriate value.
Here is the code I have working for updating one field but I don't know how to pass the field name as a variable and get the code to update the .text attribute appropraitely.
Sub UpdateTotal(Fld As Label, Txtval As Float, Multiplier As Float)
Dim x As Float
x =Txtval * Multiplier
FldATTL.Text=NumberFormat2(x,0,2,2,False)
End Sub
In the code above, I want to pass the "FieldATTL" through the UpdateTotal function and use it to update the .text attribute of the object on the screen. I know the red code is where the issues are. Any help is greatly appreicated.