Trying to eliminate Redundancy

Webmaster@worksnotfun.com

Registered User.
Local time
Today, 06:40
Joined
Jan 28, 2002
Messages
15
I have a home made switchboard with command buttons that ask for a "enter beginning & ending dates", if the person hits cancel access displays some error message. I have some error code to eliminate the 2501 error. But it seems like i have to add the lines of code for each command button and there are several. How would I code it once and be done with it?
 
You could create a public function in a module. If all the buttons perform the same function (i.e. open a form) you can code that into the function as well, leaving the form name as a variable. If the buttons are doing different functions, you can at least make a function for dealing with the error message. This will cut down on the amount of code.
 

Users who are viewing this thread

Back
Top Bottom