Solved

Forms.OpenArgs Lost It's Value For No Obvious Reason, Is It Possible???

Posted on 2006-11-28
10
323 Views
Last Modified: 2012-06-27
I have a form that's used as the startup form of an Access 2k front-end application.  Here the user basically selects a company  (02 = XYZ Company South, 03 = XYZ Company North, etc.).  After the selection is made the OnClick event will open the main form for the application (Form1) setting the OpenArgs of this form to the company selection (02 or 03, etc.). This OpenArgs is used in various functions throughout the application like linking to different backend servers based on this value and I noticed when I was testing a new report the OpenArgs value of the form was empty and none of the code for the report did anything with the OpenArgs value for the main form although some VBA code for the report did error out on something totally different.

The question is has anyone experienced the OpenArgs value of a form being reset or emptied after it was set for no apparent reason???

Thanks,

ET
0
Comment
Question by:Eric Sherman
10 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 100 total points
ID: 18030523
No. i have not experienced that.
it is  possible that  the openargs parameter was reset in one of the set of codes that was executed.
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18030564
Are you using global variables with multiple concurrent users?
0
 
LVL 39

Assisted Solution

by:stevbe
stevbe earned 50 total points
ID: 18030592
are you sure you are checking the OpenArgs of the form and not the report? Don't think they existed for reports in 2000.
is the form opened more than 1 time ... this will reset the OpenArgs value
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 19

Author Comment

by:Eric Sherman
ID: 18030698
capricorn1 ....

No, the VBA code that runs with the report does absolutely nothing with the main form's OpenArgs.


jefftwilley .....

Yes, I am using global variables with multiple concurrent users.  May I ask what impact this would have on the OpenArgs of the main form of the application???


stevbe ....

Yes I'm checking the OpenArgs of the form and not a report.
No, From1 was only opened 1 time.


ET
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18030773
Thinking out loud, not knowing your front end and how it's distributed.....if one user logs in and sets the main form thusly 02 = XYZ Company South then another user selects 03 = XYZ Company North, would this not upset your opening arguements for the front end?

Ignore if each user has his own front end...

do you store the company value on the main form once it's selected for use in filtering later on?
0
 
LVL 19

Author Comment

by:Eric Sherman
ID: 18030856
jeffwilley ....

Each user has his own front end ....

>>>do you store the company value on the main form once it's selected for use in filtering later on?<<<<<

Actually, that's what I'm using the OpenArgs value for as opposed to storing the comany value to a hidden control on the main form.  I figured the OpenArgs value would be more reliable.

ET
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18030896
don't you hate that!! lol...so now you switchin to the hidden value? reliability. who builds for reliability anymore?
0
 
LVL 19

Author Comment

by:Eric Sherman
ID: 18030992
>>> don't you hate that!! lol...so now you switchin to the hidden value? reliability. who builds for reliability anymore?<<<


I do ....  :-)


ET
0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 100 total points
ID: 18031101
I found OpenArgs can be null during development (discovered today as I experienced it earlier)

eg

u have one form (say call it form A), u leave it open (form view)

u have another form (form B), u make some changes to it, and save it. form may still be left in design view
when u then run your other form (form A) to open this form (form B) thats left in design view, OpenArgs is empty
However, if I close the form (form B) after making changes, then it works fine

obviously a difference if left in design view, perhaps it may be due to the way the form is open. From scratch or from design view.

Im sure same probs would occur with reports.

Otherwise I have never experienced any problems with OpenArgs
0
 
LVL 19

Author Comment

by:Eric Sherman
ID: 18038260
Thanks all for the response ....

I think all responses confirmed what I was asking which is .......

"Can the OpenArgs value of a form being reset or emptied after it was set for no apparent reason???"

And the answer to that is no.  The problem I experienced probably has something to do with rockiroads comments about OpenArgs can be null during development (see above comments).  Something I probably did to that form durin development knocked out the OpenArgs value as I can't seem to re-create the problem after running various test and functions using the OpenArgs value.

ET

0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question