Passing data from one form to another

  • Thread starter Thread starter Kevin D.
  • Start date Start date
K

Kevin D.

I have a form (FormA) which is opened from either of two forms (FormB or
FormC).
I need to pass data in field "Level" from FormA when it closes to either
FormB or FormC, field "Level", depending on which form is open at the timing
of closing Form A. How do I code so I can determine which form is open (B or
C) and pass the data to the open form.

Thanks,

kd
 
In the On Close Event of Form A put something like this (assuming that if
FormB is not open the FormC must be)

If CurrentProject.AllForms("FormB").IsLoaded Then
Forms![FormB]![Level] = Me.Level
Else
Forms![FormC]![Level] = Me.Level
End If
 
Back
Top