Wrox Programmer Forums
BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3
This is the forum to discuss the Wrox book Access 2007 VBA Programmer's Reference by Teresa Hennig, Rob Cooper, Geoffrey L. Griffith, Armen Stein; ISBN: 9780470047033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 7th, 2008, 04:08 AM
Registered User
Join Date: Dec 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default pausing execution

I am aware that opening a form with DoCmd.openform will pause code execution in the dialog mode. I'd like to do the same thing when instantiating the form:

dim frm as new Form_frmMyDialog
set frm = new Form_frmMyDialog
frm.caption = "This is the page caption"
frm.textbox1 = "This text goes in textbox1 on the dialog form"
frm.modalbehaviorpausingexecution = true '???
msgbox "This message box shows after the dialog box is closed"

As it is currently written, msgbox "This message..." shows up as soon as the frmMyDialog is displayed... all other code after this executes as well, which I'd like to pause.

Any help appreciated.

Old January 7th, 2008, 04:26 AM
Wrox Author
Join Date: May 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts


Unfortunately there is not a straight forward way to do this. So far I can only think of two approaches, neither of which may be ideal.

First is to enter some type of a loop after you display the instance of the form that waits for it to close. Something like:

While (CurrentProject.AllForms("frmMyDialog").IsLoaded )

If you are managing multiple instances however, this approach might not work until each instance of the form is closed.

If possible, a cleaner approach might be to move the code that should execute after the form is closed into a separate routine and call this code from the Close event of the form in question.

Hope this helps,

Rob Cooper
Lead Software Design Engineer in Test
Microsoft Access Team

co-author: Access 2007 VBA Programmer's Reference
co-author: Expert Access 2007 Programming

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at microsoft.com/info/cpyright.htm.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pausing a rotating image banner 132591 Javascript How-To 1 December 18th, 2006 01:54 AM
Pausing a web application macupryk ASP.NET 1.0 and 1.1 Basics 1 November 5th, 2005 01:51 AM
Pausing a procedure ja8261 VB.NET 2002/2003 Basics 3 October 19th, 2004 04:14 PM
Pausing Code? edray Beginning VB 6 1 July 9th, 2004 08:02 AM
Running and pausing exe's from DTS Package leehambly SQL Server DTS 2 September 22nd, 2003 10:15 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.