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

More OpenArgs Null problems

P: 1
In searching for a solution to a current problem I ran across a thread from 2005 on the same issue, ( ). In that case it appeared that the problem had just resolved itself. I can believe that. I have a similar problem in a VBA program, using Access in Office XP. The problem seems to have a mind of it's own. Yesterday I went home and the code worked... today it doesn't.

The problem is with passing an OpenArgs statement when opening a form. In the new form I initially "seemed to have" fixed the problem by capturing me.openargs value into a variable in the Form_Open event. Now, that is passing as Null... again.

I've tried structuring the calling code directly using me.Name, tried it by setting a string variable to me.Name's value then passing that, even tried various combinations of single and double quotes... just in case.

Here's the calling code:

Expand|Select|Wrap|Line Numbers
  1.   Debug.Print "My name is "; Me.Name
  2.     'strMyName = Me.Name
  5.       'call the pop-up to add a new folder name
  6.       DoCmd.OpenForm _
  7.         FormName:=("frmNewFolder"), _
  8.         windowmode:=acDialog, _
  9.         OpenArgs:=Me.Name

''' The print statement above returns My name is frmAssignPermissions
In the new pop-up form I was monitoring the value here:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  3.     Dim strWhoCalled As String
  5.     Debug.Print Me.OpenArgs
  7.     strWhoCalled = Me.OpenArgs
'''The print statement above returns Null.
Like I said... it seemed to be working when I crawled home last night.
I rebooted the computer as always.
This morning the problem is present.
... Odd thing is... I had the same problem with the code several days ago and somewhere in fussing with capturing the OpenArgs in the Form_Open event it had gone away. Any thoughts?
Mar 9 '07 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 15k+
P: 31,754
I tried to reproduce your problem but it always worked for me.
Is there any possibility that you already have the form open when you run your test? Either in Design or Run view?
Mar 10 '07 #2

P: 1
NeoPa - THANK YOU! Jesus, what a waste of an hour
May 19 '09 #3

Expert Mod 15k+
P: 31,754
I'm not sure I follow.

Did that resolve the problem for you?
Are you Lou with a new account?
Are you someone completely different but stumbled across this thread when you were struggling with a similar problem?
May 19 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.