Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Form information in OpenArgs 2

Status
Not open for further replies.
Jan 24, 2002
33
0
0
CA
Good Afternoon,

I presently have FormA containing a SubFormA, a FormB containing a SubformB and a FormC containing a SubformC. Users enter information in the Subforms and sometimes a FormZ needs to be opened in Dialog Mode. Once information is entered in the FormZ, certain information are sent back to the Subform fields.


First, using VBA I'd like to use the OpenArgs option in the Docmd.OpenForm FormZ within the Subform to send the name of the Form and Subform (ex: Me.FormParent.Name and Me.Form.Name) as string.


Secondly, the information sent back to the subform should use the OpenArgs string to know which subform to send the information to.

I'm having a hard time with the proper syntax and how to convert the "form.subform" to string type and back to form type.

Thanks,
Lawrence.
 
Thanks HiTechUser for the response,

I have already looked at these threads however it doesn't exactly fit my needs. I have used the comma delimited approach in the OpenArgs a few times but I was wondering if there was a way to do the following:

I send a form name "FormA" as an OpenArgs string and then refer back to the form by using Form(Me.OpenArgs). However, I was wondering if there was something similar such that Form("FormA.SubformA") or something like that.

Does it mean the only way to do it is to send the Form Name and Subform Name as a comma delimited string and then recreating it on the other form?

Thanks for the help,
Lawrence

 
Try this:

Your form name: FormA
Your subform name: SubFormA
Your OpenArgs to FormZ: FormA

Forms(Me.OpenArgs) will refer to the form
Forms(Me.OpenArgs).form("Sub" & Me.OpenArgs) will refer to the subform

Although I would suggest writing a class module that is used for creating and separating delimitered strings.

Hope this helps,
Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top