mrtauntaun
MIS
Hi. I have a long line of code which needs to be run very often. I would like to create a function (if I properly understand how a function statement works, if not please enlighten
to perform an equation and return a value. I am taking five different fields, adding them together, and get that value. So:
Forms!generator!Total = Forms!generator!FieldA1-Forms!generator!FieldA2 and so forth until FieldA5
Now, I have Fields A-Y, so this needs to be done multiple times.
On got focus of FieldC, persay, then Forms!generator!FieldC1 etcetcetc
I would like to use a function and write one line of code which I can call to do this for me. Perhaps something like:
Temp=FieldA
Private Function()
Forms!generator!Total=Forms!generator![& Temp &]1-Forms!generator![& Temp &]2 etcetc
Can this work? If so, how? Did I make enough sense here?
Thank you!!!!!
Forms!generator!Total = Forms!generator!FieldA1-Forms!generator!FieldA2 and so forth until FieldA5
Now, I have Fields A-Y, so this needs to be done multiple times.
On got focus of FieldC, persay, then Forms!generator!FieldC1 etcetcetc
I would like to use a function and write one line of code which I can call to do this for me. Perhaps something like:
Temp=FieldA
Private Function()
Forms!generator!Total=Forms!generator![& Temp &]1-Forms!generator![& Temp &]2 etcetc
Can this work? If so, how? Did I make enough sense here?
Thank you!!!!!