473,396 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Close a form when opening another

1
I am new to this programming stuff, first off, im trying to figure out how to have your initial form close once the user opens the second form. so far all i have is form.show, but that just opens a second form, i want it to close the first form as well. any ideas?
Oct 12 '07 #1
3 1469
Killer42
8,435 Expert 8TB
I am new to this programming stuff, first off, im trying to figure out how to have your initial form close once the user opens the second form. so far all i have is form.show, but that just opens a second form, i want it to close the first form as well. any ideas?
Form2.Show
Unload Form1
(or Form1.Hide)
Oct 12 '07 #2
vdraceil
236 100+
Form2.Show
Unload Form1
(or Form1.Hide)
this code will load form2 and go on with form2's load event..i dont think it'll unload form1.Its better to unload form1 in form2's load event.
Oct 12 '07 #3
Killer42
8,435 Expert 8TB
this code will load form2 and go on with form2's load event..i dont think it'll unload form1.Its better to unload form1 in form2's load event.
It may well go through Form2's Load event before continuing with the code that invoked Form2. I'm not too sure about the exact sequence there. But it will certainly go ahead and do the Unload or Hide straight after that. Unless you show Form2 modally, in which case control won't return to this code until Form2 is unloaded or (I think) hidden.
Oct 14 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: Roger Withnell | last post by:
I open a new window from the current window to display maps. Several maps of different sizes can be displayed. The function is given the size of the map and adjusts the window size accordingly....
2
by: chanchito_cojones | last post by:
hi there, I am needing some help with a database I am putting together. The database works off of a main Form, which then has buttons on it that will open up other forms. The problem I am having...
1
by: Tim Marshall | last post by:
In using DAO methods, I close recordsets and set them to nothing. When a DAO.database is dimmed, I set it to nothing. I have an application in which a user clicks on a control on a form and a...
3
by: windandwaves | last post by:
Hi Gurus I have a bunch of reports where I have added the following function to the onclose event: =FROC() where FROC() opens a form. However, i found that if i have a report with more...
10
by: Jim H | last post by:
I sometimes get the following error from my Form's Dispose Method when the application is closing: ------------------------------------------------- An unhandled exception of type...
7
by: Paul | last post by:
Hi I have a web application that has a log off selection, just redirects the browser to a form with a label displaying you are loging off. In part of the application I open a new window and was...
7
by: Alice | last post by:
Hi, In my program, the user can navigate to many different forms. When they go to the next form, I want the form they have left to close. However, the forms aren't closing. Can anyone tell me...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
4
by: erick-flores | last post by:
Hello I am using an If statement to test if a field = IsNull then close that form and open another one. Here is the code: Private Sub Form_Load() If IsNull(Me.loc_fk) Then MsgBox "This...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.