Re: how to close form after running code?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Bryan Reich [MSFT] (brreich_at_online.microsoft.com)
Date: 04/19/04


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"


Relevant Pages

  • TIP #185: Null Handling
    ... nulls, and command modifications for manipulating them. ... Tcl deals with strings, the universal medium for representing data. ... is know and it is an empty string, but if a respondent forgets to give ...
    (comp.lang.tcl)
  • Re: Determine how Word was launched
    ... inspect the command line used to launch Word. ... Private Declare Function GetCommandLineA Lib "kernel32" As Long ... Public Function GetCommandLineAs String ... Dim lngCmdLinePtr As Long ...
    (microsoft.public.office.developer.vba)
  • Re: Class.getMethod in classs static initializer block
    ... I just wanted to add that I had some similar code for a "command line server" project. ... static private final boolean DEBUG = true; ... {public ReturnCode runCommand(String s) ... public ReturnCode parseLine(String line) ...
    (comp.lang.java.programmer)
  • Re: New "base document" available
    ... How to go about retrieving command line parameters? ... the command line arguments (and environment variables) ... Keyword and positional parameters can be mixed in the same command line. ... clp-name points to a string containing "P1" ...
    (comp.lang.cobol)
  • A plan for handling command line options
    ... Getopt is meant to be used by calling it once for each command ... In each case the first argument is an option string and the ... provide an error handling interface that the user can access. ...
    (comp.programming)