variables in code section that can be used on form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how do i build a variable in the code section, that can be used on the form

i have a main form to a sub form to a sub form. i am building a remit module whereby the payments, copays,
payments will be keyed on the second sub form but the results will roll to the first sub form
i thought if i could build a variable in the code section that i could get around the shortcomings o
dsum. some of the things i want to do, do not work either syntactially or logically in dsum

so i want to take info from the second sub form and create a variable that can be used on the first su
form
 
you can ether declare a public variable in standart module or declare public
vaiable in main form class module, then from subform you can use it as:

Forms("mainform").MyPublicVar

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com



jn said:
how do i build a variable in the code section, that can be used on the form?

i have a main form to a sub form to a sub form. i am building a remit
module whereby the payments, copays,
 
i built a public variable in the main form, but for some reason was not recognized at the sub form level
i then built the public variable in the module section and it was recognized

i then did a calculation at the mainform level, using the new variable

i then put a new text box at the sub form level to display the new variable

i get various error messages in whatever construct i try.
my main form is called remittance and my sub is remittance detail. the variable is called newvar
following your suggestion, i was trying to use forms("remittance").newvar in the control source of the subform text bo
i tried other options, to no avail

so where am i screwing up

thanks
 
you can't use variables in control source. instead, for example in current
event prc write

me.mytexbox=mypablicvar

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com



jn said:
i built a public variable in the main form, but for some reason was not
recognized at the sub form level.
i then built the public variable in the module section and it was recognized.

i then did a calculation at the mainform level, using the new variable.

i then put a new text box at the sub form level to display the new variable.

i get various error messages in whatever construct i try.
my main form is called remittance and my sub is remittance detail. the variable is called newvar.
following your suggestion, i was trying to use forms("remittance").newvar
in the control source of the subform text box
 
Back
Top