Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 February 2nd, 2007, 01:31 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pause Code

Hi,

I have a module that opens a form if a given circumstance is true. I need to be able to pause the code and open the form to get the user input. Then I want the code to continue running after the user exits that form. Is there a way to do this?

Thanks for any help!

Dave

 
Old February 2nd, 2007, 03:01 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

An intermediate form or InputBox. The intermediate for should be Modal to prevent any other action in the database until it is submitted.

Did that help?

mmcdonal
 
Old February 2nd, 2007, 03:29 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've set the Modal property to Yes in the form's property box, but its still not working for me. Is there something else I need to do?

 
Old February 2nd, 2007, 04:07 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You need to write the code so that if the condition is true, the code exits, and it continued on the form OR, use an inputbox to get the information.

Example:

sFName = "Mike"

If sName = "Mike" Then
   sLName = InputBox "Please enter your last name"
End If

This check for the condition, and throws an input box for further data gathering.

Look up InputBox on MSDN.

Did that help?

If you need to get more data, you can throw up more input boxes, but that is problematic.

The alternative is to send out the form and exiting the sub, but you will need public variables for this, which is also not a problem.

If this doesn't work, you need to post the steps, code and business rules you want to use.

mmcdonal
 
Old February 5th, 2007, 12:44 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK. I'm trying to switch over to input boxes for this. Is there a way to have multiple textboxes on an input box? Ideally I would need 2 input boxes with 4 textboxes each. If this isn't possible then I will have to have 8 input boxes, which seems like it might be a little confusing for the end user.

Thanks,
Dave

 
Old February 5th, 2007, 12:48 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You want to use a modal form and some public variables, most likely.


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I Pause Loop dsmike2008 VB How-To 5 July 18th, 2008 01:01 PM
Pause between macros paul20091968 Access VBA 2 April 6th, 2007 01:40 AM
"Pause" Checking ... tonyrosen Excel VBA 2 November 23rd, 2005 11:02 AM
Pause Printing rajanikrishna Pro VB 6 0 November 28th, 2004 09:13 PM
Add a Pause snowy0 VB.NET 2002/2003 Basics 3 February 1st, 2004 12:17 PM





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