Why use OpenArgs?

Heatshiver

Registered User.
Local time
Tomorrow, 01:40
Joined
Dec 23, 2011
Messages
263
Now that I understand OpenArgs, I am wondering what would be a use for it that no other method could handle?

I have seen ways to get around its restrictions (more than one value, etc.), so that's nice, but I still find other methods easier in situations (or just as easy) to use.

I guess, put simply, what can OpenArgs do that no other method can?
 
What other methods are those, that are easier (or just as easy) to use? Even for a form opened in WindowMode = acDialog?

Does it degrade a feature's value that it's not the only way to do something?
 
My answer to the question would be, that it is a function native to Access and does not require an understanding of concepts such as Modules and Global variables. It therefore only requires a very rudimentary understanding of VBA, for it's implementation.
 
OpenArgs encapsulates the values passed to the form as part of the method's function call. This puts all the information clearly in one place at the call. Encapsulation is good programming practice.

Global variables could be used but they have a scope beyond what is required. Best practice is to match to the scope to the task at hand.

The OpenArgs technique allows the form to be moved to another database without worry about how it might clash with variables already in that database.
 

Users who are viewing this thread

Back
Top Bottom