D
David via AccessMonster.com
Hi,
I have a form that loses its OpenArgs value somewhere between editing the
data on the form and closing the form.
The calling form uses DoCmd.OpenForm and passes an opening argument that
contains a form or control name, the pipe character, and a code.
For example, the calling form has a command button (cmdDetails):
This successfully opens frmContactDetails (and the filter on pkautContactID
works too). I have confirmed that the OpenArgs variable contains the string
sent to it using a Msgbox on the Open event. I can edit the data on the
form, and using another Msgbox, can see that the OpenArgs value is still
there.
***But when I close the form (either with DoCMd.Close or with the form's [X]
button), a Msgbox shows the OpenArgs value is blank and the code for the On
Close event gives me a Null error. I can certainly test for a null and deal
with it, but I use the OpenArgs value in the On Close event, so I need the
value to persist.
I could post the OpenArgs value to an hidden unbound textbox on the form,
but I am more interested in why the value is vanishing.
I can post the code behind the form, but it's fairly long & I don't see a
way to post an attachment on this BB.
Thanks in advance,
David
I have a form that loses its OpenArgs value somewhere between editing the
data on the form and closing the form.
The calling form uses DoCmd.OpenForm and passes an opening argument that
contains a form or control name, the pipe character, and a code.
For example, the calling form has a command button (cmdDetails):
Code:
Private Sub cmdDetails_Click()
DoCmd.OpenForm "frmContactDetails", , , "pkautContactID = " &
Me.fkautContactID, , , "Forms!frmContactDetails!CAMPAIGNS.Form!
CAMPAIGNCONTACTLIST.Form|Det"
End Sub
This successfully opens frmContactDetails (and the filter on pkautContactID
works too). I have confirmed that the OpenArgs variable contains the string
sent to it using a Msgbox on the Open event. I can edit the data on the
form, and using another Msgbox, can see that the OpenArgs value is still
there.
***But when I close the form (either with DoCMd.Close or with the form's [X]
button), a Msgbox shows the OpenArgs value is blank and the code for the On
Close event gives me a Null error. I can certainly test for a null and deal
with it, but I use the OpenArgs value in the On Close event, so I need the
value to persist.
I could post the OpenArgs value to an hidden unbound textbox on the form,
but I am more interested in why the value is vanishing.
I can post the code behind the form, but it's fairly long & I don't see a
way to post an attachment on this BB.
Thanks in advance,
David