Form Closing.

I have read a  few of the questions and answers in the forum regarding this, 
but to be honest, I have lost the plot with it. 
If I have a switcboard form, from where I navigate to the other forms, how 
do I close the previous form?
Say I go from the switchboard to say to the main input form, then back to 
the switchboard again. Where would I write the code to tell me to close the 
main input form?

As ever any help is gradly received and appreciated. Many thanks.

Cel504


0
Utf
1/26/2010 10:04:06 AM
access.forms 6864 articles. 2 followers. Follow

1 Replies
633 Views

Similar Articles

[PageSpeed] 37

Have a button  to open the second form.

Private Sub cmdOpenForm2_Click9)
DoCmd.OpenForm "Form2"
DoCmd.Close acForm, Me.Name
End Sub


The above code will open form2 then close the switchboard.


Have a button to close form2 and return to the switchboard

Private Sub cmdOpenSwitchboard_Click()
DoCmd.OpenForm "FormSwitchboard"
DoCmd.Close acForm, Me.Name
End Sub


Note: replace Form2 and FormSwitchboard with the names of your forms.
Replace cmdOpenForm2 and cmdOpenSwitchboard with the names of your buttons.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia

"CEL504" <CEL504@discussions.microsoft.com> wrote in message 
news:E6D5BECF-4FDC-49C7-ABDD-ACB5DC67E8A0@microsoft.com...
>I have read a  few of the questions and answers in the forum regarding 
>this,
> but to be honest, I have lost the plot with it.
> If I have a switcboard form, from where I navigate to the other forms, how
> do I close the previous form?
> Say I go from the switchboard to say to the main input form, then back to
> the switchboard again. Where would I write the code to tell me to close 
> the
> main input form?
>
> As ever any help is gradly received and appreciated. Many thanks.
>
> Cel504
>
> 


0
Jeanette
1/26/2010 10:34:07 AM
Reply:

Similar Artilces:

Table to feed form instead of lenghty code?
Hello, I a database that is kind of like an Auction type deal. If a user enters their user ID and click the button, it will automatically display their chosen private ID (or Auction ID). What I want to know is, I have 80 people in my department and the code (only way I know how to do it) will become very long. Can I set up a table with the User ID and Private ID and when the button is clicked, have it read from the table and display the Private ID that way? Below is how I am going to do it if no alternative. Private Sub cmdStatusUpdate_Click() Me.NewBid.Locked = False ...

Year-end Close
I have just joined a company, and need to run a year-end process so that the balances get carried forward into the new financial year. Does anyone know which buttons to push? Thank you. Adrian, Take a look at the following KB article: https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?scid=kb;en-us;888003. It will go through the GL year end closing process step by step and give you a lot of additional information. To access this and other GP knowledgebase articles you will need access to CustomerSource - if you don't already have it, someone in your company or your GP Part...

Excel 2003 Not Closing
Iam evaluating Office Professional 2003. All seems fine, apart from Excel, which will not close! It will open files, and I can close the files, re-open them, save them etc., but I Cannot exit the program itself, which is somewhat annoying! ...

Year End Close #2
It would be realatively easy to print Financial Statements for a new year before closing the prior year. Every GL account has the account type, Bal. Sheet Account or Profit & Loss Account. In the first period of the new year, any trx for a Bal Sheet account, prior to the year end date, would be "rolled forward" into a BBF and inlcuded in the trial balance, TB Worksheet, or Financial Statement. Any P&L type account dated prior to the year end date, would be included in the BBF in the Retained Earnings Account. ---------------- This post is a suggestion for Microsoft, ...

Article on showing Windows style error on MS Access Form
I am building an application with several forms. In the BeforeUpdate event for the form, I will run some data validation routines. If there is an error, I would like to display an error control next to each field containing an error (the exclamation point). The user can then hover over the error control and get an explanation of the error. This is similar to how a normal windows application works. Some time ago, I can recall seeing an article that described the exact technique that I want to use, but I can't find it now. Could someone please point me to the article? Many thanks! ...

2003 Form fields losing formatting in 2007
Hi there, I have some forms, created in Word 2003, which when opened as a .docx, all form fields revert to Times New Roman font but if they are opened as a .doc, they are in the correct font of Arial. Anyone got any ideas why and how I can fix this? Thanks very much. This doesn't make any sense. Documents always open in the format in which they are saved. What *exactly* are you doing? -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com ...

