By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,080 Members | 1,817 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,080 IT Pros & Developers. It's quick & easy.

Need to use the contents of a string variable to write to a form

P: n/a
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!

Nov 6 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Nov 6, 2:01 pm, Dave <dahask...@gmail.comwrote:
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.For m!Notes = Me!
YourPopUpsNotesField

HTH,
Jana

Nov 6 '07 #2

P: n/a
On Nov 6, 2:25 pm, Jana <Bauer.J...@gmail.comwrote:
On Nov 6, 2:01 pm, Dave <dahask...@gmail.comwrote:


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.For m!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

Nov 8 '07 #3

P: n/a
On Nov 6, 2:25 pm, Jana <Bauer.J...@gmail.comwrote:
On Nov 6, 2:01 pm, Dave <dahask...@gmail.comwrote:


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.For m!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

Nov 8 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.