M
Mister John Doe
As I am building this application, I am trying to put it together in a
way that will reduce as much as possible any headaches that come when
trying to modify it in the future.
So one of the things I am thinking about is the way forms are opened
and handled in Access. When I transfer control to other forms, I need
to refer to that form, of course, and that's done by providing the
form's name in a string. There are some forms that I am creating as
general forms and they will be called from many different forms.
So, if I decide down the road to change the name of a form (for some
reason) then to get things to work correctly I will need to go to
every place that I have hard-coded the old name of the form and I will
have to hard-code the new name.
I was thinking that instead of doing this I would declare each form
name in a MAIN or GENERAL module. I would declare each form name as a
global string constant. Then I use the global string constant
throughout the application. If I ever need to change the name of a
form then I need to change it in only one place - the declaration for
the global string constant.
But I was wondering if this will buy me anything. Will this save me
the time and headache I am hoping it will save? Or is this not a good
practice?
As you can probably tell, I am new to programming in Access (been
doing it about three weeks now) and I am not sure if there are some
"lessons learned" that are out there. If this is a bad idea, please
let me know. Or if this is a good idea, let me know that also.
way that will reduce as much as possible any headaches that come when
trying to modify it in the future.
So one of the things I am thinking about is the way forms are opened
and handled in Access. When I transfer control to other forms, I need
to refer to that form, of course, and that's done by providing the
form's name in a string. There are some forms that I am creating as
general forms and they will be called from many different forms.
So, if I decide down the road to change the name of a form (for some
reason) then to get things to work correctly I will need to go to
every place that I have hard-coded the old name of the form and I will
have to hard-code the new name.
I was thinking that instead of doing this I would declare each form
name in a MAIN or GENERAL module. I would declare each form name as a
global string constant. Then I use the global string constant
throughout the application. If I ever need to change the name of a
form then I need to change it in only one place - the declaration for
the global string constant.
But I was wondering if this will buy me anything. Will this save me
the time and headache I am hoping it will save? Or is this not a good
practice?
As you can probably tell, I am new to programming in Access (been
doing it about three weeks now) and I am not sure if there are some
"lessons learned" that are out there. If this is a bad idea, please
let me know. Or if this is a good idea, let me know that also.