|
-
Jun 5th, 2000, 09:25 PM
#1
Thread Starter
New Member
Can anyone give me help with unloading forms. I have an application that has two forms open. One of the forms shows mapping and the other is a query form. Basically what I am doing is using the query form to select features from the map. Everything is working fine except for the fact that after I unload my query form I go to my map form and do some work on the map. All the code runs through but there is a delay with VB and it goes into the code to unload the form but the form doesn't actually fully unload until it is finished the work on the map form. This is really annoying as my query form is still visible when it shouldn't be.
-
Jun 5th, 2000, 09:35 PM
#2
Fanatic Member
How about hiding it. Forms can still process commands while hidden.
Iain, thats with an i by the way!
-
Jun 5th, 2000, 09:36 PM
#3
_______
Unload
unload one form or all forms
'create a bas module
'
Public Sub UnloadAllForms()
Dim Form As Form
For Each Form In Forms
Unload Form
Set Form = Nothing
Next Form
End Sub
'
'==================================================
'place this in your exit event
'
Call UnloadAllForms
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 5th, 2000, 09:42 PM
#4
Thread Starter
New Member
Hiding the form does the same thing. My query form starts to unload and the map form becomes active. Basically my application hangs for a few seconds while it goes through the work on the map form. I know that my map form is coming in too fast, I did try and pause the program after the unload but that didn't work.
-
Jun 5th, 2000, 09:44 PM
#5
Fanatic Member
How about. It might work if i understand wht you are getting at.
Iain, thats with an i by the way!
-
Jun 5th, 2000, 10:13 PM
#6
Thread Starter
New Member
I'll try to explain a bit more. I start with a form (frmMain) that has an Active X control for mapping. I have different types of data in this map one of which is Excavation sites. I want to query my Excavations on their name so I click on the Query button and bring up my form (frmExcavQBF). When I click on my 'Query' button on this form it goes out to a module and performs an SQL query on a database. At the end of this procedure I unload my frmExcavQBF. A procedure is then called to write the ID numbers of the excavations into a VB Collection and then on frmMain these excavations are redrawn in a different colour. The problem occurs at the stage when frmExcavQBF gets unloaded. Before I unload the two forms are open with frmExcavQBF being the active form. When I unload frmMain becomes active but frmExcavQBF doesn't unload properly until the application finishes building the VB Collection and redrawing the excavations. To me it looks like the application is racing through and doesn't have enough time to release frmExcavQBF before it moves on to the next piece of code.
-
Jun 5th, 2000, 10:19 PM
#7
Fanatic Member
Here i go again.
Assuming the Procedure to write to the collection is called from frmExcavQBF.
Before this hide the form. You may have to put a DoEvents in as well. Then unload where you usually do.
Other wise, unload the form, and before you build the collection use DoEvents.
Hope this rectifies things.
Iain, thats with an i by the way!
-
Jun 5th, 2000, 10:32 PM
#8
Thread Starter
New Member
Excellent, that worked perfectly. Thanks a million for your help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|