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

Pausing Code Commands? 1

Status
Not open for further replies.

Hakala

Technical User
Apr 26, 2006
144
US
Hi, Tek-Tips!

I'm working with Access 2003. I have a form that controls importing from Excel, then the database does some checking against a lookup table and merges data from there with the Excel data, and saves to another table.

I'm doing this by running macros (I don't know how to code well enough yet to do it all in code). The macros pop up the boxes that say "You're about to append xx records", etc.

The import and merge is working fine. However, we're importing some data from Excel that we don't want and I'd like to stop the process in the middle to give the user a chance to discard the records we don't want. (I can't code to exclude them because the criteria changes.)

Is there a way to use code to run a query, then open a table, then wait for the user to finish with the now-open table before going on to the next command?

Thanks for any help!


Michelle Hakala
 
A 'Click OK to Continue' message box?

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Hakala,
HarleyQuinn has one way, another would be to open a form as Dialog ([tt]Window Mode = Dialog[/tt]), this should pause the macro as long as the form is open.

Create a new form that is a datasheet view of your table with all the fields listed, this will give the user the impression of opening the table and will allow additions/changes/deletions from the table.

When the user closes this form the macro should resume where it left off.

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)
 
HarleyQuinn's idea was a good one, but the message box showed up on top of all other windows and wouldn't allow me to update the table which I could see behind it. Once I told it OK, of course, the macro continued to run.

CautionMP's idea works well.

Thank you both for your help!



Michelle Hakala
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top