sub form return reference

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

Guest

I intended to create a SubFrom to be called by multi-MainForm. While the
SubForm be called, a return path "Forms![abc]![cde].[Form].[field]" value
will also be given to the SubForm from MainForm and stored at a textbox of
SubForm. After the process by the SubForm, a value will be returned to the
MainForm based on such return path stored at the textbox of SubForm. How am
I convert such textbox value to be a Object of Form. Thank you for a
assisstant.
 
You may be making life too hard on yourself.
In the subform's module, Me.Parent will identify the main form on which the
subform is embedded.
Any time the subform is active, the ActiveControl on the main form will be
the subform control which contains your subform - Me.Parent.ActiveControl.
I'm not sure what else you need to do with the string that you're passing
in, but the two references above should give you access to a lot of what you
seem to need.

HTH
 
Sorry, itt is taken some mistake, there is not SubForm, it would be popup
another Form.


MacDermott said:
You may be making life too hard on yourself.
In the subform's module, Me.Parent will identify the main form on which
the
subform is embedded.
Any time the subform is active, the ActiveControl on the main form will be
the subform control which contains your subform - Me.Parent.ActiveControl.
I'm not sure what else you need to do with the string that you're passing
in, but the two references above should give you access to a lot of what
you
seem to need.

HTH

I intended to create a SubFrom to be called by multi-MainForm. While the
SubForm be called, a return path "Forms![abc]![cde].[Form].[field]" value
will also be given to the SubForm from MainForm and stored at a textbox
of
SubForm. After the process by the SubForm, a value will be returned to
the
MainForm based on such return path stored at the textbox of SubForm. How am
I convert such textbox value to be a Object of Form. Thank you for a
assisstant.
 
In the Open event of your pop-up form, the main form is still active, so you
define a global variable of type Form and set it to Screen.ActiveForm.

Public CallingForm As Form

Private Sub Form_Open (Cancel as Integer)
Set CallingForm=Screen.ActiveForm
End Sub

Now when you want to leave the pop-up form, you have a reference to the form
which called it.

HTH

dom said:
Sorry, itt is taken some mistake, there is not SubForm, it would be popup
another Form.


MacDermott said:
You may be making life too hard on yourself.
In the subform's module, Me.Parent will identify the main form on which
the
subform is embedded.
Any time the subform is active, the ActiveControl on the main form will be
the subform control which contains your subform - Me.Parent.ActiveControl.
I'm not sure what else you need to do with the string that you're passing
in, but the two references above should give you access to a lot of what
you
seem to need.

HTH

I intended to create a SubFrom to be called by multi-MainForm. While the
SubForm be called, a return path "Forms![abc]![cde].[Form].[field]" value
will also be given to the SubForm from MainForm and stored at a textbox
of
SubForm. After the process by the SubForm, a value will be returned to
the
MainForm based on such return path stored at the textbox of SubForm.
How
am
I convert such textbox value to be a Object of Form. Thank you for a
assisstant.
 
Back
Top