473,406 Members | 2,843 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,406 software developers and data experts.

Too many Forms Open

I am a complete newbie with no code experience. I have a form that acts
as a switchboard. When I click on a button to open a new form, the old
form remains open. This can go on for a few levels and before you no
it, there are 6 or 7 forms open. I would like to be able to click to
open a new form and the old form close automatically. If someone can
either explain modules or code to do this in simple terms, that would
be great. Is this something I will have to program for each command
button individually?

rbp1976

Nov 13 '05 #1
5 1760
docmd.close "<switchboard form>" right after the open command will
close the current form

Nov 13 '05 #2
docmd.close <formname in quotes> right after the command to open the
new form

Nov 13 '05 #3
Ozzone wrote:
docmd.close "<switchboard form>" right after the open command will
close the current form


Would this go as an [Event Procedure] in the "OnClick" properties of
the command button to open the new form (where the ... is?)? These
groups would be nice if you could attach screen shots to visually
explain.

Nov 13 '05 #4
This is the current code:

Private Sub Team_1_menu_Click()
On Error GoTo Err_Team_1_menu_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Team 1 Menu"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Team_1_menu_Click:
Exit Sub

Err_Team_1_menu_Click:
MsgBox Err.Description
Resume Exit_Team_1_menu_Click

End Sub
This is how I think I'm supposed to do it:

Private Sub Team_1_menu_Click()
On Error GoTo Err_Team_1_menu_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Team 1 Menu"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.CloseForm "Training Main Menu"

Exit_Team_1_menu_Click:
Exit Sub

Err_Team_1_menu_Click:
MsgBox Err.Description
Resume Exit_Team_1_menu_Click

End Sub

Didn't work!

Nov 13 '05 #5
Figured it out;

Private Sub Training_Main_menu_Click()

'open training main menu
DoCmd.OpenForm "Training Main Menu"
'Close team 1 menu form
DoCmd.Close acForm, "Team 1 Main Menu"

End Sub

Very simple. I just don't have error code left.

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: BLUE WATER | last post by:
Help, When I am finished entering in data into my form A, I press the save button that saves this new data to a new record. However I would like my other form to open at a specific record, the...
4
by: sparks | last post by:
OK we have it so we can use tables to define skip patterns on our forms. BUT we can only do one form. Public Function skipPattern(currentFrm As Form, Optional currentCtl As Control = Null) As...
6
by: Ayende Rahien | last post by:
Excetremely annoying problem, I've an application with a long startup time. So I created another form with my logo in it to as a splash screen. The splash screen is run from another thread and is...
3
by: stumorgan | last post by:
There is probably an extremely simple answer to this question and I'm just being foolish. I have a main form (let's say FormMain) which opens other forms (let's say Form1, Form2). How do I keep...
4
by: Lewis Edward Moten III | last post by:
I have a file that users can download through a web page protected by forms authentication: Download.aspx?ID=45 and within that file ... FileInfo fileToDownload = new FileInfo(fileName);
11
by: Kevin | last post by:
I've got a timer on my MDI parent form. If there's no mouse movement for a set number of minutes, the Visible property of all open forms is set to False and the Log On form is displayed. I could do...
13
by: Academic | last post by:
I have a MDI form, sometimes child forms and sometimes forms that are neither If I close the app the child forms closing and closed event happens followed by the Mdi form receiving the...
4
by: robert.waters | last post by:
Hello, I have a main form that is maximized when my application loads; this main form contains links to all other forms. I've had to specify the Popup property of these other forms, so that...
6
by: Bob Alston | last post by:
Looking for someone with experience building apps with multiple instances of forms open. I am building an app for a nonprofit organizations case workers. They provide services to the elderly. ...
4
by: nottarealaddress | last post by:
I'm trying to get my feet wet in VB2005 (our new standard at work after officially stopping new development in VB6 about a month ago). I'm working with a simple sql 2005 table of 50 entries, one...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.