Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 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 July 22nd, 2003, 04:41 PM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBModal

Good Afternoon my fellow programmers,

I am working on an add-in and i am calling a form from a module, however I want to hault execution of the module until after the form is displayed, receives input, and an OK button is clicked. The reason being, the form stuffs data into global variables which are then used after the form is closed. I then want to resume execution of where I left off from the module. I tried using VBModal, but it doesn't appear to be working. Am I using it incorrectly, or is it just not compatible with add-ins. If anyone knows of another way to accomplish this, I would appreciate any help.

Code:
                        If (ApplyToall = False) Then
                            'Display Error Option Form to allow user to select type of
                            'error handling routine to insert
                            frmErrorOption.Show vbModal
                        End If
                ***I want to resume here
                        If (ExitErrorHandling = True) Then
                            Exit Function
                        Else

                            ' insert the custom error handling
                            AddErrorHandling True, ProcBodyStartLine, ProcBodyEndLine, ProcName, ProcType, ErrorHandlerType, ErrorOption
                            NextMemberLineStart = GetMemberInfo(TempStartLine)
                        End If
 
Old July 23rd, 2003, 03:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you hiding the form at any time? Because if you are then it ceases to be modal and execution will commence from the top of the call stack, or in your case, in your module just after calling 'frmErrorOption.Show vbModal.'

Regards
Owain Williams
 
Old July 23rd, 2003, 04:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try placing a break point on the line 'End If' just after your call to show the form modally, run the project and see when the project breaks, this will give you an idea of when the form is no longer being shown modally.

Regards
Owain Williams









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