Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop a macro

Status
Not open for further replies.

micang

Technical User
Aug 9, 2006
626
US
Access 2003

Hi All,

I have a few macro's than run in Access. One of them imports data from a txt file.

How would I go about stopping a series of macros? For example there is a violation of validation on import, how can I stop all processing of macros after this error?


Many thanks

Michael
 
This is why you may consider using VBA code instead of macros ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Seconded. Unless you have something that you know will never fail, macros are not usually the preferred way to get things done. VBA will give you much more power and flexibility.

Ignorance of certain subjects is a great part of wisdom
 
Thirded. I believe there is a wizard or something that converts macros to code.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
What everybody is hinting at but noone is actually saying is "No" there is no way to do this. The biggest drawback to macros is that they do not allow error handling!

From the Macros tab of the Objects Dialog Box choose Macros then goto Tools > Macros > Convert Macros to Visual Basic.

VB not only allows for error handling, but gives you much more flexibility in what you have Access do.

Good Luck!


The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Hi all,

Thank you all very much for the feedback. I can see how using macro's is limiting. The absense of error checking is a pain.

Unfortunatly my VBA skills are zero, but I see that I have to start learning VBA, otherwise I will be too li,ited.

Thanks missinglinq, I will look at coverting the macro to VBA and take it from there.

Many thanks all

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top