Re: how to close form after running code?
From: Bryan Reich [MSFT] (brreich_at_online.microsoft.com)
Date: 04/19/04
- Next message: Cheryl Fischer: "Re: Sending Email using Code"
- Previous message: Brennan: "Programatically Filling 2 Text Boxes"
- In reply to: Lee Rouse: "how to close form after running code?"
- Next in thread: Lee: "Re: how to close form after running code?"
- Reply: Lee: "Re: how to close form after running code?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 19 Apr 2004 11:07:45 -0700
You can fire a proceedure referenced by name in a string by using the Run
command and passing it the name of the proceedure to fire.
i.e. Run( "MyProceedure" )
or
Dim myproc as String
myproc = "MyProceedure"
Run (myproc)
-- Bryan Reich Microsoft Office -- This posting is provided "AS IS" with no warranties, and confers no rights. Use of any included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "Lee Rouse" <leemodeler@yahoo.com> wrote in message news:8135f01d.0404190731.2e7c8e7e@posting.google.com... > I have set a function to run in the On Current event in a form. I want > the form to close after the code is run. I've tried entering the > Docmd.close command in several different form events, but I either get > errors, or the form remains open. > > What code should I use for which event to close the form? > > Better yet, is there a way to run the code which is now being fired > via the form's command button, directly from the underlying parameter > query, thereby eliminating the need for the form? > > I really don't need the form at all. I'm just using it to trigger the > function. > > Thanks, > -leeroi > > "knowing just enough about VBA to be dangerous to myself and others"
- Next message: Cheryl Fischer: "Re: Sending Email using Code"
- Previous message: Brennan: "Programatically Filling 2 Text Boxes"
- In reply to: Lee Rouse: "how to close form after running code?"
- Next in thread: Lee: "Re: how to close form after running code?"
- Reply: Lee: "Re: how to close form after running code?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|