[AccessD] OpenArgs

jwcolby jwcolby at colbyconsulting.com
Thu May 17 10:19:39 CDT 2007


U actually wrote a pair of classes to handle this.  Of course I then
embedded it in my form class but it can run independently.  The base class
clsOpenArgs (plural) grabs the Openargs string and knows how to parse them.
The format is the old format:

VarName1=VarVal1;VarName2=VarVal2; 

The child class OpenArg (singular) just holds the var name / value and is
held in a collection in the parent class.  In my implementation The parent
class can be passed a param telling it to expect to process form properties
and as such looks up the VarName in the Properties collection of the form.
If found it sets the form.SomeProperty = the var value.

IOW, I might pass in: 

AllowEdits=True;AllowAdds=False;AllowDeletes=False;

clsOpenArgs tries to map AllowEdits to a form property.  Since it succeeds
it sets the form's AllowEdits property to True (the passed in value in this
case).

It works GREAT, and is an example of how a framework is built up over time
as I needed functionality.

clsOpenArgs also has a method that allows me to pass in an argument name and
returns the argument value.

I will send another email with actual code.

John W. Colby
Colby Consulting
www.ColbyConsulting.com
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Erbach
Sent: Thursday, May 17, 2007 10:40 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] OpenArgs

Susan,

What kinds of things have you tried?  I've used OpenArgs to send a string of
comma-delimited values.  The opening form parses the OpenArgs string to,
say, set a value in a field on the form.  I use OpenArgs to tell the form
being opened what the calling form's name is, or to set a variable in the
Open method for the form, etc.
There's a decent couple of examples in the Access 2003 Help for the OpenArgs
Property.

Steve Erbach




More information about the AccessD mailing list