Merging Procedures

T

Tony Williams

I have a form that has three command buttons. On the OnClick of each button
there is a procedure that runs that checks the input, pops up messages if
are errors and then each procedure runs a query that is dependent on the
previous procedure and query having run before it. I want to merge the three
procedures so that the three separate actions appear seamless to the user by
clicking on only one button. Can I be sure that if I merge the procedures
into one that they will run in the correct order.
Thanks
Tony
 
S

Steve Schapel

Tony,

They will run in the order that they are written in your code. As long
as the logic of your code is as required, you should get the results you
need.
 
K

Keith Wilby

Tony Williams said:
I have a form that has three command buttons. On the OnClick of each button
there is a procedure that runs that checks the input, pops up messages if
are errors and then each procedure runs a query that is dependent on the
previous procedure and query having run before it. I want to merge the
three procedures so that the three separate actions appear seamless to the
user by clicking on only one button. Can I be sure that if I merge the
procedures into one that they will run in the correct order.
Thanks
Tony
You have a couple of options. Either call the event procedures of the 2nd
and 3rd buttons from the click event of the 1st or put all of the code in a
public sub and call it from your 1st button. It will run in the order you
write it barring any run-time errors occurring.

HTH - Keith.
www.keithwilby.com
 
Top