Link to home
Start Free TrialLog in
Avatar of dave_sing
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
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.

Avatar of dave_sing
dave_sing

ASKER

I'll give it a try tomorrow. on my way home from work.
thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank yo to all for providing me with multiple solutions and rationale for using each method.
Your Welcome :)

R