Passing data from one form to another

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
 
D

Dennis

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top