FastTips: Access Basic and Macros Questions & Answers

PSS ID Number:  Q100845
Article last modified on 08-27-1993

1.00 1.10
WINDOWS

======================================================================
  Microsoft® Product Support Services Application Note (Text File)
          WX0636: ACCESS BASIC AND MACROS QUESTIONS & ANSWERS
======================================================================
                                              Revision Date: 5/93
                                                          No Disk
The following information applies to Microsoft Access, version 1.0.
 --------------------------------------------------------------------
| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY    |
| ACCOMPANY THIS DOCUMENT (collectively referred to as an            |
| Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY      |
| KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO    |
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A     |
| PARTICULAR PURPOSE. The user assumes the entire risk as to the     |
| accuracy and the use of this Application Note. This Application    |
| Note may be copied and distributed subject to the following        |
| conditions: 1) All text must be copied without modification and    |
| all pages must be included; 2) If software is included, all files  |
| on the disk(s) must be copied without modification [the MS-DOS®  |
| utility DISKCOPY is appropriate for this purpose]; 3) All          |
| components of this Application Note must be distributed together;  |
| and 4) This Application Note may not be distributed for profit.    |
|                                                                    |
| Copyright 1992-1993 Microsoft Corporation. All Rights Reserved.    |
| Microsoft and MS-DOS are registered trademarks and Windows         |
| is a trademark of Microsoft Corporation.                           |
 --------------------------------------------------------------------
    Q. How can I run macros from Access Basic?
    A. The following are three suggested ways to run macros from
       Access Basic:
 - Create the macro using the macro editor and then call it from your
   Access Basic procedure. For example, if you create a macro called
   Macro1, you can call the macro from a procedure with the following
   command:
             DoCmd RunMacro "macro1"
 - Call the macro from the Immediate window using the same syntax as
   you would in Access Basic. Again, the syntax is as follows:
             DoCmd RunMacro "macro1"
 - Use DoCmd to run a macro action, rather than creating a macro
   specifically for that action. The basic format of DoCmd is as
   follows:
             DoCmd <Action> <Argument1>, <Argument2>
       For more information on DoCmd, RunMacro, and macro actions,
       please refer to the User's Guide and "An Introduction to
       Programming"; or, search Help on the keywords "DoCmd" and
       "Expressions in Macros and Actions".
2.  Q. When should I use the Variant data type?
    A. Use the Variant data type if you are unsure what type of data
       you are working with. When you use the Variant data type,
       Microsoft Access evaluates the data and then handles it
       appropriately. Using variants avoids the step of assigning data
       types to variables and manually converting data types in your
       programs. Further, when you store table data in variables,
       using variants eliminates complications with NULL data values.
3.  Q. How do I comment out a macro action?
    A. With the macro in Design view, choose Conditions from the View
       menu. This adds the Condition column to the macro design. Type
       "false" (without the quotation marks) on the condition line for
       the macro action you want to comment out.
4.  Q. How do I bypass the AutoExec startup macro when I open a
       database?
    A. Hold down the SHIFT key when you open the database to prevent
       Microsoft Access from executing that database's AutoExec macro.

Additional reference words: 1.00 1.10 ivr ivrfax fasttips
KBCategory:
KBSubcategory: