dave_sing
asked on
I want to launch a VB module in Access 2007 via a marco
I want to launch a VB module in Access 2007 via a marco. the marco would start a VB module and when the module completed its work, the marco would provide a message and execute 2 queries then another VB module. thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would add that I find it better to use VBA procedure to do this. This way you can use sub's , error handling that a macro does not provide.
ASKER
I'll give it a try tomorrow. on my way home from work.
thanks
thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dave_sing
The problem with your logic is that it assumes that code will complete successfully.
What if it doesn't?
My guess is that if the code fails for some reason, you do not want to then run the queries.
I will also presume that you would like to inform the user of this.
For these reasons I would also recommend using VBA, not Macros for this.
My suggestion?
Create a function that determines if the code ran successfully.
Based on the result of this function, you would either notify the user that the code failed and exit the code (not running the queries)
Or (if the code did run successfully), simply go on to run the queries...
JeffCoachman
The problem with your logic is that it assumes that code will complete successfully.
What if it doesn't?
My guess is that if the code fails for some reason, you do not want to then run the queries.
I will also presume that you would like to inform the user of this.
For these reasons I would also recommend using VBA, not Macros for this.
My suggestion?
Create a function that determines if the code ran successfully.
Based on the result of this function, you would either notify the user that the code failed and exit the code (not running the queries)
Or (if the code did run successfully), simply go on to run the queries...
JeffCoachman
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank yo to all for providing me with multiple solutions and rationale for using each method.
Your Welcome :)
R
R