Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 7th, 2008, 04:08 AM
Registered User
Join Date: Dec 2007
Location: , , .
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.

Reply With Quote
  #2 (permalink)  
Old January 7th, 2008, 04:26 AM
Wrox Author
Join Date: May 2007
Location: , Washington, .
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.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 10:53 AM.

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