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

Form's OpenArgs property suddenly becomes null

Seth Schrock
Expert 2.5K+
P: 2,931
I'm using Access 2010 and I was stepping through a large amount of code (multiple procedures being called from both the main form's module and subforms' modules) that using the main form's OpenArgs property quite a bit. Everything was working fine, and then all of a sudden, I got an error that said invalid use of null. In my debugging, I discovered that the main form's OpenArgs property was null when it should have been (and was previously) populated with a number. I had this happen multiple times. Is the OpenArgs property unreliable? I ended up just creating a global variable and setting that when the line before I opened the form and then everything works great. Almost all of my Access experience has been with Access 2010 so I'm not sure if this is only related to that version or if it affects multiple versions.
Nov 24 '13 #1

✓ answered by NeoPa

It's good practice to save the OpenArgs value as soon as you can.

My experience is that it's there available at the start of the Form_Open() event procedure, but becomes increasingly unreliable after that. This is over many versions.

Share this Question
Share on Google+
2 Replies


NeoPa
Expert Mod 15k+
P: 31,186
It's good practice to save the OpenArgs value as soon as you can.

My experience is that it's there available at the start of the Form_Open() event procedure, but becomes increasingly unreliable after that. This is over many versions.
Nov 24 '13 #2

Seth Schrock
Expert 2.5K+
P: 2,931
I was wondering. Well, glad to know that it isn't just me :)
Nov 24 '13 #3

Post your reply

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