Form Opening Arguments becomes blank

  • Thread starter Thread starter Andrew W
  • Start date Start date
A

Andrew W

I have a form with a couple of subforms. Some how the opening arguments
are becoming blank after the form opens and before it closes. I've used
mesageboxes attached to these events to determine the runtime values
for OpenArgs. I'm looking for a reason that the OpenArgs are being
reset. Any ideas will be appreciated.
 
I don't see what can cause that but if you post a bit of code we may be able
to determine if your code is right.

Here how I do it.

call the form
------------------
Dim stDocName As String
Dim ctrl As String

ctrl = Me.Name & "*" & Me.MyControl.Name 'Assigne form name and control
stDocName = "MyForm" 'Assigne form name to open
DoCmd.OpenForm stDocName, , , , , , ctrl 'Open form

------------------
In the form_Load event
------------------
Dim sep As Integer 'Will contain the string separator
Dim frm As String 'Will contain the parent form name
Dim ctl As String 'Will contain the parent control

'Etract info from Open Arguments
sep = InStr(1, OpenArgs, "*")
frm = Left(OpenArgs, sep - 1)
ctl = Right(OpenArgs, Len(OpenArgs) - sep)
 
Hi Yanick, thanks for your reply.

I am opening the form with the following code:
strFormName = "frmDataEntry"
DoCmd.OpenForm strFormName, , , , , , "frmswitchboard"

Using the open event of frmDataEntry, I've entered this code:
Msgbox me.OpenArgs ' this results in a msgbox with the text:
"frmswitchboard"

And then using the close event of frmDataEntry, I've entered this code:
Msgbox me.OpenArgs ' this results in a msgbox with no text.

I want to use the opening arguments to provide a way to reopen/maximize
the switchboard after the user closes the frmDataEntry.

In most cases this technique works.

I am resetting the recordsource of a subform to frmDataEntry. Could
this erase frmDataEntry's OpenArgs?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top