Charlotte Foust
cfoust at infostatsystems.com
Wed May 19 15:01:01 CDT 2004
Is that actually what you had in your original function? I thought you had something like "Form_Switchboard", which wouldn't work because that refers to the module, not the form. I don't see any reason for the Resume 0 in your error handler, since it should never execute anyhow, and Resume 0 turns off error handling. Charlotte Foust -----Original Message----- From: Mitsules, Mark S. (Newport News) [mailto:Mark.Mitsules at ngc.com] Sent: Wednesday, May 19, 2004 10:25 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Close Switchboard Thank you Charlotte, but...now I'm confused. Can you tell me why these two functions do not behave in the same manner? The first is my original (doesn't work), the second (does work) was converted from the macro you suggested (which also worked, btw). Mark '.Created by: Mark Mitsules '.Created : 5/19/2004 1:07:25 PM Function fCloseSwbd() On Error GoTo Err_fCloseSwbd DoCmd.Close acForm, "Switchboard" Exit_fCloseSwbd: Exit Function Err_fCloseSwbd: MsgBox Err.Description, , "Error in Function Form_Switchboard.fCloseSwbd" Resume Exit_fCloseSwbd Resume 0 '.FOR TROUBLESHOOTING End Function '------------------------------------------------------------ ' macCloseSwbd '------------------------------------------------------------ Function macCloseSwbd() On Error GoTo macCloseSwbd_Err DoCmd.Close acForm, "Switchboard" End 'In the macro, I added a "StopAllMacros" line. macCloseSwbd_Exit: Exit Function macCloseSwbd_Err: MsgBox Error$ Resume macCloseSwbd_Exit End Function -----Original Message----- From: Charlotte Foust [mailto:cfoust at infostatsystems.com] Sent: Wednesday, May 19, 2004 1:42 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Close Switchboard Try building a macro to close the switchboard form and see whether you can call it properly from the switchboard. Charlotte Foust -----Original Message----- From: Mitsules, Mark S. (Newport News) [mailto:Mark.Mitsules at ngc.com] Sent: Wednesday, May 19, 2004 9:15 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Close Switchboard Based on what has been suggested I have: Function fCloseSwbd() DoCmd.Close acForm, "Form_Switchboard", acSaveNo End Function The switchboard button uses the RunCode option to call fCloseSwbd. I set a breakpoint at the entry point of fCloseSwbd, but the code never reaches it. The error I am getting is "There was an error executing the command.". Mark -----Original Message----- From: Mitsules, Mark Sent: Wednesday, May 19, 2004 1:01 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Close Switchboard Maybe I wasn't clear enough:( Or else I am completely missing the point:((((( This is not a regular form. It is an Access generated switchboard. Using the Switchboard Manager, the options for a button are finite...Open Form, Open Report, etc. I'm assuming I need to use the RunCode option in some manner... Mark -----Original Message----- From: DWUTKA at marlow.com [mailto:DWUTKA at marlow.com] Sent: Wednesday, May 19, 2004 12:51 PM To: accessd at databaseadvisors.com Subject: RE: [AccessD] Close Switchboard Yes, on the OnClick event of your 'close' button, just put the code Charlotte posted. 'DoCmd.Close'. When you run it directly on a form, you don't have to tell it what to close. If you run it from a module, then you have to tell it what to close, because a module can't be 'closed'. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Mitsules, Mark S. (Newport News) Sent: Wednesday, May 19, 2004 11:13 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Close Switchboard So you're saying use the RunCode option, create a function like fCloseSwbd() and place DoCmd.Close in there? Didn't work. Did I misinterpret? Mark -----Original Message----- From: Charlotte Foust [mailto:cfoust at infostatsystems.com] Sent: Wednesday, May 19, 2004 11:45 AM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Close Switchboard DoCmd.Close Charlotte Foust -----Original Message----- From: Mitsules, Mark S. (Newport News) [mailto:Mark.Mitsules at ngc.com] Sent: Wednesday, May 19, 2004 7:41 AM To: '[AccessD]' Subject: [AccessD] Close Switchboard I'm drawing a huge blank here. I want a switchboard button that simply closes the form...which will allow the code in Form_Close to run. What is the simplest way to do this? Mark -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com