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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Halting a Macro

Status
Not open for further replies.

ITbeast

IS-IT--Management
Jul 25, 2006
67
US
Hello,

I'm using a macro to run multiple append queries that split one table into multiple tables. What I want to do is look at the primary key in the dump_temp table. This is the table that data gets imported into my database.
Ok, so i want to look at the primary key in the dump_temp table and compare it to the pk in the house table. Now, what i want to do is if there is a conflict, i want a message to alert the user, and then halt the macro.

Is this possible?
 
ITbeast,
Yes, take a look at Condition in a Macro. Check the help file for "Why use conditions in a macro?", it's a good place to start.

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
For better (and safer) control I'd use VBA instead of macro ...
 
Thanks for the hints both of you. I will try both and see what works out best for me. Could someone give me a sample of some vba code that would run some queries. I've done vb coding in the past, but it's pretty fuzzy. or perhaps someone has a good link to a site that i could reference.
 
ITbeast,
Acces will give you a hand and Convert Macros to Visual Basic for you. Check the help files for details.

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top