greyed out close button
I have Excel 2002 and cannot figure out why the close button is greye out. Can anyone tell me how to active this button. thank ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com I have a greyed out close button and a co-worker has a greyed out minimize button. If you find out what to do please let me know. Thanks >-----Original Message----- > >I have Excel 2002 and cannot figure out why the close button is greyed >out. Can anyone tell me how to active this...

how do you keep a column in date form
i'm making a spreedsheet in office excel, in column A I have a list of dates. I would type in 4/5 for an date and excel would automatic change the date to 4-Apr. I like this way, but when I got to cell 26, the change will not happen. I type in 4/5 and I get just the number 1 in the cell, for the rest of the cells down, can someone help me. Copy the cell that has the format you like and paste format it to the cells that you want to have the date format. "s2m2" <s2m2@discussions.microsoft.com> wrote in message news:F350F90F-24B9-4B79-BE39-20AB0414015D@microsoft.com......

Printing a single form which has tabs
Hello I have created a form in which I am inputting survey data. There are 5 tab pages in this form. I want to print all 5 tabbed pages. I want to create a button called "Print Record". When one clicks on this button, I want it to print all 5 pages. At the moment, I print one page. Then tab to the second page and print, and so. Can I set it so that one you click on print, you can decide on which page you want to print or print all five pages? Can I do this in code? If this isn't the right section, please direct me. Thank you in advance. Generally spea...

Purchase Receipt posting to closed period
We have a problem with the invoice matching activity in the system in regards to closed G/L periods. For example: - The receiving is done in period 2 (February) - Two weeks later the supplier invoice comes in with a different cost, it is now period 3 (March). Period 2 is now closed The system will flag these transactions and prevent the posting because the period is closed but will "place" them in the master posting with the date from the previous period. So it is smart enough to identify that the period is closed but dumb enough to generate the transactions wi...

Running Access 2003 db in 2007, and a few forms don't work
I have a database that's been updated from at least Access 97 (maybe Access 2, I can't remember anymore) and has been running fine in Access 2003 for years. My client upgraded to Vista with Office 2007. Almost everything in the database works fine, except 3 forms. Each of these forms has a tab control. Two of the forms have subforms on some of the tabs, one doesn't. When I try to open the forms in Access 2007 running on Vista in Virtual PC, I get the error "There isn't enough memory to perform this operation. Close unneeded programs and try the operation again."...

Set form field on double click
I am using MS Access 2003. I have a continuous form that is run off of a query "srbScientific Review". The query's criteria is set to [Enter Last Name] in the LastName field. That part works fine. I get my continuous form that shows LastName, DocID, and Title of Document. I would like to double click on the DocID and have the following happen: 1. Open another form "publications" 2. Set the SRBId field to the DocId field that I double clicked on. PLEASE help. I think I need to bookmark, clone.... I'm very confused. As a kick in the right ...

Customize Task Details Form
Not sure if this is possible. Can I customize the Task Details Form? I'd like to add some more input fields to it. My company has 23 (way too many) columns they'd like to have all schedules populate. I've added the necessary columns to the Gantt view but I dislike tabbing across and not being able to see all the data at once. I figured out how to create a customized entry form but I'd like to display it in the bottom pane of a split view and I can't figure that out. It would be even better if I could start with the default task entry form and modify it...

Error Message upon closing OL2000
Everytime I close OL2000, I get this error message: Any suggestions on how to fix this? Thanks! OUTLOOK executed an invalid instruction in module <unknown> at 0000:017617fe. Registers: EAX=00000000 CS=0167 EIP=017617fe EFLGS=00010297 EBX=01760b48 SS=016f ESP=0056fc3c EBP=0056fc78 ECX=01760b48 DS=016f ESI=0056fc6c FS=298f EDX=00000000 ES=016f EDI=017617fc GS=0000 Bytes at CS:EIP: 8e 30 00 00 00 00 d0 0b 76 01 b1 79 00 00 20 00 Stack dump: 017617fc 01760bec 01760b48 04001097 017617fc 00078300 00000000 00000000 00000000 00000000 00000000 00000000 00000060 00000003 00000000 00000000 ...

Microsoft Form 2.0 Controls in VC causing error
My application developed using VC++6.0 in W2K running well in my development PC (with Visual Studio 6.0 installed). When I run the same application in a client PC without VS installed, I get this error: An unsupported operation was attempted. At last I found out it is caused by the 'Microsoft Form 2.0 commandbutton' and 'Microsoft Form 2.0 Label'. After I removed these controls the application run fine. I have registered the file FM20.dll using Regsvr32 and it show succeeded. May someone help how can I make those controls run well in my client PC? Thanks. ...

