B
Brant Burrow
Hello!
Although I have a fair amount of experience in the Access
and SQL sandbox, I'm just starting to get (seriously) into
Object Oriented Programming ... and, I fear that Access
may not be up to the OOP solution that I would dearly like
to implement. So, I figured I would ask for a heads-up in
this forum. (I'm developing in Access XP/2002 by the way,
in case it makes any difference.)
What I would like to do, is add some custom properties to
Access' built-in controls (i.e. anything that could be
placed on a form). Now, from what I have been able to
gather, this type of solution (in a truly OOP environment)
would involve developing new classes which inherit/extend
from the existing Access classes (controls). And,
although Access supports writing custom classes, I don't
think it support extending its own "internal" classes
(please correct me if I'm wrong).
As a compromise, I would be willing to use a routine each
form's Open event, to add custom properties to all of the
controls on that form. But, so far, I haven't been able
to make the CreateProperty method work for controls (and,
based on the fact that Controls are not part of
the 'Applies To' list in the help for the CreateProperty
method, I don't hold out much hope there <grin/shrug>).
I need to have some user-security based properties that
mirror - conceptually - various native properties (such as
visible, locked, etc.). Based on reading in settings from
a security table in the database, I need to set the
custom "UserVisible", "UserLocked", etc. properties
according to what the logged in user is "authorized" to
do. The reason I cannot simply set the 'real/native'
properties directly, is because many of the forms will
have dynamic behaviour - i.e. even for a "super user",
various fields will not appear, unless a certain option
button is pressed, or a tick box filled in, etc. However,
a subset of these same related fields may very well be
disabled for "lesser" user, and therefore, should not be
made visible. Hence, the need for a 2nd set of
behavioural properties to "mirror" the 'real/native' ones.
(I intend to include logic to ensure that stupid things
don't happen - like disabling a truly 'required' field,
etc.)
That's why I figured the most elegant solution would be to
create custom classes (such as clsTextBox, etc.) based on
the existing controls.
Any guidance/insight would be very much appreciated!
Regards,
Brant Burrow, M. Prog.
Director, Technology Services
G. & H. Burrow Ltd.
Although I have a fair amount of experience in the Access
and SQL sandbox, I'm just starting to get (seriously) into
Object Oriented Programming ... and, I fear that Access
may not be up to the OOP solution that I would dearly like
to implement. So, I figured I would ask for a heads-up in
this forum. (I'm developing in Access XP/2002 by the way,
in case it makes any difference.)
What I would like to do, is add some custom properties to
Access' built-in controls (i.e. anything that could be
placed on a form). Now, from what I have been able to
gather, this type of solution (in a truly OOP environment)
would involve developing new classes which inherit/extend
from the existing Access classes (controls). And,
although Access supports writing custom classes, I don't
think it support extending its own "internal" classes
(please correct me if I'm wrong).
As a compromise, I would be willing to use a routine each
form's Open event, to add custom properties to all of the
controls on that form. But, so far, I haven't been able
to make the CreateProperty method work for controls (and,
based on the fact that Controls are not part of
the 'Applies To' list in the help for the CreateProperty
method, I don't hold out much hope there <grin/shrug>).
I need to have some user-security based properties that
mirror - conceptually - various native properties (such as
visible, locked, etc.). Based on reading in settings from
a security table in the database, I need to set the
custom "UserVisible", "UserLocked", etc. properties
according to what the logged in user is "authorized" to
do. The reason I cannot simply set the 'real/native'
properties directly, is because many of the forms will
have dynamic behaviour - i.e. even for a "super user",
various fields will not appear, unless a certain option
button is pressed, or a tick box filled in, etc. However,
a subset of these same related fields may very well be
disabled for "lesser" user, and therefore, should not be
made visible. Hence, the need for a 2nd set of
behavioural properties to "mirror" the 'real/native' ones.
(I intend to include logic to ensure that stupid things
don't happen - like disabling a truly 'required' field,
etc.)
That's why I figured the most elegant solution would be to
create custom classes (such as clsTextBox, etc.) based on
the existing controls.
Any guidance/insight would be very much appreciated!
Regards,
Brant Burrow, M. Prog.
Director, Technology Services
G. & H. Burrow Ltd.