Unload Form
I use many form and my principal form is Menu.When I use Unload Menu, my form close but 50 % of time my program continu to task in back...I use a lot of Data (Receordset) but I don't use the file (txt.. with open and close).Do you where is the problem?Sorry for my englishThanksRedg
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Unable To Unload A Form Using Unload
This problem is a strange one....atleast for me.I have used the following code in a form called frmSubScreen:
Function show_mgr(emp_id As String)
frmMgrScreen.mgr_id = emp_id
frmMgrScreen.Show
unload frmSubScreen
End Function
This works fine.The new form is shown & frmsubscreen gets unloaded.The problem is in the next snippet of code:
Private Sub cmbViewChoice_Click()
txt = "40001"
If cmbViewChoice.ListIndex = 0 Then
frmFirstProcessScreen.emp_id = txt
frmFirstProcessScreen.Show
unload frmSubScreen
ElseIf cmbViewChoice.ListIndex = 1 Then
frmFirstCtqScreen.emp_id = txt
frmFirstCtqScreen.Show
unload frmSubScreen
ElseIf cmbViewChoice.ListIndex = 2 Then
frmFirstClientScreen.emp_id = txt
frmFirstClientScreen.Show
unload frmSubScreen
End If
End Sub
When this code placed in the same form is executed the new form is shown depending on the right if case but the frmSubScreen form is not unloaded.What i mean is the new form is displayed but then i get an error message - "unable to unload within this context" run time error 365.
Can anyone figure this out?Any help will be appreciated.
Thanks a lot
Unable To Unload A Form Using Unload
This problem is a strange one....atleast for me.I have used the following code in a form called frmSubScreen:
Function show_mgr(emp_id As String)
frmMgrScreen.mgr_id = emp_id
frmMgrScreen.Show
unload frmSubScreen
End Function
This works fine.The new form is shown & frmsubscreen gets unloaded.The problem is in the next snippet of code:
Private Sub cmbViewChoice_Click()
txt = "40001"
If cmbViewChoice.ListIndex = 0 Then
frmFirstProcessScreen.emp_id = txt
frmFirstProcessScreen.Show
unload frmSubScreen
ElseIf cmbViewChoice.ListIndex = 1 Then
frmFirstCtqScreen.emp_id = txt
frmFirstCtqScreen.Show
unload frmSubScreen
ElseIf cmbViewChoice.ListIndex = 2 Then
frmFirstClientScreen.emp_id = txt
frmFirstClientScreen.Show
unload frmSubScreen
End If
End Sub
when this code placed in the same form is executed the new form is shown depending on the right if case but the frmSubScreen form is not unloaded.What i mean is the new form is displayed but then i get an error message - "unable to unload within this context" run time error 365.
Can anyone figure this out?Any help will be appreciated.
Thanks a lot
How To Hide Form Instead Of Unload Form When I Click On The Close Button [x]
i have a small programming problem here....
each time i click on the controlbox close button the form will close and restart a new form when i call upon it again
however i want to retain the form input tat the user key in
is there a code such tat upon clicking the close button [x] on the top right hand corner, the button will only hide my form and not unload the form?
is anyone out there able to help me come up with the source code as my project date due is approaching and i dun have much time.
thanks
Jean
Detecting Changes In The Data Entered In A Form On Form Unload
I have a form with several textboxes. Data can be inserted (created new) or modified through this form. Now what the need is :
if a user enters some data in the form (either in new entry mode or modify mode) and then tries to close the form without saving the entered data, i need to check whether any data has to be saved or not? if data has to be saved then pop up message do you want to save changeS?
how can this be done?
rgds,
Unload Open Form On Loading A New/other Form
I have made a menu in an MDI form and under the menu there are seven sub menus. each sub menu opens a form. Structure is like this:
Open Form
...show form1
...show form2
...show form3
and so on.
I want that if a form is already open say form 1 and if the user opens other form say form 3 then form 1 should unload automatically.
Similarly if the user then opens form 7 then fom 3 should unload automatically.
Unload A Form In Form Load Event
i want to unloas a form in form load event
I open some database in form load event,but if database is not their or any error accures then i have to unload the form
without proceding ahead
how i can do that
please help
Form Unload And Form Show Problem
Hi Everybody,
I using a main form from where i m loading my others forms but when i unload other form and trying to come back on the main form it just got stuck my application get hang. Then ive to pressed Ctrl+Alt+Del and go to task manager and there i dont need do anything ive to closed the taskmanager. my form get back to main form.
Or If i debug that code it run smoothly.
Please help me guy's
Unload Form
ive got a little problem with unloading one form of mine
ive one form with many textboxes to enter data
then you open another form by clicking a commandbutton
the first stays open because the data is needed
after selecting on the second form what happens with the data it closes
but the first stays open
and i dont know how to close it
it has to be closed by the code of the second form
please help me
i tried several solutions but none of them work
Don't Unload The Form
I have created a form with a 'OK' button and a 'Cancel' button. Alongwhich, there are 2 combo boxes which allows the user to choose the month and year respectively.
I have written a error checking VBA code to produce an error message if the user did not choose either of the boxes.
Code:
p = Format(Form.ComboMonth.Value, "mm")
r = Form.ComboYear.Value
If (p = "") Or (r = "") Then
MsgBox "Please Input the required Month and Year."
Exit Sub
End If
however, the form will be unloaded and i have to go into the program again. is there any way to replace the "Exit Sub" statement, such that after the error message is displayed and the user clicks the 'OK' button, it returns back to the form to allow the user to choose the month and year inputs from the form again?
thx for any inputs
Unload 2nd Form
I have 2 forms open. 1 is hidden. I want to close it from the 2nd form but am not doing to well at it. Any help would be appreciated.
Thank You,
Donald
Unload Form
Hallo hi...
I'm having a problem to avoid the user from close the form by clicking the 'x' icon at the right top corner of the form. I want the user to exit the form only by click the exit button. Is there any function or what ever in order to disabled the (x) incon at the top right coner of the form.
TQ
Cannot Unload Form
I have a form with a flash object, whenever I unload that form, I get an error and the app terminates.
what do I have to do to the flash object before I can unload the form??
Form Unload
Is there a way to stop the form unload process
Code:
Private Sub Form_Unload(Cancel As Integer)
If Lblx.Caption = "x" Then
If MsgBox("Are you sure you would like to leave without saving?", 32 + vbYesNo, "Forget to save?") = vbYes Then
Unload Me
Else
'something here about not unloading (Cancel = false?)
End If
End If
End Sub
Unload Form
Confused, need help.
When using
Unload myForm
Should I add
Set myForm=Nothing ?
What Happens if not adding,
since I think that Unload is enough.
Thanks,
Avi.
Unload Form
I would like to make a form that, if you click any item on it, Frame, Listbox, textbox, Form, etc, it will close the form. This can be achieved by putting Unload Me for a click event for every item, but I know there is a way to do a for... next to unload the form with just one Unload Me. Does anyone know what it is?
ESC To Unload Form
I would like to use the ESC key to unload forms in a MDI form.
So if the user has several forms open, they can just hit ESC to unload the form with focus
I tried this, but nothing happen
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 27 Then
Unload Me
End Sub
Can someone give me a hint?
Thanks
Form Unload
I was told by another programmer here, who has gone for the day, to set my form to nothing. He said to put in my unload event the following:
frmForm = Nothing
for each form. I did this and got the following error:
Compile Error: Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic
What am I doing by setting the form to nothing? Clearing that block of memory? Thought the unload me did this? and finally why am I getting a error?
Thanks again !
ErocM
Unload Form
I have an another question. How do I make my program not exit when ever the x is pressed on the top right corner. Instead I want my program to minimize Me.WindowState = vbMinimized.
-Hao Li-
Form Unload
I'm trying to list all the controls for each form in my application. I'm using the forms.add "form name" to add each form and then I'm retrieving each control.
My problem occurs when I try to get rid of each form that I added. The remove method doesn't apply to forms.
Any suggestions?
Unload Form
I know this is basic but I have aform name in a string and I want to unload the form - have tried frm.Name = str then Unload frm etc - I know it must be obvious but its not at the moment !
Unload Form
Hi, I have a form with 2 chekbox in it. The user have to check one of those if he want to continue. If the user press the X in the right corner of the window, I put some code in the Form_unload() to verify that. I open a message box and the user have to choose No if he want to exit the program (that works great) and Yes if he wants to return in the window and check a box. But if the user press Yes, my form is unload.... How can i return to my form without unloading it?
thanks
When Does The Form Unload?
I've built a DLL for an application, but when I close the application I get an application error, saying the memory could not be read. The error only happens on shutdown.
Well, I assume the problem is because I've got some object or variable that is still set to something. I've got classes and forms and in all of them, I try to set all objects equal to nothing.
I also set up MsgBoxes in all the class terminates or form unloads to tell me when they were triggered. I've got one form that never cycles through its form_unload.
Here's my question: will forms automatically unload when I close the application? When, in a class terminate event, I say "Unload frmNewTableManager", will that go to my form code and look for my form_unload procedure and run that? Or is that command different?
If this isn't the problem, does anyone know how to properly clear out all my objects and the such?
Form Unload
with this
Code:
Form_Unload(Cancel As Integer)
what does the cancel mean?
my aim is to test if items that have been selected on the unload form event, giving the user an option to either discard or save their selections with a message box
the exit sub does not seem to work here
any help??
Form Unload
is it possible to point the cross in the top of a form to something other than unload?
Unload A Form In DLL (how?)
Hi guys,
I'm working with a VB6 Form and using a DLL which I created in VB6 ActiveX DLL.
On this Form, I call one method from the DLL, and after calling that method I want my form to be unloaded.
How can I do this?
Thank you.
Unload Form
I see two lines in the VB Code I'm working on:
Unload Form1
Set Form1 = Nothing
My question is, does Set Form1 = Nothing really do anything?
Doesn't Unload Form1 also set the form object to null?
Unload Form
I have form1 and one button with caption 'enter'. I also adding a msgbox in the for form1 Close (X) for comfirmation by the user to exit the program.
Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim msbResponse As VbMsgBoxResult
msbResponse = MsgBox("Are you sure you want to exit?", vbYesNo + vbQuestion, "Confirm Exit")
If msbResponse = vbNo Then
Cancel = -1
End If
End Sub
When I click the X button in form1, I got the conformation. It fine.
But When I hit the enter button in form1 to go to next form,I got the message "Are you sure you want to exit?".How to do that, so that the messge box not appear when I hit the enter button?
Code:
Private Sub cmdEnter_Click()
frmtimer.Show
Unload Me
End Sub
Form Unload
Private Sub Form_Unload(Cancel As Integer)
MsgBox "Please Click Exit to Terminate Program", vbOKOnly, "ERROT"
End Sub
how do i ignore the form being unload by the user instead of click the exit button>?thanks
Form Unload
Hi all,
How to find whether the form is already unloaded?
my requirement is,
Code:
If the form is unloaded already
do nothing
else
unload the form
endif
thanks in advance
Unload Form
my app is an game, and i start with creating a player, were must input your name, and choose a character, and then the game begins, but if i then create o new player, i have it in a meny, then i unload the game form and load the name form, and then the choose character, and the user came to the game form, but theres stil the player from the old player, the old name and so on... why? how can i get så the game form gets the new name and the new character???
Esc Key Unload Form
VB Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)If KeyCode = 27 Then Unload MeEnd Sub
We have a textbox on this form and the from is MDI child true, If the Focus is in the Textbox the Form is not getting unload on pressing the Esc Key
Unload A Form
does anyoe know how can i say unload a form after like 20 sec?
thanks in advance
Form Unload???
i have a program with some sub classed menus to display little icons next to each menu item now the problem is that when the red x in the top right of the forms window is clicked my app just hangs ???? please help
Form Unload
i am getting some problem with form unload.
i found the following code in internet.
but it is not working.
still my form is in memory.
i am setting all the recordsets to nothing in the queryunload procedure.
but still i am facing the same problem
VB Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) ' ' *** universal unload check ' Dim strQuestion As String Dim intAnswer As Integer Dim aryMode As Variant aryMode = Array("vbFormControlMenu", _ "vbFormCode", "vbAppWindows", _ "vbAppTaskManager", "vbFormMDIForm") strQuestion = "Are You Sure?" intAnswer = MsgBox(strQuestion, vbQuestion + vbYesNo, _ aryMode(UnloadMode)) 'queryclose If intAnswer = vbNo Then Cancel = -1 End If
end sub
any suggestions
thanks
Form Unload
hi
i have got a form which if tried to close should get a message wid a yes no. if it is a no then the method should exit
i implemented Form_Unload as well as Form_QueryUnload, but as i exit the method the form gets closed ne way, wat do i do
Form Unload?
hi i have a form that takes up the whole screen, and when the user clicks a button, a smaller form shows up in a certain spot on that form. the problem is that the user can still click things on the larger form. is there a way to make it where the user can still see the form taking up the whole screen but can't click any thing until they have clicked a button on the small form?
Help With Unload Form
Before I unload my form I need to check for the existance of a file in a folder called "wavFiles", if the file is present go ahead and unload the form, if the file is missing alert the user and exit the sub. What is happening is that if the file is missing, I get my alert error but it doesn't exit the sub, it continues to unload the form. How can I change my code to get the result I need.
VB Code:
Public Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If UnloadMode = 0 Then If wavBol = True Then Dim strSearchDir strSearchDir = Dir(App.Path & "" & "WavFiles" & "" & txtGlobalID.Text & ".mp3", vbNormal) If Len(strSearchDir) = False Then MsgBox ("You must convert to mp3"), vbCritical Exit Sub End IfElse If txtFileText = "" Then Dim Msg ' Declare variable. 'Set the message text. Msg = "Are you done recording?" 'If user clicks the No button, stop QueryUnload. If MsgBox(Msg, vbQuestion + vbYesNo, Me.Caption) = vbYes Then ErrorR = mciSendString("close capture", 0, 0, 0) Set objRs = Nothing Set objComm = Nothing Set objConn = Nothing Unload frmAudio frmIntro.txtGreeting.SetFocus Cancel = False Else Cancel = True End If End If End If End IfEnd Sub
Unload Form
Why is my form not unloading when I code "Unload myfrm"??
Unload Form
Hello,
I have a function loading a form, showing it and waiting for it to unload. The problem is that for some reason, after I unload the form, it's not removed from the Forms collection, and so the function can't determine it.
Can someone explain me why the form is in the Forms collection although it's not loaded?
Thanks.
Unload Any Form?
OK, i tried to search for this, but it's so freakin slow, i finally cancelled it...
Anyways.. i have several forms that could be loaded. Basically, certain forms are loaded depending on the initial selection that is made.
The question is, how do you unload all of the open forms EXCEPT for the initial one? And I don't want to create an unload select statement because there are too many cases.
Any help appreciated.
Unload A Form
Does anyone know an API to make a form look like "EXPLOTE" when is unload?
Why Won't The Form Unload?
I have frmMain and frmSetting in my program. frmSetting is loaded by the main form and it gets unloaded after a while. If I load frmSetting for a second time, frmSetting_Load won't fire...
why?!!! Also none of the variables will "die" when I unload frmSetting, they remain their old values when frmSetting is loaded for the second time..
can someone help me to get rid of this problem?!!!
tnx alot
Unload A Form
I have a form(form1) with a global variable that has been declared in a module. I am finished with this form (form1) but I am still using the variable's value throughout the application. Can I take this form out of memory after it used eventhoug I am using a value from this form? How do I do this?
Thanx
Unload Form
Ok, I think I have a real problem. I need to unload my program, I cannou use end. However, if I unload, it dosent stop the program. The only way to stop it without messing up my subclassing is to click the X in the top right corner. Anyone know how I can make a command button do this?
Unload Form Using ESC
how can i unload a active form by pressing escape key without using any other controls?
Form Unload
ok...i have this code
Code:
Private Sub Form_Unload(Cancel As Integer)
gstr_last_used = Now()
Call open_database_options
table.Fields("last_used") = gstr_last_used
End Sub
but this code never executes...i put a stop there..don't work
why is that..
i also tried putting it in terminate
Code:
Private Sub Form_Terminate()
gstr_last_used = Now()
Call open_database_options
table.Fields("last_used") = gstr_last_used
End Sub
HELPP++
--770
|