My code stops after the record saves....form never closes
Users are going into to update a number, and they want to close the form before the record gets saved, thus losing their changes. I created an Exit button, which should save the record change and close the form. Here's the code: If Me.Dirty Then RunCommand acCmdSaveRecord End If Forms![frmRMSHours]![Act Hours] = Me![Text9] DoCmd.Close If the record is dirty, they press Exit and the record saves. They have to press Exit again and the form closes. If the record is not dirty, the form will close when pressing Exit. What am I doing wrong? To save ...

Move forms in public folders 5.5 to exchange 2003
Hello all, I recently migrated from exchange 5.5 to exchange 2003 using ADC and things were fine. I later deleted ADC and moved Exchange 2003 to native mode. I recently found out that the public folders have not been migrated. I earler used the pfmigrate script in exchange 2003. For some reason it had just created blank folders with no data on it. Now i want to migrate/transfer the public folders content(like forms) from exchange 5.5 to exchange 2003 computer. Please help. Best, Karthik ...

Uploading Form Problem
FP 2003 / win xp / URL of form is : http://www.icingpictures.co.uk/online_order_form.htm Just set up a form and am trying to get it to work - got the following error message... Form Validation Error Please correct the information you provided by following these steps, then submit the information again: * A FrontPage File Upload component is incorrectly configured. Please set the MIME encoding type for the form to be multipart/form-data. Return to the form. I do not usually have problem spublishing - server does have frontpagr extensions - i have tried to look in t...

order enty form
help here is my problem i have a db that tracks orders and i need a form to enter the order number and part number and quantirty. i will need to enter allot of orders at one time so i want to use a comtinuous form to enter the info into the orders table what i want to do is enter the job # and the part number and auto fill the discription and size. i have a part numbert tabel with fields part number, discription size there are too many to use a combo box. i have an order table with fileds job number, part number , discription , qantity, start time end tine, efficentcy, total time , down time, ...

change inbox default form
how do i change the default form for inbox in outlook 2002 sp3? Tools-Forms-Design a form. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Peter Fuller asked: | how do i change the default form for inbox in outlook 2002 sp3? You can make a registry change to substitute your custom form for the default form. See http://www.outlookcode.com/d/newdefaultform.htm#ch...

Select subform's query criteria from form's unbound cbo
I want users to be able to select a name from a form's unbound combo box and that selection to automatically become the criteria for the subform's underlying query, without the parameter box for the query popping up. How do I do this? I'm new to VBA and not an Access 2003 whiz either. TIA for your help! WorkerBee wrote: > I want users to be able to select a name from a form's unbound combo > box and that selection to automatically become the criteria for the > subform's underlying query, without the parameter box for the query > popping up. How do I do t...

Closing orders
After we receive and order, we create the invoice with the create invoice button, however the order is still there as "new" or "pending". Is there any way to "close" the order as having been received? (CRM is expecting that you would be integrated to an accounting system) You could write a manual workflow rule to set the order status to Submitted and order status reason to (whatever); you may be able to get the workflow to trigger on something more useful like creating an invoice, but I haven't tried that Peter "Biyoojok" <biyoojok@gmail...

sub form datasheet
my question is how can i change the color of heading in column and the font size only not data sheet form thank you AFAIK, you *cannot* change the color of column headings in a form in Datasheet view. but you can set the form to ContinuousForms view, and format the form to look like a datasheet, then you'll have full control of the labels used as column headers. hth "a" <youb@hotmail.com> wrote in message news:%23kSLZxb0HHA.4928@TK2MSFTNGP05.phx.gbl... > my question is > how can i change the color of heading in column and the font size only not > data sheet ...

Dialog Form Enabling OK button
Please help with a conceptual problem... I have an unbound dialog form that I call up for the user to enter a couple of values that will then be used for some calculations. I don't want the OK button to enable until all the text boxes are filled in. Normally, I would include a data check routine that would get called from the afterupdate event on each text box. If all the text boxes had a value (that was inside predetermined ranges), the OK button would be enabled, otherwise not. Pretty standard stuff... Now, one pesky user has complained that after he's done entering the last va...

closing a dialog resource derived from CPrintDialog ?
I created a modified CPrintDialog that I call CMyPrinterDialog. I then added a Apply button and hid most of the stuff except what I need to select a printer which is what I was after. It works fine and when I click on the OK button, it does what I want, but I have one problem. When I click on cancel or the close 'x', the dialog closes and then pops up again so that you have to click twice actually before it closes completely. Any idea what I might be doing wrong? Z.K. ...