Calling a variable from another form

  • Thread starter Thread starter rblivewire
  • Start date Start date
R

rblivewire

I have three forms that all have variables in the vb code. The form
takes these variables from the field on one form and does a
calculation. I need to know how to call this variable that is holding
the solution so that I can post it on my 3rd form.
 
I have three forms that all have variables in the vb code. The form
takes these variables from the field on one form and does a
calculation. I need to know how to call this variable that is holding
the solution so that I can post it on my 3rd form.

It's a lot simpler to use a reference to the form itself, rather than storing
the value in a variable: [Forms]![NameOfForm]![NameOfControl]

If you really want to use a variable, put a line

Public variablename As Integer

(or whatever datatype) at the very top of a Module in the modules tab. This
public variable will be available from any form in the database, to read or
write.

John W. Vinson [MVP]
 
Back
Top