Need to use the contents of a string variable to write to a form
Need to use the contents of a string variable to write to a form
am 06.11.2007 22:01:14 von David Haskins
Hello,
I have a pop-up form that is used to enter data on a form that is
already open. My difficulty is that any of several forms might call
this same pop-up, meaning that I need to store the name of the calling
form and then use that to know where to insert the data.
Here are the details...
I have multiple multi-paned interface screens, any of which may
contain a "RecordDetailsPanel" SubForm. I'd like to be able to use a
pop-up form to format an addition to a "Notes" memo field text box,
which always exists on the subform contained in the "DataFieldsPanel",
a SubForm nested into the "RecordDetailsPanel."
I've worked out the code to successfully put the full location of the
Notes field into a String variable in VBA, but I cannot find the way
to actually write TO that location, convert that String, something
like "Forms!ClientInterface!RecordDetailsPanel.Form!
DataFieldsPanel.Form!Notes" into a pointer to use to write my new
data.
Thanks!
Re: Need to use the contents of a string variable to write to a form
am 06.11.2007 22:25:44 von Jana
On Nov 6, 2:01 pm, Dave wrote:
> Hello,
>
> I have a pop-up form that is used to enter data on a form that is
> already open. My difficulty is that any of several forms might call
> this same pop-up, meaning that I need to store the name of the calling
> form and then use that to know where to insert the data.
>
> Here are the details...
> I have multiple multi-paned interface screens, any of which may
> contain a "RecordDetailsPanel" SubForm. I'd like to be able to use a
> pop-up form to format an addition to a "Notes" memo field text box,
> which always exists on the subform contained in the "DataFieldsPanel",
> a SubForm nested into the "RecordDetailsPanel."
>
> I've worked out the code to successfully put the full location of the
> Notes field into a String variable in VBA, but I cannot find the way
> to actually write TO that location, convert that String, something
> like "Forms!ClientInterface!RecordDetailsPanel.Form!
> DataFieldsPanel.Form!Notes" into a pointer to use to write my new
> data.
>
> Thanks!
Dave:
Take a look at the OpenArgs parameter of the DoCmd.OpenForm method.
This would allow you to pass information (such as the originating
form's name).
Something like this, in the code where you're popping up the new form:
**AIR CODE**
DoCmd.OpenForm "MyForm", , , , , acDialog, "OriginatingFormName"
Then, in the pop-up form code when you're ready to write the data to
the originating form, you can grab the OpenArgs value to tell it which
form to write the data back to.
Dim MyForm as Form
Set MyForm = Forms(Me.OpenArgs)
MyForm!RecordDetailsPanel.Form!DataFieldsPanel.Form!Notes = Me!
YourPopUpsNotesField
HTH,
Jana
Re: Need to use the contents of a string variable to write to a form
am 08.11.2007 20:46:05 von Ron2006
On Nov 6, 2:25 pm, Jana wrote:
> On Nov 6, 2:01 pm, Dave wrote:
>
>
>
>
>
> > Hello,
>
> > I have a pop-up form that is used to enter data on a form that is
> > already open. My difficulty is that any of several forms might call
> > this same pop-up, meaning that I need to store the name of the calling
> > form and then use that to know where to insert the data.
>
> > Here are the details...
> > I have multiple multi-paned interface screens, any of which may
> > contain a "RecordDetailsPanel" SubForm. I'd like to be able to use a
> > pop-up form to format an addition to a "Notes" memo field text box,
> > which always exists on the subform contained in the "DataFieldsPanel",
> > a SubForm nested into the "RecordDetailsPanel."
>
> > I've worked out the code to successfully put the full location of the
> > Notes field into a String variable in VBA, but I cannot find the way
> > to actually write TO that location, convert that String, something
> > like "Forms!ClientInterface!RecordDetailsPanel.Form!
> > DataFieldsPanel.Form!Notes" into a pointer to use to write my new
> > data.
>
> > Thanks!
>
> Dave:
>
> Take a look at the OpenArgs parameter of the DoCmd.OpenForm method.
> This would allow you to pass information (such as the originating
> form's name).
>
> Something like this, in the code where you're popping up the new form:
> **AIR CODE**
> DoCmd.OpenForm "MyForm", , , , , acDialog, "OriginatingFormName"
>
> Then, in the pop-up form code when you're ready to write the data to
> the originating form, you can grab the OpenArgs value to tell it which
> form to write the data back to.
>
> Dim MyForm as Form
> Set MyForm = Forms(Me.OpenArgs)
> MyForm!RecordDetailsPanel.Form!DataFieldsPanel.Form!Notes = Me!
> YourPopUpsNotesField
>
> HTH,
> Jana- Hide quoted text -
>
> - Show quoted text -
An alternative is:
1) disable the normal "X" close button on the popup.
2) Place a close button on the form but instead of closing it
issue me.visible=false
3) In the calling form then address the fields on that "hidden" form
and more them where you want
and then
4) after using the fields issue docmd.close acform "The Name Of The
Pop Up Form"
Ron
Re: Need to use the contents of a string variable to write to a form
am 08.11.2007 20:46:19 von Ron2006
On Nov 6, 2:25 pm, Jana wrote:
> On Nov 6, 2:01 pm, Dave wrote:
>
>
>
>
>
> > Hello,
>
> > I have a pop-up form that is used to enter data on a form that is
> > already open. My difficulty is that any of several forms might call
> > this same pop-up, meaning that I need to store the name of the calling
> > form and then use that to know where to insert the data.
>
> > Here are the details...
> > I have multiple multi-paned interface screens, any of which may
> > contain a "RecordDetailsPanel" SubForm. I'd like to be able to use a
> > pop-up form to format an addition to a "Notes" memo field text box,
> > which always exists on the subform contained in the "DataFieldsPanel",
> > a SubForm nested into the "RecordDetailsPanel."
>
> > I've worked out the code to successfully put the full location of the
> > Notes field into a String variable in VBA, but I cannot find the way
> > to actually write TO that location, convert that String, something
> > like "Forms!ClientInterface!RecordDetailsPanel.Form!
> > DataFieldsPanel.Form!Notes" into a pointer to use to write my new
> > data.
>
> > Thanks!
>
> Dave:
>
> Take a look at the OpenArgs parameter of the DoCmd.OpenForm method.
> This would allow you to pass information (such as the originating
> form's name).
>
> Something like this, in the code where you're popping up the new form:
> **AIR CODE**
> DoCmd.OpenForm "MyForm", , , , , acDialog, "OriginatingFormName"
>
> Then, in the pop-up form code when you're ready to write the data to
> the originating form, you can grab the OpenArgs value to tell it which
> form to write the data back to.
>
> Dim MyForm as Form
> Set MyForm = Forms(Me.OpenArgs)
> MyForm!RecordDetailsPanel.Form!DataFieldsPanel.Form!Notes = Me!
> YourPopUpsNotesField
>
> HTH,
> Jana- Hide quoted text -
>
> - Show quoted text -
An alternative is:
1) disable the normal "X" close button on the popup.
2) Place a close button on the form but instead of closing it
issue me.visible=false
3) In the calling form then address the fields on that "hidden" form
and more them where you want
and then
4) after using the fields issue docmd.close acform "The Name Of The
Pop Up Form"
Ron