Copyright: This file was created by Don Funk


AccKB
Microsoft Access Knowledge Base

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 800+ articles that relate to the Microsoft Access Relational Data Base for Windows.  These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of June 20, 1993.  New and updated articles can be found on both CompuServe and GENIE.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRACC), References, and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

New Articles Since last KB-ACC.HLP(Dated January 14, 1993)

New Articles Since last KB-ACC.HLP(Dated Febuary 28, 1993)

Tables

Queries

Forms

Reports

Macros/Modules

Import/Export/Attach

Multi-user/Network

OLE/DDE

SQL Server/ODBC

Security

Setup

Third Party

Misc


Tables/DB Design

INF: Access Table Structure is Variable Length

INF: Copying and Pasting Text in a Property Sheet

INF: Creating a New Linking Column Between Existing Tables

INF: Currency is Significant to Four Digits

INF: Deleting Duplicate Records from Two Tables

INF: Differences Between Native and Attached Tables

INF: Empty Table Created by SELECT INTO with No Matching Rows

INF: Enforcing Transactions on Attached SQL Server Tables

INF: Error MSG: "Unable to connect to data source"

INF: Exporting a Btrieve Table W/O an Existing Xtrieve FILE.DD

INF: Field Size of 0 Treated as 255

INF: General Number Format Ignores Decimal Number Setting

INF: Hiding Rows and Columns in Tables

INF: How to Abort Creating a Field in Table Design

INF: How to Create a Multiuser Custom Counter

INF: How to Delete a Table Programmatically Without DoMenuItem

INF: How to List the Related Tables in a Database

INF: How to Remove Relationships

INF: How To Update a Table Based on Values in a Second Table

INF: Identify Records with Duplicate Data in Primary Key

INF: Maximum Number of Rows in Table When Counter is the Key

INF: Microsoft Access Does Not Use Record Numbers

INF: Nulls Allowed in Foreign Key With Ref. Integrity

INF: Pasting Columns to the Clipboard in Access

INF: Restrictions on Compound Indexes

INF: Troubleshooting Access Setup and Installation

INF: Use Append Query to Set Initial Value of Counter Field

INF: Validating Data with Values From Another Table

PRACC9210: '#' Appears in Attached Table Name in Error Message

PRACC9303: Can't Add Counter Columns to Tables w/ > 4 MB Data

PRACC9303: SHIFT+HOME Does Not Select All the Text

PRB: 'Fieldname' Isn't an Index in This Table

PRB: Access Format Memo Field Truncates to 255

PRB: Can't Create Two Relationships Between Same Tables

PRB: Cannot Undo Property Settings in Table Design Mode

PRB: Cannot Use "y/n", "t/f" in Yes/No Field

PRB: Column Widths in Table Design not Saved

PRB: Empty Table List When Attaching Btrieve Table

PRB: ErrMsg: Couldn't Open Table MSysAccounts

PRB: Error Message: Couldn't Find Input Table or Query

PRB: Grid Lines Not Visible In Table Datasheet View

PRB: Moving Row Down One Grid in Table and Macro Design

PRB: MS Access Short and Medium Time Formats Have Leading Zero

PRB: Table Design Doesn't Check Validity of Default Value

PRB: Table Design Edit Menu Commands Grayed Out

PRB: Tables Are Not Browsed in Primary Key Order

PRB: ValidationRule Parses Function Name w/o Parens to String

PRB: Weekday Disappears While Editing Long Date Format Field


Queries

INF: A Query Within a Query to Simulate a Sub-select

INF: Access Not Prompting for Second Parameter in Query

INF: Cannot Group on Memo or OLE Object in Query

INF: Cascading  Updates

INF: Colon in Field Name Causes Error with Query

INF: Converting Null Criteria for a Query by Form

INF: Copy/Paste Operations from Forms to Queries

INF: Creating Result Equivalent to SQL UNION Operator Result

INF: Criteria Parameters Require Concatenated References

INF: Determining the Existence of a Query in Access

INF: Dynamic Counter in a Query

INF: Exporting Queries to ASCII

INF: How to Create Parameter IN() Statement

INF: How to Force a Cascading Delete

INF: How to Use a Query to Filter Unique Data

INF: Join Type Mismatch Errors Caught at Runtime

INF: Like vs. "=" with Wildcard Characters in Query Searches

INF: Limit of AND's in SQL Select Statement

INF: Number of Time a Custom Function Executes in a Query

INF: Operators as Field Names in Query Cause Error Message

INF: Parameter Queries, Wildcards, and SQL Server

INF: Parameter Queries Are Not Supported As DDE Topics

INF: Passing Values from a Form to a Parameter Query

INF: Performing an SQL Bulk Action Query from Access Basic

INF: Print a Sequential Number For Each Detail Line

INF: Queries Sort by Order of IN() Parameters

INF: Query Window Doesn't Always Scroll to Record

INF: Returning Case Sensitive Match in Queries

INF: Sample Preview Ignores Query

INF: Separating Full Names Into Two Fields in a Query

INF: Sorting Text Fields With "A", "An", "The" in Text

INF: Sorting/Grouping a Query Using a Portion of a Field Value

INF: Syntax Error Message May be Due to SList Setting

INF: Unsupported SQL Keywords Not Listed in Access

INF: Upper limit on QueryTimeout and LoginTimeout

INF: Use Append Query to Set Initial Value of Counter Field

INF: Use of Constants as Field Names in a Query

INF: Using '<' and '>' and '=' Operators in Query Parameters

INF: Using a Subtract Query to Find Unmatched Records

INF: Using Multiple Copies of the Same Table in a Query

INF: Using Parameterized Queries in Access Basic

INF: Using the LIKE Operator with Parameter Queries

PRACC316: Can't Paste Column If Focus Is on One Cell in Query

PRACC9211: Err Msg: Data has changed operation aborted

PRACC9211: Unique Values Only Property Selected May Show Dupli

PRACC9212:  GPF When Form Query Contains Financial Functions

PRACC9301: Arrow Keys Don't Scroll Grid in QBE Grid

PRACC9302: Running Delete Query Gives Misleading Error Msg

PRACC9302: Syntax Error When "(" is First Chr in Criteria Cell

PRACC9303: Descending Sort Query Returns Wrong Number of Rows

PRACC9303: GP Fault on Update Query Due to Query Design Option

PRACC9303: User with Full Permissions Cannot Run Query

PRACC9304: Query Progress Meter Reports Status Incorrectly

PRB: "Field0" Appears in a Query But Not in the Source Table

PRB: Access Cannot Paste Entire Column in Query Grid

PRB: Append Query Results in Duplicate Counter Numbers

PRB: Can't Exit Extend Mode in Parameters Dialog Box

PRB: Changed Field Names In Table Are Not Reflected In Query

PRB: Column in QBE Grid Will Not Lose Focus When Click

PRB: Criteria Sections Combined into Same Column in QBE Grid

PRB: Ctrl+C Does Not Copy SQL Statement

PRB: Err Msg: Too Many Expressions in Distinct Output

PRB: ERRMSG: Query must have at least one output field

PRB: Error Message: Couldn't Find Input Table or Query

PRB: Expression in Query Grid Doesn't Show All Text

PRB: Form Displays Data from Deleted Field in Query

PRB: Incorrect Action Query Message Box Text

PRB: Incorrect Characters in Crosstab Query Column Headers

PRB: Join Is Broken by Value(s) in Fields '[Field Name]'

PRB: Load From Query Dialog Title Does Not Match Menu

PRB: Long WHERE Clause Is Truncated After View SQL Command

PRB: Make-Table Query Causes Existing Table to Be Deleted

PRB: No Implicit Parameters on CrossTab Queries

PRB: One Side of Join Line Not Attached to Table

PRB: ORDER BYs Must Be Output Columns in DISTINCT Queries

PRB: Properties Don't Reset Between Crosstab and Make Table

PRB: QBE Grid Disappears on Highlight and Delete

PRB: QBE Grid Disappears When Selected and Deleted

PRB: Query Design Status Bar Does not Have Help Message

PRB: Query Tool bar and Menus Not Updated Concurrently

PRB: Referential Integrity Error With Shared Databases

PRB: Sizing Rows and Columns to Zero Works Differently

PRB: Strange Characters Appear When Pasting in the Query Grid

PRB: Troubleshooting Out of Memory Errors in Queries

PRB: Update Queries Do Not Check Validation Rules


Forms

INF: "Form is read only" error

INF: '#Name?' or Control is Blank on Form Based on a Query

INF: Access Saves Printer Information with Each Form/Report

INF: AccessWizards Button Grayed Out

INF: Adding a New Record to a Combo Box with a Double-Click

INF: Allowing an Ampersand to Appear in a Caption

INF: Automatic Date Fill When Tabbing Out

INF: Automatically Open a Combo Box Upon Entry

INF: Border Widths Not Supported with Raised or Sunken Effects

INF: Calculated Fields Must Be Shown to Perform Calculations

INF: Calculating a Credit Card Expiration Date

INF: Can't Change Borders of Up or Pressed Down Controls

INF: Changing the RowSource of a ListBox/ComboBox at Runtime

INF: ComboBox On Toolbar Do Not Use Window Background Color

INF: Concatenating Fields in a Text box to Remove Blank Lines

INF: Converting Null Criteria for a Query by Form

INF: Converting Null Criteria for a Query by Form

INF: Copy/Paste Operations from Forms to Queries

INF: Creating a Duplicate Function for Repetitive Data Entry

INF: Creating a Proper Function for Data Entry

INF: Creating Custom Navigation (VCR) Buttons on a Form

INF: Custom Menus Cannot Be Implemented with Pop-up Forms

INF: Default Auto Label and Add Colon Properties

INF: Delete Command on Form Open if Counter has Focus

INF: Displaying List or Combo Boxes with More Than One Field

INF: Displaying Start, Finish, and Elapsed Times on a Form

INF: Double-click Also Executes OnPush Twice

INF: Double-Clicking on a Control Moves the Control Unintentio

INF: Easy Way to Add Items to the Help Menu

INF: END Key Behavior in Edit Boxes

INF: ENTER in Text Box Does Not Move to Next Line

INF: Error Msg: Can't Hide the Control that Has Focus

INF: Extend Mode and ESC in Form View

INF: Filling a Multiple-Column List Box by Using Access Basic

INF: Filter Values to Appear in a Combo Box

INF: Flexible Formatting of Phone Numbers

INF: Form Must Close for Modal & Popup Settings to Take Effect

INF: Form OnOpen Event May Not Set Values of Unbound Controls

INF: Form Sizing Grid Accepts Non-Integer Values

INF: Form View Allowed When ViewsAllowed Set to Datasheet

INF: Formatting Axis Labels in Graphs

INF: Four Ways to Goto a Record from a Combo Box Selection

INF: Freestanding Labels Do Not Appear in Datasheet View

INF: Graph May Not Hold Formatting

INF: Headers On Non-Continuous Forms Disable Scroll Bar

INF: Height/Width Settings Don't Affect Size of Objects

INF: Horizontal Sizing Controls Availability on Controls

INF: How to "Freeze" a Record on a Form

INF: How to Change Default Template for Forms and Reports

INF: How to Change the 'Microsoft Access' Window Caption

INF: How to Confirm Editing of a Field

INF: How to Create a Password Textbox

INF: How to Create a Query By Form

INF: How to Create Synchronized Combo Boxes

INF: How to Determine if a Form is Minimized

INF: How to Determine What View a Form is Displayed

INF: How to Dim (Gray) Menu Items with Access Basic

INF: How to Find the Difference Between 2 Time Values

INF: How to Hide the Database Window at Startup

INF: How to Manipulate the Microsoft Access Window

INF: How to Modify the Toolbar in Microsoft Access

INF: How to Place User Login Name in Title Bar

INF: How to Position Microsoft Access on the Screen

INF: How To Print Duplicate Labels

INF: How to Reference Control/Fields on Subforms

INF: How to Remove a Form's Menu Bar

INF: How to Remove the Caption on a Form

INF: How to Send the Contents of a Control w/SendKeys

INF: How to Show Field in Datasheet but not in Form View

INF: How to Simulate Changing the Record Source of a Form

INF: How to Synchronize Two Combo Boxes on a Form

INF: How to Take a Button Out of Tab Order

INF: How to Use a Toggle Button to Hide and Display a Subform

INF: Inconsistent Save and Save As Menus with Forms

INF: Incrementing the Number Portion of String

INF: Insert Object from File Dialog Missing 'All Files'

INF: Limit to List Set to Yes Needs a Unique Entry

INF: Making a Subform Uneditable and Unenterable

INF: Making ENTER Add Lines in a Text Box

INF: Maximizing, Minimizing, and Restoring Access in Modules

INF: Microsoft Access Does Not Use Record Numbers

INF: Minimized Popup Forms Cannot be Easily Restored

INF: Misleading Documentation for Cancel Property

INF: Mouse Click Not Turning Off Extend (Selection) Mode

INF: Multiple Selection List Box Example

INF: OLE: New Graph Object Frames are Blank

INF: OnCurrent Is Not Triggered on Unbound Forms

INF: Ordering of Items on Graph

INF: Passing Values from a Form to a Parameter Query

INF: Removing alpha characters from an alpha/numeric field

INF: Requery, Repaint, and F9/Records Refresh

INF: Round or Truncate Values to Desired Number of Decimals

INF: Row Fix-up in the NWIND.MDB Order Form

INF: Searching for Characters/Strings in Records

INF: Selecting Text in a Text Box from the Left or Middle

INF: Set Focus to a Subform Control Using GoToControl Action

INF: Setting a Default Value to The Last Record Entered

INF: Size To Fit a Label Without Using Layout Menu

INF: Size To Fit a Label Without Using Layout Menu

INF: Transparent Text Boxes Not Supported in Access

INF: Unexpected Behavior with Design Button on Toolbar

INF: Updating a Separate Table When a Value Changes on a Form

INF: Use Row Fix-up Technique to Look Up Info Automatically

INF: Using Access Push Button Controls with Bitmaps

INF: Using Column() for Multiple Fields in Forms/Reports.

INF: Using DDE To Fill A ListBox

INF: Using DLookup to return values to display in forms or rep

INF: Using Microsoft Word to Edit & Spell Check a Memo Field

INF: Using Scroll Bars Doesn't Change Record Pointer

INF: Using the .Parent Property of a Subform

INF: Using the Date/Time Data Type and Elapsed Time Example

INF: Writing Functions to Be Called from Events or Expressions

PRACC1115: ApplyFilter Action Causes Form To Be Read-Only

PRACC9212:  GPF When Form Query Contains Financial Functions

PRACC9212: Datasheet Form Saved as a Report Causes a GP Fault

PRACC9301: Access GP Faults in Datasheet View of a Form

PRACC9301: Incorrect RowSourceType for a combo box may GPFault

PRACC9303: Form Record Selector Buttons Disabled

PRACC9303: GP Fault Referencing Form Dynaset w/ Form Variables

PRACC9303: GP Fault Using Invalid IIf() as ControlSource

PRACC9303: GPF Hiding Control in Form Footer in Datasheet View

PRACC9303: GPF Using OpenForm Action to Hide Modal Pop-Up Form

PRACC9303: SHIFT+HOME Does Not Select All the Text

PRACC9305: Caret Not Painted Correctly In List Box

PRACC9305: GPF Button Caption Text Larger than 2048 Characters

PRACC9306: Help Context ID property does not work in subform

PRACC9306: Hidden Subform Maximized If Main Form Is Maximized

PRB:  GoToRecord Macro Doesn't Work on Subform

PRB: #Error Appears Using TRIM() in Forms or Reports

PRB: #Error When ControlName Used in ControlSource Expression

PRB: 'Circular Reference Caused by Alias' Error Message

PRB: 'Show All Records' Menu Choice not Available

PRB: 'Table Exclusively Locked' Error Switching to Form View

PRB: Access Forms May Open And Be Totally Blank

PRB: Access Microsoft Graph Wizard Does Not Run or Syntax Erro

PRB: Access Toolbox Selection Lost When Closed

PRB: Allow Editing Set to Unavailable Does Not Work

PRB: Alt+ Any Key Combination Does Not Work With Active Popup

PRB: Apply Default Doesn't Change Height or Width of Labels

PRB: Arrow Keys Inconsistent Between Forms and Datasheets

PRB: BeforeUpdate Macro Executing Twice

PRB: Bitmap Does Not Display Correctly in Microsoft Access

PRB: Border properties ignored with SpecialEffect

PRB: Can't Change Combo Box Value If ControlSource Is Counter

PRB: CancelEvent Action in OnClose Macro Prevents Exit

PRB: Cannot Scroll Left in Form's Design View with Rulers

PRB: Changes in Subform do not Update in Main Form

PRB: Changing Caption on Title Label Leaves Shadow Unmodified

PRB: Close Action from AB Does Not Trigger OnClose Errors

PRB: Combo Box Displays Only 255 Characters of Memo Field

PRB: Combo Boxes Open When Window Sized to Vertical Minimum

PRB: Concatenation of Memo Fields Creates Text Field

PRB: CTRL+HOME in List Box Moves to First Item in List

PRB: Cursor Position Unchanged in Undo Paste

PRB: Date And Time Format Not Used In Listbox Combo box Contro

PRB: DDE App Name for Access Is Incorrect in Manual

PRB: Edit Find Dialog is Modal in Form View

PRB: Empty Row of List Box can be Selected

PRB: Empty Subforms Will Not Be Visible in Print Preview

PRB: Error in Column Property Help Menu Topic

PRB: Error in Database Analyzer: DTSysQuery already exists

PRB: Error Message: Couldn't Find Input Table or Query

PRB: ESC While Creating Control Doesn't Deselect Control

PRB: Extra Unwanted Information Appears in List Box

PRB: Fields on Popup not Editable when Access is Minimized

PRB: Focus Returns to Control after OnDblClick

PRB: Form Displays Data from Deleted Field in Query

PRB: Form Handle Not Released When Closed with Basic Code

PRB: Form may Lose Focus When Using Shift+F8

PRB: Form Opens Blank Except for Header

PRB: Formatting Yes/No Data Type Example

PRB: From Objects Not Placed on Grid by Wizard.

PRB: Giving Controls Duplicate Name Doesn't Generate Error

PRB: Graph Object Is Dimmed in Form View

PRB: Grid Disappears When Measurement Changed to Metric

PRB: Grid Lines Not Visible in Access When Using Wizards

PRB: HelpContextID Does Not Validate Negative Values

PRB: How to Create a Chart Without a Title

PRB: Insert Object Dirties Record

PRB: Invalid Use of Null Alert Assigning Null Control

PRB: Label Is Placed Within Command Button on Forms

PRB: Layout Changes to Subform in Datasheet View Not Saved

PRB: Leading Space in Property Sheet Entry May Cause Problems

PRB: LimitToList Combo Box Won't Let You Leave After Delete

PRB: List Box Does Not Scroll when Scroll Box Is Dragged

PRB: List Box Not Dimmed When Disabled

PRB: Macro on Subform Control Executed by Main Form

PRB: Navigation Button Unavailable in Main/Subform Wizard

PRB: New Label Controls Inherit FormWizards' Label Text Align

PRB: No Arrows on Scroll Bars if Window Is Larger than Form

PRB: No Error Msg When BoundColumn Greater Than ColumnCount

PRB: Not Enough Stack Memory When Opening Form

PRB: Only One Button Accepts Selection in Yes/No Option Group

PRB: Option Button Has Strange Display in Data Sheet Mode

PRB: Page Hdr/Ftr Is Not Under View Menu

PRB: Pressing CTRL+ALT+SPACEBAR Enters Control's Default Value

PRB: Pressing Home Key in TextBox Does Not Move to Beginning

PRB: Pressing SHIFT While Dragging Not Working on New Control

PRB: Property List Boxes Show Two-Word Options on Two Lines

PRB: Raised and Sunken Check Box and Option Button Controls

PRB: Report or Form Bound to a Table Locks the Table

PRB: Scroll Bars Displayed for a Subform in Datasheet View

PRB: SCROLL LOCK Has No Effect in Form Browse

PRB: Scrollbar Thumbs Don't Move Scrolling Thru a Combo Box

PRB: Select All Not Grayed Even When No Items Are Available

PRB: SetValue Doesn't Trigger Form Events

PRB: Short Label Autosizes to Cursor Size

PRB: Subform not Updated

PRB: Switching Modes Disables Undo

PRB: Text Label Truncated Printing Form on Epson 9-Pin Printer

PRB: Toggle Button with CancelEvent on BeforeUpdate Property

PRB: Toolbars Do Not Use Control Panel Button Background

PRB: Trailing CR/LF's Stripped From Text Box When Retrieved

PRB: Trailing Spaces Automatically Truncated During Data Entry

PRB: Unable to Add All Fields in Graph FormWizard

PRB: Unable to use Edit...Paste in Property Sheet

PRB: Unable to Use Hexadecimal or Octal Values in Properties

PRB: Unfreeze all Columns Does Not Restore Column Order

PRB: Unwanted Record Separator at the Bottom of a Subform

PRB: ValidationRule Parses Function Name w/o Parens to String

PRB: Weekday Disappears While Editing Long Date Format Field


Reports/Printing

INF: "Continued..." Header for Groups on More than One Page

INF: Access Saves Printer Information with Each Form/Report

INF: Accessing a Report Dynaset Requires a .Form Reference

INF: BACK Button Disabled After Selecting Wizard Type

INF: Calculated Fields Must Be Shown to Perform Calculations

INF: Converting Null Criteria for a Query by Form

INF: Currency Format Causes Report Alignment Problems

INF: Default Auto Label and Add Colon Properties

INF: Detailed Explanation of the KeepTogether Property

INF: Eliminating White Space in Reports with CanShrink and

INF: Height/Width Settings Don't Affect Size of Objects

INF: Hints for Printing Mailing Labels

INF: How to Change Default Template for Forms and Reports

INF: How To Print Duplicate Labels

INF: How to Print Only One Record in a Report

INF: How to Specify a Custom Starting Page Number for a Report

INF: Mail Label Wizard Shows Blank Line in Label Size ListBox

INF: No Custom Printer Setup for Mailing Labels Report Wizard

INF: Page Header Will Span Full Width Of MultiColumn Report

INF: Print a Group's Name on a Subsequent Column or Page

INF: Print Total Number of Pages on Each Page of Report

INF: Printing With the HP Laserjet II in Microsoft Access

INF: Screen Fonts May Not Match Printer Output Fonts

INF: Skip Used Mailing Labels and Printing Duplicate Labels

INF: Using Column() for Multiple Fields in Forms/Reports.

INF: Using DLookup to return values to display in forms or rep

INF: Using the Generic Print Driver with Forms/Reports

PRACC9210: Reports Unusable Without Default Windows Printer

PRACC9210: Reports Unusable Without Default Windows Printer

PRACC9212: Datasheet Form Saved as a Report Causes a GP Fault

PRACC9212xxx: Unable to use SQL as a Report's Record Source

PRACC9303: Form Record Selector Buttons Disabled

PRACC9303: GPF When RunningSum Attempts to Evaluate #ERROR

PRACC9303: Screen Redraw Problems When Reordering Groups

PRACC9303: SHIFT+HOME Does Not Select All the Text

PRACC9304: GPF Printing Subreport with Datasheet Default View

PRACC9304: Invalid Results in Subreport When CanGrow = Yes

PRB: "No Default Printer" Error Message When Printing

PRB: #Error Appears Using TRIM() in Forms or Reports

PRB: 'Circular Reference Caused by Alias' Error Message

PRB: Avery Labels 4143, 4160, and 5096 Don't Work on Laser Ptr

PRB: Back and Rewind Buttons Disabled in Wizards

PRB: Bound SubReport Does Not Show DDE Data

PRB: Cannot Process Close Action in Report's OnOpen Property

PRB: Changing Caption on Title Label Leaves Shadow Unmodified

PRB: Choosing a New Printer Resets Some Printer Settings

PRB: Default Width in Report Design Does Not Reflect Margins

PRB: DoCmd OpenReport Opens Rpt in 3 Views or Prints to File

PRB: Error Occurs in Print Preview Without Driver

PRB: Fonts May Change Zooming Out in Print Preview

PRB: FormWizard Labels Placed on Left Margin Grow Down

PRB: Grid Lines Not Visible in Access When Using Wizards

PRB: Incorrect Results Received with DSUM Function

PRB: Mail Label Wizard Cuts Off First Field at Top of Page

PRB: Margins Do Not Relate to Printable Area

PRB: Moving Backward in Report Print Preview Window Is Slow

PRB: Negative GroupOn Interval Reverses Sort Order

PRB: Not Part of Aggregate Function or Grouping

PRB: Overlapped Printing an Access Query Using TTY.DRV

PRB: Print Preview Displays Only First Line of Toggle Button

PRB: Print Quality List Erroneous With Generic/Text Only

PRB: Report Can't Be Opened or Previewed

PRB: Report or Form Bound to a Table Locks the Table

PRB: Report Prints with Blank Page Between Every Printed Page

PRB: ReportWizard Select No Fields for Form Still Shows All

PRB: Toolbar Disappears When Printing a Document

PRB: Toolbars Do Not Use Control Panel Button Background

PRB: Two Labels on Top of Each Other Both Print

PRB: Unable to Specify Label Order in Graph Form Wizard

PRB: Unable to use Edit...Paste in Property Sheet


Macros/Modules

INF:  How To Use Get and Write PrivateProfileString

INF: Add Database Analyzer to Access Help Menu

INF: All Duplicate Macro Names in Macro Group are Executed

INF: Arrow Keys and Mouse Don't Scroll Grid in QBE Grid

INF: Attached Table Must Be Opened as Dynaset from Modules

INF: AutoExec Macro Invoked Only When Database Is Opened

INF: Changing Area Codes Based on a Telephone Number Prefix

INF: Checking for EOF and BOF in macros

INF: Close Action has Blank Line in Object Type Argument

INF: Commenting a Macro Line to Temporarily Disable the Action

INF: Connecting to the First Available Network Drive

INF: Control Names >40 Chars in Access Basic Require Brackets

INF: Conversions for C Data Types in Access Basic

INF: Converting Currency or Number Values into English Words

INF: Converting Julian Dates with Access Basic

INF: Converting Twips to Pixels

INF: CopyObject Appears to Copy Wrong Object

INF: Correct Procedure for Inserting New Field Above Existing

INF: Count() Ignores Null Values

INF: Create a Function to Capitalize Words & Sets of Words

INF: Creating, Debugging, and Using an Access Library

INF: Creating a Proper Function for Data Entry

INF: Creating a Snapshot Is Slower Than Creating a Dynaset

INF: Creating Custom Navigation (VCR) Buttons on a Form

INF: Cut and Paste Removes Blank Lines in Macro's Design View

INF: Data Type of Value Overrides Data Type of Variable

INF: dBASE's REPORT FORM Command in Access Basic

INF: Deciding When to Use Macros and When to use Access Basic

INF: Delete Command on Form Open if Counter has Focus

INF: Determine How Many Instances of Application Are Active

INF: Determining the Existence of a Query in Access

INF: DoCmd and Transaction Processing

INF: DoEvents, SendKeys May Not Be Supported in UDFs

INF: DoMenuItem Action in BeforeUpdate Property Causes Error

INF: Error() Function Does Not Return Detailed Information

INF: Explanation of Option Compare Database

INF: Filling a Multiple-Column List Box by Using Access Basic

INF: Flexible Formatting of Phone Numbers

INF: Function to Calculate Age

INF: Functions to Left and Right Pad Character Strings

INF: Generating a Random Temp File Name

INF: How To Call Functions using a String Variable

INF: How to Change the 'Microsoft Access' Window Caption

INF: How to Change the Caption on the Access Window

INF: How to Check a Menu Item Using Access Basic

INF: How to Convert to and from Unsigned Integers in Access

INF: How To Create a 'Please Wait' Message

INF: How to Create Do While/Do Until Loops in an Access Macro

INF: How to Create Floating Popup Menus for Access

INF: How to Create For Next Loops in a Microsoft Access Macro

INF: How to Determine if a Specific Windows Program Is Running

INF: How to Determine Number of Working Days Between Two Dates

INF: How to Determine when a Shelled Process Has Terminated

INF: How to Determine Whether a Menu Item Is Checked

INF: How to Dial a Phone Number in MS Access

INF: How to Display Immediate Window Without Module Window

INF: How to Find the Difference Between 2 Time Values

INF: How to Force a New Line in a MsgBox Statement

INF: How to Get the Last Two Digits of the Year

INF: How to Implement a Timer in Access

INF: How to Manipulate the Microsoft Access Window

INF: How to Modify the Toolbar in Microsoft Access

INF: How to Obtain Access Startup Directory with API Calls

INF: How to Play .WAV Sounds on Events in Access

INF: How to Position Microsoft Access on the Screen

INF: How to Programmatically Create a Table

INF: How to Retrieve Information From the Clipboard

INF: How to Send Information to the Clipboard

INF: How To Tell If An Object Exists in the Database

INF: How to Use a Toggle Button to Hide and Display a Subform

INF: How to Use Access Basic to Derive Statistical Mode

INF: How To Use The CTL3D.DLL In Your Access Database

INF: How to Use the Windows OpenFile Dialog Box

INF: How to Wait for a Shelled Process to Finish

INF: Incrementing the Number Portion of String

INF: Introduction to Windows Programming for MS-DOS Programmer

INF: Items in a Module Run Menu Are Unavailable (Grayed Out)

INF: Macro to Enter Date Record Was Last Modified

INF: Maximizing, Minimizing, and Restoring Access in Modules

INF: MoveSize Arguments in Wrong Order in Language Reference

INF: OpenDatabase and CloseDatabase Pseudo Actions

INF: OpenTable Action Argument Does Not List Attached Tables

INF: OpenTable Action Ignores Data Mode If Table Open

INF: Passing a Null Pointer to an External DLL

INF: Passing a Single-Byte of Data Using API Calls

INF: Practice Using Object Analyzer Commands

INF: Programming with the Object Analyzer Engine and Utilities

INF: Quit Macro Action

INF: Removing Attached Tables in Access Basic Code

INF: Requery Action Parameter Requires No Brackets

INF: RunApp Action Command has 255 Character Argument Limit

INF: Sample DDE Macro Communicates with Microsoft Excel 4.0

INF: Sending a MAPI Mail Message from Microsoft Access

INF: Setting Form's Dynaset Property Puts Bookmark at EOF

INF: Sorting String Values Based on their Numeric Values

INF: Status Bar Text Too Long for Auto Repeat Property

INF: Temporarily Disabling a Macro Action

INF: The Immediate Window for Something Other Than Access Basi

INF: Tips on How to Debug Microsoft Access Macros

INF: Using Access Basic to Derive a Statistical Median

INF: Using Access Basic to Find Out if a Form Exists in a Data

INF: Using APIs to Make a Modal Microsoft Access Program

INF: Using DLookup to return values to display in forms or rep

INF: Using Microsoft Access Macro to Quit Windows

INF: Using the GetSystemMetrics API Call in Access Basic

INF: Using the Windows 3.1 API to Connect to Network Resources

INF: Using TransferDatabase Macro to Attach to SQL Server Data

INF: Using TransferDatabase to Export to Btrieve Format

INF: Using Undocumented CreateForm(),CreateReport() Functions

INF: View Procedures Sorts Modules Alphabetically

INF: Wizards Part II - CreateControl(), CreateReportControl()

INF: Wizards Part III - DeleteControl, DeleteReportControl,

PRACC9210: Null Boolean Values Default to False

PRACC9210: Opening Objects in Transactions Can Cause Rollback

PRACC9210: StDevP() with All NULL Records Returns #ERROR

PRACC9304: RunMacro May not Work with Large Repeat Count

PRACC9304: RunMacro May not Work with Large Repeat Count

PRACC9305: GPF When Allocating Huge Arrays

PRACC9305: GPF When Allocating Huge Arrays

PRACC9305: GPF When Erase of a String Array in User Type

PRACC9305: GPF When Erase of a String Array in User Type

PRACC9303: GPF Declaring New Object Variable During Break Mode

PRACC9303: GPF Using Empty String with CVDate() or IsDate()

PRACC9303: GPF When Using ListParameters Method on Database

PRB:  GoToRecord Macro Doesn't Work on Subform

PRB: 'Compile All' is Enabled After Saving a Module

PRB: 'Invalid Database Object' Occurs Inexplicably

PRB: Abnormal Action When Debugging Runtime Error

PRB: Access Basic Does Not Support Yes and No Action Arguments

PRB: Access Error Using Edit Find With the Yes/No Data Type

PRB: Alert Appears When it Shouldn't When Running a Macro

PRB: Autokeys Macros with the Same Name Are Still Executed

PRB: Can Close Dynaset Based on Form Multiple Times

PRB: Can't db.OpenTable With Only Read Definition Permission

PRB: Can't Perform OpenTable on an Attached SQL Table

PRB: Can't Refer to Record in Function Called by OnClose Event

PRB: CancelEvent Action in OnClose Macro Prevents Exit

PRB: Cannot Process Close Action in Report's OnOpen Property

PRB: Cannot Rollback Without Closing Database

PRB: Cannot Use DoMenuItem for Open Database or New Database

PRB: Changes to Shared Module Kept Local Until MDB Closed

PRB: Clicking Wizard's Background May Change Focus of Control

PRB: Close Action from AB Does Not Trigger OnClose Errors

PRB: Compile Error When Attempting to Use an AccessWizard

PRB: Concatenation of Memo Fields Creates Text Field

PRB: Couldn't Find Object using OpenQueryDef

PRB: CTRL+BREAK Makes Mouse Disappear With a Module Active

PRB: CTRL+HOME Navigation Problem in Macro Design Mode

PRB: DateAdd 'w' Option Doesn't Work As Expected

PRB: DateDiff "W" Option

PRB: DDE App Name for Access Is Incorrect in Manual

PRB: DoCmd OpenReport Opens Rpt in 3 Views or Prints to File

PRB: Err Msg: Macro '' Not Found

PRB: Error in Database Analyzer: DTSysQuery already exists

PRB: GoToControl to Self in AfterUpdate Ignored

PRB: Hourglass May Not Change After Illegal Function Call

PRB: Incorrect Results Received with DSUM Function

PRB: Insert Object Dirties Record

PRB: Invalid Reference to Field '<Value>' Using SetValue

PRB: Macro Condition Evaluates True if Control Is Null

PRB: Macro Condition Example Using COUNT() Is Incorrect

PRB: No AutoRepeat with GoToRecord/Next and DoMenuItem

PRB: Nulls Not Concatenated with "+" Operator

PRB: Objects Cannot Be User-Defined Data Type Elements

PRB: OnDblClick Macro Requires CancelEvent to Change Focus

PRB: Open Object can be Deleted by Another User

PRB: Out Of Memory When Pasting Text Into Module

PRB: Reason Val() Function Returns Invalid Use of Null Message

PRB: Reserved Words won't Format (Capitalize) in Module Window

PRB: Restore Macro Action Does Not Appear to Work

PRB: RunCode Macro May Not Evaluate Conditions

PRB: Scrolling to Bottom of Module Window Goes Past Typed Info

PRB: Seek Method is Faster Than Find Method

PRB: SendKeys Macro Does Not Run

PRB: Toggle Button with CancelEvent on BeforeUpdate Property

PRB: Trailing Spaces Automatically Truncated During Data Entry

PRB: TransferDatabase Macro Accepts Invalid File Names

PRB: Two Accelerator Keys in Custom Menu Only Show First Key

PRB: Undo Property Setting Appears In Macro Design

PRB: Valid Sum Function Returns #Name? in Calculated Control

PRB: WAIT Argument in SendKeys may not Stop Macro Processing


Import/Export

INF: "ORA-106xx: Message 106xx not found" bug in ORA6WIN.DLL

INF: 'Couldn't Open File' Error Message Using Paradox Table

INF: Access and Fixed Width Text File Format

INF: Access Cannot Attach or Import Paradox 4.0 Tables

INF: Access Table with Time Field Exports Strangely to Excel

INF: Attaching Clipper Tables to Microsoft Access Databases

INF: Attaching to FoxPro Data

INF: Btrieve 6.0 Data Type Does Not Work with Access

INF: Can't Create Relationships with Attached Tables

INF: Correct Syntax for TransferDatabase to dBASE and Paradox

INF: Default Properties Don't Carry Over on Attached Tables

INF: Definitions for Settings in WIN.INI Btrieve Section

INF: Differences Between Native and Attached Tables

INF: Error MSG: "Unable to connect to data source"

INF: Export Tables with OLE Object or Memo Fields to Paradox

INF: Exporting a Btrieve Table W/O an Existing Xtrieve FILE.DD

INF: Exporting Queries to ASCII

INF: Exporting Table to Excel Does not Set 'Database' Name

INF: How Access Can Use R:BASE Files

INF: How Access Variable-Length Fields Export to dBASE

INF: How First Line of Data is Used to Import Delimited Text

INF: How To Get Microsoft Works Files into Access

INF: How to Import a Microsoft Windows Cardfile Data File

INF: How to Place User Login Name in Title Bar

INF: Implementing Counter values on Attached SQL Server tables

INF: Import/Export Accepts Only 24-Hour Time Format

INF: Importing, Exporting, and Attaching FoxPro Data

INF: Importing Fixed Width Text Files

INF: Importing Keyed Paradox Tables Requires .PX File

INF: Importing Several dBASE Databases at Once

INF: Importing the Named Range "Database" from Excel

INF: Importing Word Print Merge Data Files to Microsoft Access

INF: Improved Print Merge Feature In Microsoft Access 1.1

INF: Invalid Spreadsheet Range Returns Error in Access

INF: Mail Merge Using Access Reports

INF: Paradox Tables, Indexes, and Multiple Connections

INF: Removing Attached Tables in Access Basic Code

INF: SQL Server Views Read Only When Attached

INF: Using DataPerfect data in Microsoft Access

INF: Using TransferDatabase to Export to Btrieve Format

INF:"Couldn't find Object <tablename>" with Btrieve files

PRACC9210: Fast Search on Indexed Paradox Column Fails

PRACC9210: MS Access Ignores Paradox Private Directory Rules

PRACC9211: Can't Export Paradox/dBASE Tables

PRACC9302: Error When Import dBASE, FoxPro, or Paradox Table

PRACC9302: Importing Delimited Text Files Strips Off Decimals

PRACC9303: Bad Results Searching Multicolumn Paradox Indexes

PRACC9303: Hang Importing .DBF Files Longer Than dBASE IV Max.

PRACC9303: Hang Importing Large Lotus 1-2-3 Spreadsheets

PRACC9304: Importing Numeric Column Names from Spreadsheet

PRB: "Couldn't Find Installable ISAM" Error

PRB: 'Internal Database Error (-5001)' Using the Btrieve NLM

PRB: Access Adds Date Delimiters When Importing Text

PRB: Access Will Not Import YYMMDD Dates in Text Files

PRB: Btrieve Files Created with 6.0 Btrieve NLM not Supported

PRB: Can't Attach to Paradox Table on Read-Only Drive

PRB: Cannot Edit Access Data Using Query with Attached dBASE

PRB: Corrupt Error Message with Attached Btreive Table

PRB: Creating Multiple New Import/Export Specifications

PRB: ErrMsg: CREATE TABLE Permission Denied in Export to SQL

PRB: Error Opening Attached Table in Shared MDB

PRB: Excel Custom Date Format Not Detected by Import

PRB: Export Table to Other Database Type Doesn't Create Index

PRB: Exporting To Fixed Width Text File Left Justifies Numbers

PRB: GP Fault If MSACCESS.INI Installable ISAM Path Uses "\.."

PRB: Import/Export Setup Cancel Button Cancels Unsaved Changes

PRB: Importing an Informix Delimited Export File

PRB: Internal Database Error (-5207) When Attaching Tables

PRB: Irregular Characters in Attached dBASE IV Memo Field

PRB: Paradox Character Translation Different in Win 3.0 & 3.1

PRB: Rounding Errors Importing/Exporting dBASE IV Numerics

PRB: Strange Characters Appear in Imported DBASE IV Memo Data

PRB: System Defaults Not Showing in Imp/Exp Setup

PRB: TransferDatabase Macro Accepts Invalid File Names

PRB: TransferSpreadsheet Action Doesn't Add File Extension

PRB: Two Users Can Open the Same dBASE Database Exclusive

PRB: Unable to Import Fixed-Width Text Files

PRB: User is Unable to Attach to a Btrieve Database.


Multi-user/Network

INF: Communicating with Microsoft Access using NetDDE

INF: Connecting to the First Available Network Drive

INF: Errors If User Is Disconnected From Server Via NetWatcher

INF: Installing Access on a DEC Pathworks Network

INF: Network Users Can Open Their Own SYSTEM.MDA Exclusively

INF: Page Locking, No Cluster Indexing Support

INF: Using the Windows 3.1 API to Connect to Network Resources

PRACC9303: File Truncation on Password-Protected Servers

PRACC9303: Multiple Users Adding Fields Causes Cross-Linking

PRB: "System Error" Sharing Database on LanMan/Workgroups

PRB: Low Number of Share Locks Can Cause Errors


OLE/DDE

INF: Bound OLE Object is Blank for Invalid Source in Form View

INF: Calling RegQueryValue() to get an OLE Object Class Name

INF: DDE Link Can't Find Data; Opens Second Copy of Server App

INF: Executing an Access Macro from Visual Basic using DDE

INF: Export Tables with OLE Object or Memo Fields to Paradox

INF: Finding the OLE Class of an Embedded Object

INF: How to Execute Macro Actions Using DDE

INF: How to get information into Microsoft Access using DDE

INF: Invalid Spreadsheet Range Returns Error in Access

INF: Links to Formatted DDE Items Result in Text

INF: OLE: New Graph Object Frames are Blank

INF: Parameter Queries Are Not Supported As DDE Topics

INF: Part 1: DDE in Visual Basic to Request Data from Access

INF: Part 2, DDE in Visual Basic to Request Data from Access

INF: Sample DDE Macro Communicates with Microsoft Excel 4.0

INF: Sending the Current Record to Word for Windows with DDE

INF: Shrinking Empty or Null OLE Object on Report

INF: Topics Supported by Access as a DDE Server

INF: Users Can Edit but not Commit Read-Only OLE Objects

INF: Using DDE To Fill A ListBox

INF: Using Sendkeys to Change An OLE Link

PRACC9303: Setting OLE Object Property May Cause GP Fault

PRACC9306: Timeout While Waiting for DDE Response

PRB: DDE App Name for Access Is Incorrect in Manual

PRB: DDE Statement Are Not Valid In Listbox or Combobox Contro

PRB: New OLE Field is Created as Text Box in a New Form

PRB: No Error Given When Linked OLE Object Can't be Found

PRB: OLE Objects Format From Excel Changes After Being Updated

PRB: Random Characters in Text Box Bound to OLE Object Field


SQL Server/ODBC

INF: Access Does Not Recognize SQL Server Double Indexes

INF: Determining the Version of Catalog Stored Procedures

INF: Exporting to SQL Server Does Not Create Indexes

INF: How Access Handles Logins to Attached SQL Tables

INF: How Access Uses SQL Server Connections

INF: How to Get SQL Pass-Through Functionality Using Q+E

INF: ODBC Setup for Access and SQL Server

INF: Query Optimizing Tips for Attached SQL Database Tables

INF: Requirements to Connect to Sybase SQL Server

INF: SQL Server Triggers and Key Values to and from Access

INF: SQL Server Views Read Only When Attached

INF: Stored Procedures for Microsoft and Sybase SQL Server

INF: Strange Stored Procedures Found in SYSOBJECTS Table

INF: Using Access Basic to Derive a Statistical Median

INF: Using TransferDatabase Macro to Attach to SQL Server Data

INF: Using WIN.INI & ODBC.INI When Attaching SQL Server Table

PRACC9304: SQL Delete Triggers Function Incorrectly

PRB: Can't Perform OpenTable on an Attached SQL Table

PRB: Connection Not Open Error Message

PRB: Data Source Not Found, No Default Driver Found Error Msg

PRB: Driver Can't Be Found Error When Attaching SQL Server

PRB: Err Msg: Unable to load communication module

PRB: ErrMsg: CREATE TABLE Permission Denied in Export to SQL

PRB: GP Fault Using an Out of Date ODBC Driver

PRB: No Field List if Form is Based on SQL Statement

PRB: Operation Stops when Editing Attached SQL Tables

PRB: Query Fails when Linked SQL Server Table Can't Be Found

PRB: SQL Data Sources Dialog Box Lists No Data Sources

PRB: SQL Tables Are Read Only Without a Unique Index

PRB: Stored procedure 'PROCEDURE' not found -- Error Message

PRB: Troubleshooting "ODBC - couldn't find ODBC.DLL" Error

PRB: Unable to Connect to Attached SQL Server Table Error Msg


Security

INF: Finding Out What User You Are Logged

INF: No Permission to Modify Data in a Table

INF: Planning Database Security

INF: Security Settings for Modifying Data in a Query Dynaset

PRACC9303: Password Is Case Sensitive But Verification Is Not

PRB: Can't db.OpenTable With Only Read Definition Permission

PRB: No System Table Permissions After Admin User Deleted

PRB: Removing User Admin from Admins Group Can't be Reversed

PRB: Unable to Change Permissions (Security)

PRB: User with Full Permissions Can't Change a Query


Setup

INF: Access 1.0 Disks 1-4 Contents (5.25 inch, 1.2 meg)

INF: Access 1.0 Disks 5-9 Contents (5.25 inch, 1.2 meg)

INF: Access Workstation Setup (/N) Instructions Are Confusing

INF: Custom Setup May Show Zero or Negative Disk Space Needed

INF: Hourglass in Setup Changes to Pointer During Copy

INF: Installing Access From A Diskless Workstation

INF: Microsoft Access 1.0 Disks (3.5 inch, 1.44 meg)

INF: Setup Options Dialog Box Lists Disk Space Info Twice

PRACC9303: Setup Leaves MS-SETUP.T Directory and Files on Disk

PRB: ErrMsg: Cannot Write Readme.txt

PRB: Error Message: Must Run SETUP /A Before Running SETUP

PRB: Not Enough Memory To Run Setup

PRB: Setup Problem Regarding the COMMDLG.DLL File and MS Acces

PRB: Setup Program STFSETUP.EXE Causes GP Fault


Third Party

INF: 'Couldn't Open File' Error Message Using Paradox Table

INF: Access Cannot Attach or Import Paradox 4.0 Tables

INF: Access Databases Truncated w/ LAN Manager 2.1a & Earlier

INF: Attaching Clipper Tables to Microsoft Access Databases

INF: Attaching to FoxPro Data

INF: Btrieve 6.0 Data Type Does Not Work with Access

INF: Converting DataEase 4.2 files to Microsoft Access

INF: dBASE SET DELETED Characteristic in Access

INF: Definitions for Settings in WIN.INI Btrieve Section

INF: Err Msg: Operation Not Supported on Paradox Table...

INF: Export Tables with OLE Object or Memo Fields to Paradox

INF: Exporting a Btrieve Table W/O an Existing Xtrieve FILE.DD

INF: Exporting Table to Excel Does not Set 'Database' Name

INF: How Access Can Use R:BASE Files

INF: How to Get SQL Pass-Through Functionality Using Q+E

INF: Importing Keyed Paradox Tables Requires .PX File

INF: Importing Several dBASE Databases at Once

INF: Importing the Named Range "Database" from Excel

INF: Norton Desktop 1.x Is Not Compatible with Access

INF: Paradox Tables, Indexes, and Multiple Connections

INF: Using Data From Access In A Word For Windows Print Merge

INF: Using TransferDatabase to Export to Btrieve Format

INF: Windows for Workgroups, Novell, SQL Server, and Access

INF:"Couldn't find Object <tablename>" with Btrieve files

PRACC9302: Error When Import dBASE, FoxPro, or Paradox Table

PRB: Btrieve Files Created with 6.0 Btrieve NLM not Supported

PRB: Can't Attach to Paradox Table on Read-Only Drive

PRB: Corrupt Error Message with Attached Btreive Table

PRB: Empty Table List When Attaching Btrieve Table

PRB: Excel Custom Date Format Not Detected by Import

PRB: Irregular Characters in Attached dBASE IV Memo Field

PRB: Microsoft Access GP Fault with ATI Ultra Video Card

PRB: Out of Disk Space Error Makes Paradox Table Unusable

PRB: Stacker 3.0 CHECK.EXE Reports Database Files as Corrupt

PRB: Two Users Can Open the Same dBASE Database Exclusive

PRB: User is Unable to Attach to a Btrieve Database.


Misc

FastTips: Access Basic and Macros Questions & Answers

FastTips: Database Structure Questions & Answers

FastTips: Forms Questions & Answers

FastTips: General Information Questions & Answers

FastTips: Querying Questions & Answers

FastTips: Reporting Questions & Answers

INF: Access 1.0 (rel. 1/14/93) Disks 1-3 Contents 3.5" 1.4 meg

INF: Access 1.0 (rel. 1/14/93) ODBC Disk Cont. 3.5" 1.44 Meg

INF: Access 1.0 (rel.1/14/93) Disks 4-6 Contents 3.5"1.44 meg.

INF: Access NWind Sales by Totals by Amount

INF: Additions to User's Guide Appendix A, MS Access Specifica

INF: Can't use Analyzer.MDB as Output Database from Analyzer

INF: Changing Read-Only Properties at Runtime

INF: Common Dialog Boxes Allow Only Lowercase Typing

INF: Commonly Asked Questions About Access Version 1.0

INF: Couldn't Find SYSTEM.MDA or UTILITY.MDA File

INF: CueCards Started Outside Access Does Not Work

INF: Cut/Paste for Immediate Window and SQL Window

INF: Database Normalization Basics

INF: Defragment and Compact Database to Improve Performance

INF: Disk image of Companion Disk

INF: ERR MSG: Couldn't Open File '<database name>'.

INF: Error Message "Unable to Recover"

INF: Expanded Size of the Companion files

INF: Hewlett-Packard Dashboard GPF with Microsoft Access

INF: How Access Deletes Objects from a Database

INF: How NWIND.MDB Employee Field Photographs Were Created

INF: How to Change the Font for the Zoom Box

INF: How to Make Access Opening Screen Display

INF: How to Open UTILITY.MDA

INF: Initial Size of Every MDB File is 64K

INF: Install Process of the Companion Disk

INF: Microsoft Access is Pen Compatible but not Pen Aware

INF: Microsoft Access Performance Enhancement Recommendations

INF: NWIND Example Has Wrong Number for Dlookup Ship Postal Code

INF: Older Versions of Shared DLLs Cause Problems with Access

INF: On-Line Help Incorrect for Sigma Button

INF: Opening Databases Read Only Causes Information Message

INF: Recent File List will Display Deleted .MDB Files

INF: Recovering MDB File Larger Than the 128-Megabyte Limit

INF: Running MS-DOS SHARE with Windows for Workgroups

INF: Shift+Enter Key Combination vs Ctrl+Enter

INF: Short Description of a Dynaset

INF: System Objects Retain System Object Properties

INF: Tile and Cascade Items Inconsistent with Program Manager

INF: Use CTRL+M to Open Objects in Design Mode

INF: Using a Subtract Query to Find Unmatched Records

INF: Using Data From Access In A Word For Windows Print Merge

INF: Using SHARE.EXE with Microsoft Access

INF: Using WordPerfect Print merge Secondary Files in Access

PRACC1405: System Hangs When Minimizing Access Window

PRACC9110: Cannot Unhide Windows After Out of Memory Message

PRACC9210: Find Toolbar Button Not Grayed After Pressing

PRACC9210: Transaction Limit Can Cause "Out of Memory" Error

PRACC9211: Cannot Cascade or Tile with 50 Windows in Access

PRACC9211: Problems with Edit/Find... Dialog Box

PRACC9212: GPF With DEBUG Windows Using PPCL5A.DRV

PRACC9212: GPFs Using Non True Types Fonts With 8514.DRV

PRACC9303: Access Cue Cards Don't Use Standard Windows Menu

PRACC9303: Error: Not Enough System Resources in Access

PRACC9303: Orders Form Doesn't Print/Preview SubTotal & Total

PRACC9304: Cue Cards Can't Be Started Because Incomplete Setup

PRACC9304: TrueType Fonts Shift Vertically on HP4 Printer

PRB: '|' Isn't A Valid Path Error Message on Start

PRB: 'Couldn't Change Working Directory

PRB: 'Couldn't Find Object [Object Name]'

PRB: A '#' Appears in Place of a '.' When Referring to a Filen

PRB: Access Appears to Hang During Compact

PRB: Access Can Not Find DESKEDIT.EXE

PRB: Access Database Analyzer Error Message

PRB: Access Toolbox Selection Lost When Closed

PRB: Access Trims Spaces Off Database Names

PRB: Alert With Wrong Filename Given When Opening File Copied

PRB: All Data 'Lost' When Doing Save As from Design View

PRB: Arrange Icons do Not Locate Icons in Correct Place

PRB: Arrange Icons Doesn't Work on More Than 40 Windows.

PRB: Can't Check if Current Database Is Opened Exclusively

PRB: Cannot Install Cue Cards Without Installing Help

PRB: Change Option Affects Only One Instance of Many of Access

PRB: Companion Disk install and Out of Disk Space

PRB: Control Menu Move Command Requires Keyboard Input

PRB: Current Record Doesn't Change Immediately on Replace All

PRB: Database Window Loses its Focus

PRB: Design Can Occur While Machine is Attempting Browse

PRB: Disabled Buttons Not Visible with ATI 1280x1024

PRB: Err Msg: Couldn't Update Currently Locked by User

PRB: Error in Column Property Help Menu Topic

PRB: File Rename Dialog Still Enabled When No Filename Given

PRB: Floating Objects in Access Cause Unusual Effects

PRB: Focus Doesn't Shift When Find Accelerators Are Depressed

PRB: Form Handle Not Released When Closed with Basic Code

PRB: Full Path Causes Endless Loop In StartApp() Example

PRB: GPF Using v1.01 Diamond Viper VESA Local Bus Video Driver

PRB: Help Gives Error Importing File From Floppy Disk

PRB: Inaccurate Message When Opening MDB Shared vs Exclusive

PRB: Incorrect Btrieve Error Message, [Btrieve ISAM] section

PRB: Limited to 65535 Pages in Print Dialog Box

PRB: Memory Block Not Freed If Cue Cards Not Installed Right

PRB: Minimizing, Maximizing the Desktop Flashes Slightly

PRB: NWIND Order Form Updates Order Amount Field with Zero

PRB: NWIND.MDB Query with Criteria Displays Data in Odd Order

PRB: Object Buttons in Database Window Do Not Change Colors

PRB: OLE Excel and WinWord Do Not Close when Form Is Closed

PRB: Opening a Database Read Only Forces Others to Read Only

PRB: Opening Screen Size Is Different from Earlier Session

PRB: Paste Link into Excel Displays First Field Name Only

PRB: Paste Not Allowed After Record Copied to Clipboard

PRB: Press ENTER when Database Window is Minimized Opens a Doc

PRB: Referential Integrity Error With Shared Databases

PRB: SCSI Drives can Generate "corrupt" Error Message

PRB: Text May be Hard to Read on an EGA Screen

PRB: Unexpected Error from External Database Driver [20]

PRB: Welcome to Microsoft Access Screen Disables Status Bar

PRB: Zoom Box Accessible When Multiple Fields Are Selected


Compuserve
Getting Started on the MSACCESS Forum

Membership Announcement

Introduction

Hard and Fast Rules

Manners and Ambience

      3.1  Manners

      3.2  Who's Microsoft and who isn't

      3.3  What to do if you're upset

Emoticons and Acronyms

      4.1  Emoticons

      4.2  Acronyms

Forum Organization -- Messages, Threads, Sections

      5.1  Message Traffic and Scroll Rate

      5.2  What the Heck All This Means to You

Asking Questions

      6.1  Phrasing Your Question

      6.2  Uploading Files

      6.3  Responding to Answers

      6.4  Acknowledgments

      6.5  If You Don't Get an Answer

Tips for the Active Participant

      7.1  Thread Integrity and Continuity

      7.2  Message Etiquette

      7.3  On-line vs Off-line

Sysops

Libraries

      9.1  Compressed Files

      9.2  Uploading files

Afterword - The Spirit of Contribution


Compuserve Membership
Membership Announcement

To join the MS Access Forum, select option #8 from the Forum menu or type JOIN at any Forum command prompt or choose Join from the appropriate menu. Your first and last name is all that is required. There are no special fees or dues other than your normal CompuServe connect charges.

Membership privileges are enabled automatically, and allow you full participation within the forum. All privileges remain in effect unless specifically deleted by the SYSOPS as long as you access the Forum periodically. The membership file is regularly (90 days) purged of inactive members to improve system operation. If this should occur, all you need to do is sign up again and your membership privileges will be enabled.

Forum members may access the Conferencing area, Libraries, and Message Board, which has been broken down into various sections. To see a listing of the Message section names, Library names, or Conference Rooms available, please type "NAMES" upon entry to the Forum.

Online help is available at virtually every level of the Forum. When in doubt, try entering a "?" or the word "HELP". If you are new to the CompuServe Forum environment, please be sure to visit the Forum INSTRUCTIONS area.


INTRODUCTION

Welcome to the Microsoft Access Support Forum! Welook forward to your questions and contributions.

The MSACCESS Forum is an extraordinary resource for people who use, or are considering using, Microsoft products. Forum members are knowledgeable,  unselfish, and available virtually 24 hours a day, 7 days a week to assist you. They will not only provide you with the information and help you need, but they'll do so with a generosity of spirit that truly means "support."

The forum is a place to get your questions answered -- Microsoft tech support is here (Monday through Friday) as well as many people who are very knowledgeable in Microsoft products, hardware, other software, and just about everything else (e.g. music, Star Trek, medieval literature, the list goes on and on).

Yet the forum also offers more than a place to come for help...

-	you can learn about new trends in the industry and the philosophy of database approach in general

-	you can share your thoughts about Microsoft and our line of  products, request changes and enhancements, and gripe if you need to

-	you can contribute your own knowledge and have the satisfaction of helping others

-	and you can just hang out and chat with people who might become some of your best friends.

Our main purpose here is to provide information, guidelines and tips to help you get "up to speed" as quickly as possible.

Although we have a responsibility to watch this forum and see that questions are answered, problems resolved, and concerns are addressed, we hope that you will play an active part participating in the process.  The forum works best when we all contribute and help each other.  Not only does this make for good technical support, it also helps us to determine where the product can stand some improvement in order to prevent questions in the first place.  We also get a good idea of who our customers are and what they need to be more productive.


Rules
HARD AND FAST RULES

These are simple.

This forum requests that you use your full name in your CompuServe (CIS) identification. If you have omitted your first name or last name, please change it.

  To change your name, get on-line in CompuServe and type GO MSACCESS to

  get to the CompuServe prompt. Then type OPTIONS which will show you a

  menu of options you can change. Choose option 4 (name), enter the new

  name, press <RETURN> and then tell CIS to make the change permanent.

  You can also do this quickly by typing "OPT;N <newname>;P" which will

  bypass the menus.

  If you normally use a company CompuServe account with the company name

  but plan to be a regular participant, please change the identification

  (at least locally in this forum) to your name and enclose the company

  name (or abbreviation) in brackets after your name. If several

  people will be using the *same* account, each individual should include

  his or her complete name in the body of the message.

Please refrain from using profanity, being abusive, advocating illegal actions, or performing any act that may injure another. Microsoft reserves the right to deny access to the forum to anyone posting offensive

messages.

This isn't a "hard and fast rule" but it is highly recommended -- please do not type your messages all in upper case (use mixed case as you would in a letter).  Upper case is hard to read and is considered "SHOUTING" on CompuServe -- you'll see what I mean if you read enough messages.

There are no other "rules" but there are some conventions of behavior that will ease your life in the forum. Please see the "Manners and Ambience" section, next.


Manners
MANNERS AND AMBIENCE

This is the MSACCESS forum, so naturally what brings people together is an interest in Microsoft products -- most of the people here are working with Microsoft Access. These include developers, people using the products to manage their own data, and hobbyists. The range of skill and expertise is very wide -- from the loftiest Access Basic guru to the absolute beginner. Experts and beginners are equally valued -- beginners sometimes ask the best questions!

In addition to the people who write messages on the forum, there is another group we (affectionately) call "lurkers" -- people who monitor the forum (reading messages, downloading files) but for one reason or another haven't chosen to write any messages to us. We might tease lurkers from time to time

 but we value them as well.

Although intended as a "working" forum for sharing information and professional expertise, this forum is also a friendly and informal place.  People here can become quite close -- and a newcomer will hopefully find him/herself quickly accepted. When you join the forum, "old timers" will treat you

as a friend as long as you behave yourself (smile).

As with any group of friends, you'll find that there are lots of "in" jokes, many teasing comments, heated debates, occasional spats and feuds, people having a bad day who may be cranky -- the usual stuff of human interaction.  You'll find the reason we're friends is because we share common interests, are working in generally the same field, and appreciate the opportunity to communicate. For some of us who are isolated, the forum members are the only people we know who understand what we're talking about (grin).

So, when you "walk" into the forum, it will be more like walking into a large party with people who share professional interests than like walking into an office or a professional association. It's kind of like a user's group with no specific agenda.   As with all CompuServe forums, forum members range widely in personality, geography, race, sex, religion, etc. and this is *definitely* an equal opportunity forum.

3.1 Manners

So, now to manners. Basically all we ask is that you be considerate of everybody else. When I say "considerate", I mean *consider* that the person on the other end of your message is a human being with ups and downs, strong and weak points, good days and bad days. Consider that a person may reside

in a non-English speaking country and use English as a second language.  Consider that a person might be handicapped or that a person may not be the sex you *think* he or she is based on his or her name.

Also, *please* consider that people here represent different nationalities, races, ethnic groups, religions, abilities/disabilities, and sexes, and *respect* these differences. In this forum, it is important to us that we provide an environment where we *all* feel safe. If any one of us is ridiculed or insulted, we all lose since we lose their enthusiasm to participate with us and contribute to the work we do.

Consideration can be most important when you are upset. Within the bounds of consideration, you can complain, whine or throw tantrums, if you need to -- I think we all have at one time or another. But it takes a certain amount of skill to complain, whine or throw a tantrum politely and with consideration

for others. If you're upset, consider how your message might affect *you* if you were to receive it.

If you're considerate, you shouldn't run into too many problems here. But I must warn you that you are subject to teasing (because you're considered a *friend* from the beginning -- please don't take this personally) and if you should stray beyond the bounds of what's considered "appropriate" behavior,

you may receive a gentle admonition. If you are really out of line, a Sysop may decide to step in -- a Sysop is a final authority on behavior, and even long-term forum members quake before a Sysop's pronouncements (smile).

As a rule of thumb, a belligerent attitude is frowned upon -- it tends to make us uncomfortable because it upsets the balance of friendliness and consideration, retards the free flow of communication, and, frankly, we seem to be able to have very "loud" arguments without resorting to this approach.

3.2 Who's Microsoft and who isn't

People on the forum who work for Microsoft tech support have [MSFT] or  "Sysop" after their names in their identification. If somebody doesn't have [MSFT] or "Sysop" after his or her name, s/he is *not* an employee of the company and is just being helpful. Some forum members are so helpful, people sometimes assume they work for Microsoft even if they don't.

You may be interested to know that senior managers and many of the staff at Microsoft review the forum messages every day. They are all paying attention to what you have to say and their products reflect this interest. Also various Microsoft staff members will contribute to the forum from time to time. They will either have (Microsoft) after their name or identify themselves in their signature.

3.3 What to do if you're upset

It's not uncommon for people to log onto the forum for the first time because they're upset

-	because they've spent hours and hours working on a problem and can't solve it

-	because something about Access doesn't work the way it should or the way they think it should (often there's a difference)

-	because they've tried calling tech support and haven't received an acceptable answer yet

-	because they had something working in one product that suddenly doesn't work in an upgrade.

We understand and sympathize -- and it just may be that we can help you if you give us a chance. If this is true for you, here's what we recommend: first, *consider* the other forum members (see Manners) and

second, start your message with "I'm upset" (this lets us know that you're upset and we'll be sympathetic - that's a promise). Then try to explain your problem as succinctly as possible (for further guidelines -- see Asking Questions, section 6.0).


Emoticons
EMOTICONS AND ACRONYMS

You may have noticed that humorous comments have so far been expressed with such things as (grin) or (smile). One of the things that most puzzles newcomers is the use of acronyms and what are called "emoticons".  Here is an explanation of the important ones.

4.1 Emoticons

In an electronic medium such as the forum, it's pretty hard to get across certain elements of face to face communications that would otherwise be expressed with tone of voice, inflection or body language -- elements like humor, irony, sadness and various non-verbal "comments" on what is being discussed. Consequently, certain conventions have arisen to express this kind of thing.

Technically, an emoticon is an "icon designating emotions" depicted with symbols. Perhaps the most common of which is:

 :-)   	a smiling face on its side (tilt your head to the left to read it).

 grin	either the previous comment was meant humorously or one is responding with a laugh to somebody else's humorous comment -- perhaps the most widely used symbol on this forum.

 smile	usually means that one is smiling at somebody else's comment or could refer to one's own comment that is slightly humorous.

<gd&r>	grinning, ducking and running -- the previous comment was a "tease" and the person issuing the tease is now hiding out from his or her target.  Some variations of this are a simple <gd> (grinning and ducking) or <gd&rvvf> (grinning, ducking and running, very very fast).

<rofl> or <rof,l>	rolling on the floor laughing -- the ultimate acknowledgement of somebody else's humor or an indication that you think you just said something yourself that is pretty ridiculous.

* or _ 	as in *emphasize* or _emphasize_    equivalent to italics or underlining.

(There are literally hundreds of others.) However, the term is also being used to apply to text-based equivalents which are more commonly used on this forum.

Creative people on the forum will sometimes make up their own emoticons from time to time but they almost always explain them since nobody would otherwise know what they're talking about <g>.

4.2 Acronyms

Many acronyms have also become standard -- mainly to save typing. Some of the common ones are explained here. Any others you encounter, you'll have to figure out for yourself, but once you've got the "trick" down, it's kind of fun.

General CIS-wide acronyms:

BTW	By the way

CIS	CompuServe Information Service

FWIW 	For what it's worth

IAC   	In any case (also IAE -- in any event)

IANAL 	I am not a lawyer

IMO   	In my opinion

IMHO  	In my honest/humble opinion (in the latter case a sure sign the opinion is not going  to be humble at all <g>)

IOW   	In other words

JIC   	Just in case

KOW   	Knock on wood

OIC   	Oh, I see!

OTOH  	On the other hand

PITA  	Pain in the "acronym"

POV   	Point of view

PPN   	Programmer project number, i.e. a CIS user's id#

RSN   	Real soon now (computer lingo for "don't hold your breath")

RTFM  	Read the f* manual (variously interpreted for public consumption as read the fine manual, read the fabulous manual, you figure it out <g>).

TIA   	Thanks in advance

TSR   	Terminate and stay resident program

WYSIWYG 	What you see is what you get

YA...   	Yet another .... (as in YAA -- yet another acronym)

Here are some other product-related acronyms:

API   	Application programming interface

DD    	Data dictionary

ER    	Enhancement request (request for an enhancement to the product or documentation)

GUI   	Graphical user interface

MU    	Multi-user

OO, OOP	Object oriented, object oriented programming

SU    	Single user

UDF   	User defined function

UG    	Users Guide

In addition there are a large number of platform specific acronyms and abbreviations such as QEMM, DV, WIN, INIT, CDEV, DA, which you'll either know or can ask about.


Organization
FORUM ORGANIZATION -- MESSAGES, THREADS, SECTIONS

The forum is comprised of individual messages from one forum member to another. These messages are organized by thread -- a "thread" is simply a string of related messages and replies brought together under a "thread topic", which serves as the "message header" for every message in that thread. Here's an example of a message header:

#: 83761 S1/Non Tech Services    	* message number, section

    06-Dec-92  11:38:01        	* date and time

Sb: #83591-#Access is Way Cool...	* responding to message#, topic

Fm: Kevin Costner 72230,2664  	* from forum member

To: Phil Collins 72261,640   	* to forum member

Threads begin when an individual creates a new message (not replying to a previous message) and grow as other individuals reply. A new thread may also be created when replying to a previous message by changing the topic or posting the reply to a different section.

Threads are further organized by forum section (such as Queries or Forms -- a list or sections is included in Message Etiquette, section 7.2. New threads should be posted to the section appropriate to the topic.

Messages themselves may be either public or private (see below) and cannot exceed about 2,000 characters in length. For assistance in composing and posting messages, please refer either to the CIS help files or to the documentation provided with your communications software. Further information as relates specifically to this forum will be included in this document in appropriate places.

5.1 Message Traffic and Scroll Rate

Message traffic is the number of messages which get posted to a forum in a day. The volume on the MSACCESS is very high -- ranging from about 100 messages a day when a lot of folks are at Comdex to as many as 500 messages a day when something really interesting happens. Message traffic probably averages about 200-300 per day.

A CIS forum is limited to a certain number of message "slots" or total number of messages at any one time. As messages are posted, the message slots fill up. When they are full, messages begin to "scroll off" (disappear) on a First In, First Out basis (early messages scroll off before later ones). With message traffic (also called the scroll rate) of 300 messages a day, the first messages in the queue will disappear in about 6 days.

5.2 What the Heck All This Means to You

The nature of threads and the high scroll rate in this forum frequently have consequences for how you ask questions, how you formulate replies, and how you can help the forum function efficiently. Details will be included in later discussions where appropriate.


Asking
ASKING QUESTIONS

Forum members are very helpful, patient and forgiving -- no matter what level of expertise you have. You will almost certainly get an answer to your questions, if you are aware of certain facts of life.

Due to the high message volume on this forum, forum members who read all the messages (and there are many) are trying to keep up with forum traffic, be helpful, earn a living, and live something like normal lives -- all at the same time.

It's recommended that you check in again within two or three days after you leave a message and that you read all the messages in your thread -- otherwise you might 1) miss responses that have disappeared due to the high scroll rate and 2) miss responses that may not have been addressed *directly* to you -- people tend to reply to the most recent message in the thread rather than going back to your original inquiry. Any message sent  *directly* to you and not read before it scrolls will automatically be sent

to you via CompuServe Mail.

6.1 Phrasing your question

The way you phrase your question can make a big difference in the kind of response you get.

Here's the "worst case" question -- one that forum members will want to avoid (tech support will answer, of course, but you may be missing an opportunity to get a speedy reply from someone else):

   "I just got Access and it doesn't work. Can anybody help?"

Obviously, the first thing anybody has to ask is: What do you mean it "doesn't work"?  Just finding out the basics could take quite a bit of time.

So, here are some guidelines:

- 	Be SPECIFIC.  (and be sure to post your message in the appropriate section of the forum -- a list of orum sections is included later in Message Etiquette, section 7.2).

- 	Tell us whether you are writing a program or using Access interactively.

- 	Tell us exactly what error messages you are getting, if any.

-	Tell us what you are trying to do, what you did just before the problem occurred, and *exactly what happened*.

-	Please inlcude specific *step-by-step* instructions that will help use to reproduce your problem.

-	If it's a programming problem, post the actual bit of code or macro group that you think is causing the problem or a close approximation.

In addition:

Post your question to the proper forum section (see Message Etiquete for a list). Some forum members only read messages in specific sections -- if you post in the wrong place, the person with the answer might not see it. And  choose a suitable, informative, and specific *topic* for your message.

"Report Sum Question" in the Reports section will almost certainly get a better response than "HELP!."

Post any program code or formatted messages as UNFORMATTED. CompuServe normally "formats" or "word wraps" code that's uploaded to the forums -- i.e. it strings all the lines together if they are not separated by a completely blank line. This will turn your carefully indented code into a garbled mess which is very difficult to read. You can avoid this when you're on-line with CIS by using the "POST UNFORMATTED" command. With various programs such as TAPCIS or Navigator (that allow you to read and respond to messages off-line -- explained later in this document), use their "Unformatted" option. You may also insure proper indentation by preceding each line of code with one or more spaces or a tab.

Roughly, if you're having a problem which appears to involve the way Access interacts with your hardware such as loading or operating slowly, not loading at all, running out of memory or disk space, video display problems, running on a network, etc., please be as specific as possible about your operating environment, perhaps including your operating system (Windows 3.1, DOS 5.0), your DOS CONFIG.SYS, AUTOEXEC.BAT,  type of network, network settings, and so on and so on <g>.

6.2 Uploading files

If you have a very difficult or complex problem, it may eventually be resolved only by sending it to someone else for review. There are two approaches:

1) If tech support *SPECIFICALLY* requests that you send them your problem (and at no other time), upload it to the forum libraries. Problems sent this way will be treated as private communications -- however, if you want to have the problem reviewed by non-Microsoft folks, you may specifically ask the sysops to post it publicly to the libraries. Uploading to forum libraries is free of connect charges so this is definitely the most efficient way to send things to Microsoft. More information about uploading files to libraries can be found in Uploading Files, section 9.2.

2) If a non-Microsoft forum member has been assisting you, you can send your problem to him or her via CompuServe mail. However, there _is_ something like a "rule" about this:

DO NOT UPLOAD ANYTHING TO ANYBODY WITHOUT THEIR *SPECIFIC* PRIOR APPROVAL.

Downloading something from CompuServe costs the recipient money in phone and CIS connect charges. Many active forum members use automated programs to download their messages and files and these programs do not give them the chance to refuse a download -- anything in their box is downloaded automatically. It's simply not fair to impose this burden on them without their consent. The above rule also means that if somebody has been kind enough to look at something before, it doesn't necessarily mean they want to look at it again, no matter how great it is now <g>. It's a simple matter to request and receive permission before you upload -- do it!

In EITHER CASE, when you upload something to somebody, be considerate again -- send them the minimum that's necessary to "get the job done", i.e. give them the information they need to assist you and compress the file (using PKZIP  -- more on this later) to reduce transmission time.

6.3 Responding to answers

If you have asked a question and someone has replied with an answer, read what they have to say carefully. If they've solved your problem, great! If they haven't, but are trying to help, *answer their questions*. Remember they may be in a hurry, or have misunderstood your question or situation, or

may even be telling you something incorrect (not on purpose, of course), so if you don't understand something they say, don't be afraid to say "I don't understand."

6.4 Acknowledgments

If somebody helps you out, a simple "Thanks!" is appreciated.

If you've had a particularly knotty problem that appears to have been a challenge to resolve and/or if many people have made a lot of different and possibly conflicting suggestions -- when you've finally got it working, we'd appreciate knowing what exactly you did that worked. The reason we appreciate

this kind of summary is because many of us may have or anticipate having the same kind of problem, and we'd like to know the answer too! In addition, it may be a valuable addition to Microsoft's Knowledge Base - a tool that we use to help you solve your problems.

6.5 If you don't get an answer

If you leave a message and nobody responds, it may be because it "just happens" that nobody has time to respond, because everybody simultaneously decides that "somebody else will answer", or because your message was unclear and nobody knew *how* to respond.

You can increase your chances of having a response to your message by:

-	Posting your message again -- and saying that your original message was not addressed.

-	Posting your message directly to a sysop or to "all".

-	Rephrasing your message.


Tips
TIPS FOR THE ACTIVE PARTICIPANT

As mentioned earlier, the message traffic on the MSACCESS is very high. It can be quite a chore to manage this volume of communication and keep CIS connect charges to a minimum. Here are a variety of hints that may prove useful.

7.1 Thread Integrity and Continuity

All forum members, experienced and novice, benefit from the forum threads.  Often a thread will address a problem that many other forum members have or anticipate having. Consequently, it is important that all messages that contribute to the thread remain available during its lifetime (thread integrity). In addition, it's extremely useful if relevant messages are contained _within_ the thread and in the proper order (continuity). With this in mind:

-	public messages should not be deleted if they contribute to the thread.

-	relevant responses to existing messages should be generated by *replying* to the message rather than starting a new message.

-	multiple part messages, as much as possible, should be kept together (more on this a little later in Message Etiquette).

Related to this issue is the "other side of the coin" where messages are no longer relevant to the topic. It is possible on CIS to scan available messages by "message header" or thread topic. This can be a useful approach if you're trying to save on connect charges. However, this is not *guaranteed* to be a foolproof approach. Threads on this forum tend to wander, and strict adherence to a thread topic is not rigorously enforced.  Consequently if you're downloading a thread whose topic looks interesting, you may discover:

-	the messages have wandered off the thread topic

-	the messages have deteriorated into a series of jokes

At a rough guess, some of us estimate that the really relevant messages in a thread are the first 1 to 10, although that is not necessarily the case -- when a topic is complicated, messages may still be useful during the thread's entire life or, OTOH, a thread may deteriorate into jokes almost immediately. Unfortunately, due to the high message traffic, the beginning of a thread may scroll off so that all that remains in the forum are the less relevant messages. This is not to say that the messages which aren't

relevant to the topic aren't useful <g> -- indeed, they are frequently useful -- and the jokes are often good, too.

-	Please use upper and lower-case for your name and messages. Upper case words indicate EMPHASIS and a message in all capitals looks as though you are "SHOUTING."

-	All Message Subtopics correspond to the same Libraries and Conference Rooms.

-	If you upload a file in the public libraries, please upload it into New Uploads Library.  Files uploaded into New Uploads will remain for about one month and will be moved to their permanent location

-	We do NOT make any guarantees regarding freeware or shareware available for downloading from this forum.

Section Leaders cannot provide the following:

1.   Sample code or macros with responses; however, Microsoft may request sample code or macros for bug verification

2.   Private responses to questions or private phone calls

3.   Source code or macro debugging, design review, in-depth discussion of Windows internals, or bench marking of code

4.   A guarantee of question RESOLUTION

5.   Any proprietary, philosophical, or third-party recommendation information.

7.2 Message Etiquette

In consideration of forum members who do not read all the messages (those who download the threads whose topics sound interesting) and to support thread integrity and continuity, please observe the following suggestions:

   Please post your message to the most applicable section. MSACCESS

   sections are (note that these sections will change from time to time):

1. Non Tech Services

2. Tables/DB Design

3. Queries

4. Forms

5. Reports/Printing

6. Macors/Modules

7. Import/Export

8. Multi-user/Networks

9. OLE/DDE

10. SQL Server/ODBC

11. Security

12. Setup

13. Suggestions/Mktg

14. User's Groups

15. Third Party

 When starting a new thread, try to name it something that captures the

 essence of your message and be as specific as possible -- unless it's the

 Chatter section where you can name it anything you like <g>.

 When replying to a message, if your reply is substantially changing the

 subject, please post it under a different topic and to a different section

 if applicable.

 If your reply is directly relevant to the current topic, please DO NOT

 post it to a different topic or section. Use CIS or your off-line

 software to REPLY to the message.

 If you want to make sure that a specific person sees your message and sees

 it as quickly as possible, make sure you address it specifically to him or

 her and *be sure to include his/her CIS id number*. This is important

 because:

 Some people only read messages addressed directly to them and will miss

 your message entirely. (Note: reading only personal messages is not

 recommended practice in this forum because you will almost certainly

 miss further possibly relevant messages in a thread.)

 Many active participants will read their personal messages during the day

 and download everything else in the evening -- so they might not see a

 particular message until later.

 If the message scrolls off before the addressee sees it, CompuServe can

 not forward it to CompuServe mail without an id number.

Long messages: If you have a particularly long message, remember that individual messages are limited to about 2,000 characters. When a message exceeds that limit, you can either send it via CIS Mail to an individual or you can split it into parts and post it on the forum. CIS Mail has a very high message length limit, but no one on the forum will see messages sent that way.

In the interests of thread integrity and continuity:

Post long messages that are relevant to an existing thread, or that are of general interest, to the forum not to CIS mail so we can all benefit.   Other long messages may of course be posted as well. If you find that you seem to be engaged in a topic that is not particularly Access related or is really a conversation between you and one other person, consider moving that conversation to CIS mail (you might want to ask first to see if anybody has been following the conversation and would like to see it continue).

There are two approaches to splitting messages which are a little contradictory.

First, there is an option called /SPLIT (please refer to CIS help or your CIS communications software documentation). By inserting /SPLIT at the bottom of a message, the next message you send will automatically continue the message. The benefit of /SPLIT is that it keeps the parts of your message *together* when they are posted. The drawback is that subsequent messages are addressed to *you* rather than the person to whom you were originally replying. Since (as mentioned earlier) some people only read messages addressed directly to themselves, these people will not see the continued parts (or may not see them until later).

 The alternative approach is to send continued messages by simply continuing to reply to a message and manually inserting "more" and "continued" in your messages as appropriate. The benefit of this is that the intended recipient will be sure to receive all parts of the message in a timely fashion. The drawback is that messages split this way may not get posted together and can be interrupted by other replies (which

impairs continuity).

Rule of thumb: Use /SPLIT unless you want to guarantee that the recipient will see all parts or all parts as soon as possible. In the latter case, continue to reply.

7.3 On-Line vs Off-Line

CIS connect charges are high and MSACCESS message traffic is high -- the two can combine to deliver whopping credit card bills (not, unfortunately, much to joke about). If you plan to frequent the forum or other CIS forums, it is highly recommended that you investigate several programs that download and upload forum messages in a more efficient and less costly way.

Note: CompuServe offers a product called CIM (CompuServe Information Manager) which is useful to manage your work on CIS -- however, it mainly works on-line and will not reduce your connect charges as much as the products I will discuss here.

A couple of programs we would recommend are OzCIS and TAPCIS. These programs will log onto CIS for you, upload and download messages and files, and provide you with other utilities.  Their major advantage is that they allow you to read and respond to messages *off-line*. Not only is this *considerably* cheaper, but also it allows you to review and respond at your leisure. If you want to get up to check a manual or break off for a moment to test something in a program, you can do so without the terrible pressure of connect charges eating away at your pocketbook. Moreover, it allows you reflect on what you say, change your mind, correct your mistakes, and improve the quality of your messages in

general.

Another advantage is that these programs can be used in a variety of ways to capture only the messages you really want to see and further cut down your connect charges. For example, with TAPCIS, you can read only certain forum sections, you can read all messages or download the thread topics (which you

can mark off-line to be downloaded the next time you log on), or you can read only messages addressed to you personally.

These programs offer a further advantage in that they provide an option for retaining past messages (yours and others) in a file on disk for future reference. These files can be archived from time to time and transferred to floppies or otherwise managed. Forum members have a variety of strategies for managing these files. As an example you can archive (using PKZIP) the message file about once a week and keep about a month's worth of zipped files on your hard disk.

Some forum members keep *all* their messages. Some rely on the forum archive files to capture the "best parts".

In addition to the basic programs, the offline communications programs often have many additional utility programs.

More information about downloading files from libraries can be found later in this document.

OzCIS

OzCIS is freeware. Files to download from CIS, from the IBMCOM forum (GO IBMCOM), Library 12, are:

OZCIS.BRO...7868 (<-file size)

  This file outlines many of the capabilities and features of OzCIS

  version 1.2 and later.  Plain ASCII text file; can be REAd online or

  downloaded.

OZCIS.REQ...5940

  This file describes the minimum hardware and software requirements in

  order to run OzCIS version 1.2a and later. OzCIS is a big program and

  requires considerable system resources; reviewing this file before

  downloading the main program files could save you considerable online time.

  Plain ASCII text file; can be REAd online or downloaded.

OZCIS1.EXE...279454

  OzCIS is a auto-navigator to automate CompuServe access for Mail, Forums

  and other areas of the service. This is Part 1, the Main Program file.

OZCIS2.EXE...167057

  This is Part 2, the Online Processor file.

OZCIS3.EXE...131049

  This is Part 3, the Accessories file.

OZCIS4.EXE...138820

  This is Part 4, the Documentation file. Note: Changes/additions to the

  documentation since version 1.0 are in the README.1ST file included in

  the Part 1 and 2 files.

OZHELP.ZIP...159173

  The files included in this archive are intended to provide the ability

  to reference the OzCIS documentation from within OzCIS as a supplement to

  the on-line help. This on-line documentation is intended to be used with

  the shareware documentation reader, AUTOREAD.EXE, installed as an EXTERNAL

  under OzCIS. AUTOREAD may be found in IBMSYS LIB 6 (BRO /KEY:AUTOREAD).

TAPCIS

TAPCIS is a shareware program. Files to download from CIS, from the TAPCIS forum (GO TAPCIS), Library 1, are listed below. You can also order the program by calling Support Group, Inc. at 800-USA-GROUP.

TAPCIS.INF...13963 (<-file size)

    This file describes TAPCIS in detail along with its requirements

    and pricing. You should download and read this file before downloading

    the TAP.EXE program and TAPDOC.EXE documentation files from Library 1.

TAP.EXE...211812

  TAPCIS(tm) Version 5.4, The Access Program for the CompuServe

  Information Service. TAPCIS completely automates CompuServe Mail and Forum

  messages and libraries. TAPCIS cuts online time to a minimum and frees you

  to do other things while it does all online actions without user input.

  We guarantee you'll love TAPCIS with a 21 day shareware trial and a

  90-day money back guarantee. Copyright (c) 1991 Support Group Inc. Manual

  in TAPDOC.EXE. Prev downloads: 43,430+

TAPDOC.EXE...154832

  TAPCIS(tm) 5.4 Documentation in a self extracting file. This program

  will expand into all ten sections of the TAPCIS docs plus appendixes, table

  of contents, and index. See file README.DOC included in this file for

  more information. You will need this documentation to set up TAPCIS

  properly. Program is in TAP.EXE.


LIBRARIES

The forum libraries contain many informative and useful files. An exploration of the libraries is well worth the trouble. The MSACCESS libraries are the same as the MSACCESS sections.  You should post your file to the section that it relates to most closely.  If you don't know what that is, you could post it to Non Tech Services.

Files in the libraries come in two basic forms: ASCII and binary. ASCII files are text files which will be readable without further attention.  Binary files are *either* files (including text files) that have been

compressed to save space and downloading connect charges *or* other binary files like programs or graphics files.

9.1 Compressed Files

There are several types of compressed files:

   .ZIP files  -- Compressed using PKZIP -- these are uncompressed

    by using PKUNZIP.EXE. PKZIP/UNZIP are shareware programs

    available for downloading from the MSACCESS forum.

   .EXE files -- Mostly this extension indicates that the file is

   a "self-extracting" compressed file. This means that the file will unpack

   itself when you type the file name. *Usually* these files are also

   compressed using PKZIP -- however since they're self-extracting, they do

   not require PKUNZIP.

   .ARC files -- Compressed using Arc utilities or such commonly available

   compatible programs as ARC-A.COM. Can be uncompressed with ARC-E.COM,

   available in the IBMCOM forum, library 2, and elsewhere (look for

   ARC-E.COM and ARC-E.DOC).

9.2 Uploading Files

Most files in the libraries have been uploaded by forum members for use by other forum members and we encourage you to do the same. If you have developed a utility or a function or a bit of code or have some particular information to share that appears to spark general interest, please send it on up! Remember, uploading to forum libraries is free of connect charges.

If tech support *SPECIFICALLY* requests it (and at no other time), you can also upload code that you're having a problem with and which appears to be too lengthy or complex to post on the forum itself.

The mechanics of uploading a file can be fairly tricky.  Please refer either to CIS Help or your CIS communications software documentation. If you want additional help, CIS has a practice forum (GO PRACTICE) where you can practice uploading a file, writing messages, etc. Time spent in the practice

forum is free of connect charges.

Here are some guidelines for uploading:

-	Combine and compress any files you are sending into one archived file using PKZIP or the self-extracting options of other compression schemes.

-	For some reason, CIS limits file names in libraries to only 6 characters (not including extension). It's better if you limit your file name to 6 characters yourself -- otherwise CIS may truncate the file name in a way that you don't really want. File names should begin with a letter and contain *only* letters and numbers. They should not contain spaces or punctuation (including underlines and hyphens), or miscellaneous characters like * or ^.

-	When uploading, please include a brief but complete description of the files included and what they do. If space allows, I always like to see the name of the person who's sending it and a note about how large the file will be when uncompressed (disk space is sometimes tight <g>).

-	The sysop will check the file for viruses and perform some other maintenance. Consequently, it may take a few days before the file becomes available to others.

-	Let people on the forum know that you've uploaded the file, what its name is, and where you sent it.

NOTE: If you are uploading a file with the *same* name as a file you previously uploaded, the old file will be replaced with the new one.  However, if you are uploading a revision and want to use a new name, please help with library housekeeping by deleting the old file yourself using the CIS Library Menu.


Afterwards
AFTERWORD - The Spirit of Contribution

We need all the help we can get! <g> We need people to be more specific and precise asking questions (and it would certainly help if people check the manuals and other product documentation resources first). We need people to be more careful about thread continuity and integrity. We need people to be more considerate (tempers are sure to fray <g>). And we need people to help others more than ever before.

One of the things we want to distinguish the MSACCESS Forum from others is the very unselfish way forum members help each other day after day. We feel there is an underlying intent on the part of most forum folk to make a contribution to others on the same path. We also feel as long as this "spirit of

contribution" remains a force, the forum will work well for all of us.

You can really help maintain the value of the forum by logging on with an *intent to contribute*. If you want to ask a question, ask it with an eye toward contributing to our knowledge as well as yours. Share experiences that you feel will be of value to others. Answer the questions of others.  And try, especially, to keep to the public agenda and avoid self-promotion.

There's certainly opportunity on the forum for vendors of products and services to offer their wares (in moderation), and vendors are *just the kind of people we need* to help us. Yet it's always a little irritating when we see a vendor log on *only* to promote something while so many others are helping for free. If you are a vendor, hang around a little and contribute; give back a little to the community that supports you. (And from a purely practical point of view, establishing a helpful presence on the forum should serve to enhance your marketability.)

Although making a contribution is always a source of personal satisfaction, we believe that there's more at stake here -- we are building a community that can support us in our work and in our lives. That's

something worth investing in -- contribution is truly an investment in our future.

See you on the forum!


Compuserve Sysops

Below is a list of the present Microsoft Sysops that perform daily duties on Compuserve.

Steve Alboucq	Support Manager	72350,3370

MariEsther Burnham	Sysop	70363,152

Monte Slichter	Sysop	70621,1344

Kim Hightower	Sysop	70761,655

Kim Abercrombie	Sysop	70761,650

Ryan LaBrie	Sysop	72350,3371

Joe Howard	Sysop	72350,3367

Don Funk	Sysop	72350,3372

Tim Leidig	Sysop	72350,3374

Gary Yukish	Sysop	72420,1356


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

COPYRIGHT Microsoft Corporation, 1992.


Common problems articles are articles perceived to be problems by the customer (for example, common user errors). Unconfirmed bugs and documentation error articles also fall into this category.  These articles are easily identified by the "PRB:" code in the title of the article.


Informational articles are Summary/More Information articles. They describe undocumented features and  sample programs, or elaborate on topics that are already documented. These articles are easily identified by  the "INF:"code in their titles.


Bug articles are articles that are confirmed to be problems (that is, the articles have a RAID bug number). These articles are similar in format to the common problems articles and are easily identified by the "PRACC:" code in the title of the article.


The Windows Interface: An Application Design Guide

Weve included this free book and disk set.  The book covers user interface design techniques for the WindowsTM operating system environment.  Its the same book our designers at Microsoft use when theyre developing applications for Microsoft Windows!

The disk includes a sample buttons and cursors library, as well as an online style guide browser.  Use it to create true Windows-based database applications!

User Groups

Many groups are already established and more are starting.  They are a great way to learn more about the features and power of Microsoft Access.  Microsoft keeps in close contact with these groups, sending them sample applications, code, tips and tricks, as well as other information.  Plus, representatives from Microsoft make visits and speak at user group events around the country.  To join or start a Microsoft Access user group or special interest group, call (206) 936-3729.

Training

If youre interested in digging deeper into Microsoft Access or want to come up to speed quickly, training may be the answer.  To find a Microsoft Access training site near you, call (800) 426-9400.  If youre interested in becoming a trainer for Microsoft Access, call (800) 227-4679 to request an application.

Periodicals

Access Advisor

Data Based Advisor	Data Based Solutions, Inc.

DBMS Client/Server Computing	M&T Publishing Inc.

Inside Microsoft Access

Smart Access

Books

ABC's of Microsoft Access	SYBEX

Access Consulting	Prima Publishing

Access for Windows Power Programming

Access from the Ground Up

Access Programmer's Reference	Que

Access Workshop	Brady Books

Critical Information Network

Guide to Access

Inside Microsoft Access	New Riders Publishing

Microsoft Access Developer's Guide	Sams

Microsoft Access Inside & Out

Microsoft Access Instant Reference	SYBEX

Microsoft Access Programming

Microsoft Access Running Start	SYBEX

MS Access Handbook	Bantam Books

PC Learning Labs Teaches Access

PC World Access Handbook	IDG Books

Running Microsoft Access

teach yourself... Access

Understanding Microsoft Access	SYBEX

Using Access for Windows, Special Edition

Your Access Consultant


Access for Windows Power Programming

Advanced

by Persohke & Liozbanski

Access for Windows Power Programming is aimed at the advanced user, developer and network administrator who is interested in developing powerful and effective applications for Microsoft Access.  The book contains advice on the planning and design of databases and applications, as well as tips and techniques for creating effective reports, forms and queries.  Coverage of programming in the Access Basic language and creating macros is included, along with detailed information about variables, arrays, fields and other programming structures in Microsoft Access.  An Xbase programmers survival guide, a quick command and function reference, and a complete sample application are a few key elements in this book.  All code discussed in the book is included on a disk, plus you get a disk containing valuable utility software.  Price:  $44.95 (book with two disks).

Order Information:  Available April 1993.  Call (800) 528-5331.  Que Publishing.


Access from the Ground Up

Beginning/Intermediate

by Martin S. Matthews with Edward Hartmann and William E. Lloyd

This fast-paced introduction to Microsofts database program for Windows is the perfect starting point for anyone who is learning to use Microsoft Access for the first time.  An expert team of authors begins by teaching readers basic database design concepts.  Then, readers learn to customize forms, perform queries, print reports and labels, use macros, and more.  Highly illustrated.  Price:  $19.95.

Order Information:  Available February 1993.  Prima Publishing, Inc.


Critical Information Network

Beginner/Advanced  (Application developers, MIS)

by Thomas P. McAuliffe & Carolyn S. Shamlin

Critical Information Network is a new book that dispels the myths of online management reporting and offers a complete set of guidelines to avoid failed applications.  Based on 20 years of both technical and non-technical experience, the book provides the authors unique view of the relationship between critical information and the management process.  Many long-standing industry issues are clearly addressed:

1.	The real added value of information technology for management reporting.

2.	The keys to sustained management interest.

3.	The elusive link between reporting applications and corporate priorities.

4.	How groupware will impact the executive world.

5.	A blueprint for successful computer use by management.

Price $29.95 plus $2.00 for shipping

Order Information:  Call (617) 247-2460.  McAuliffe & Company, Inc.


Guide to Access

Beginning/Intermediate/Advanced

by Miriam Liskin

Now users at all skill levels can gain access to the complete feature set of Microsofts leading-edge database program by following best-selling author Miriam Liskins clear explanations.  In 20 exhaustive chapters Liskin covers just about every aspect of Microsoft Access from beginning to advanced subjects.  Topics covered include designing and creating databases, defining simple queries, performing calculations, working with external data, using Access on a network, building menu-driven applications, and more.

1.	Covers all aspects of database use and introduces database programming to nonprogrammers.

2.	Turns beginning and intermediate users into masters.

3.	Includes a disk containing the sample databases presented in the text, saving readers hours of input.

Price: $29.95.

Order Information:  Available April 1993.  Call (800) 688-0448 or fax (510) 601-2155.  Ziff-Davis Press.


Inside Microsoft Access

Beginning/Intermediate

by Richard Wagner, Helen Feddema, Michael Groh, Greg Reddick

Inside Microsoft Access provides a complete description of Microsoft Access database version 1.0 from the conceptual and implementation perspectives.  The book covers the fundamentals of database design and creation using Microsoft Access.  Everything from using the Microsoft Access environment to constructing macros and Access Basic modules are discussed in detail.  Throughout Inside Microsoft Access, practical examples illustrate each topic and concept.

The bonus disk contains HomeFinder, a sophisticated application produced with Microsoft Access.  HomeFinder comes complete with tables, forms, queries, and macros.  HomeFinder, a highly interactive application, demonstrates the many advanced features of Microsoft Access, including query by example, OLE embedding, image handling, and report generation.

Order Information:  Call (800) 428-5331.  New Riders Publishing,  Prentice-Hall Computer Publishing.


Microsoft Access Inside & Out

Beginner/Intermediate

by Mary Campbell

Microsofts exciting new database for the IBM PC and compatibles is sure to be a challenger for the lead database for Windows.  Find out all about this revolutionary software in Mary Campbells new book.  Youll get an insiders introduction to this powerful, feature-loaded relational database management system (DBMS), from fundamentals to intermediate-level skills and then on to some advanced topics.  If youre a beginning database user, youll soon learn how to set up a database and use it productively.  If you already know database software, youll learn all about the unique features of Microsoft Access, such as three-dimensional color graphics, object linking and embedding (OLE), multimedia and network capabilities, and other features that make this software a powerful new contender.  Price:  $27.95.

Order Information:  Available now at most booksellers, or by calling (800) 227-0900.  Osborne McGraw-Hill.


Microsoft Access Programming

Beginner/Intermediate/Advanced

by Namir Shammas

Microsofts first database for Windows, Microsoft Access, is a program powered by easy-to-use visual programming techniques.  It appeals to seasoned programmers and users who want to create their own customized database applications.

Namir Shammas latest book is an accessible, hands-on introduction to database programming for anyone who is familiar with the Basic language.  Shammas relaxed, friendly style leads the reader gently but thoroughly through the fundamentals of Access Basic programming to using the host of powerful database extensions.  Its a practical tutorial approachloaded with ready-to-use program code and peppered with professional tips, tricks, and warningsthat has proven successful in the authors previous books.  Price:  $32.95.

Order Information:  Call (800) 822-8138 or fax (717) 794-2080.  Tab/McGraw-Hill.


PC Learning Labs Teaches Access

Beginner

by PC Learning Labs

PC Learning Labs, world leader in hands-on computer instruction, has now added Microsoft Access to their successful book/disk learning series.  This innovative learning tool will aid first-time users in learning this powerful Windows-based database program.  Years of classroom teaching and lab research into how people best learn to use computers are the basis of this integrated package.  No other book is better suited to the needs of beginning users of Microsoft Access.

1.	Covers start-up and basic operations as well as forms, query techniques, reports, and much more.

2.	Assumes no prior computer experience.

3.	Includes a Practice Examples Disk with exercises that work hand in hand with instructions in the text.

Price:  $22.95.

Order Information:  Available February 1993.  Call (800) 688-0448 or fax (510) 601-2155.  Publisher Ziff-Davis Press.


PC World Microsoft Access Handbook

Beginner/Intermediate

by Cary Prague and Michael Irwin

Discover the full power and ease of use of Microsoft Access from expert authors.  This book/disk combination is a hands-on tutorial reference that walks you through the process of creating powerful applications for Microsoft Access.  Key topics include installation, database design, creating tables, creating and printing professional-looking reports, using logic and math functions, data validation, database publishing, using pictures, graphs and OLE objects, creating switchboards, dialogs, and menus, and more!  Bonus 3.5-inch disk contains customizable examples.  Price:  $34.95.

Order Information:  Available (first quarter 93) at all major booksellers or order direct at (800) 762-2974.  IDG Books Worldwide, Inc.


Running Microsoft Access

Intermediate

by John Viescas

Running Microsoft Accessthe Microsoft guide to the long-awaited Windows-based relational database softwareis now available from Microsoft Press.

This example-packed, hands-on tutorial and users guide incorporates tips and strategies not covered in the product demonstration.

Author John Viescas provides database concepts and terminology, a comprehensive product overview, and step-by-step instructions. Anyone who needs access to datafrom a small business manager to an enterprise-wide information system administratorwill learn how to use the powerful capabilities of Microsoft Access to build database applications from scratch or to make existing data more accessible.  Price:  $29.95.

Order Information:  Available wherever books and software are sold or by calling
toll-free (800) MSPRESS.


teach yourself... Access

Beginning/Intermediate

by Steve Davis

Teach yourself everything you need to know about Microsofts new database software, Microsoft Access.  Take the Weekend Tour of Microsoft Access and jump right into:

1.	understanding and creating databases and reports

2.	indexing

3.	creating screen forms, queries, and labels.

With teach yourself...Access, youll also learn to modify databases, customize forms and reports, use queries, filters, and macros, and even program in Access Basic.  Price:  $21.95.

Order Information:  Available February 1993.  Call (800) 628-9658 (Telemarketing) or (800) 488-5233 (Individual Sales).  MIS:Press.


Using Access for Windows, Special Edition

Beginning/Intermediate/Advanced

by Roger Jennings and Ron Person

Using Access for Windows, Special Edition addresses the needs of all those using Microsoft Access, whether secretaries or small business owners or application developers.  The book is formatted as a tutorial for beginners, but also explains advanced database concepts and programming techniques to intermediate users, and provides material on the Access Basic macro and programming language for advanced users.

Using Access for Windows, Special Edition combines step-by-step lessons with real-world power-user techniques and examples.  Features covered include: queries, graphics, forms, reports, multiuser capabilities, networking features, macros and programming.  Information on SQL, dynamic data exchange (DDE), and object linking and embedding (OLE) is also presented.  Other key features of the book include the QuickStart Tutorial format with use of tips, notes, and cautions throughout the text.  Price:  $29.95.

Order Information:  Call (800) 528-5331.  Que Publishing.


Your Access Consultant

Intermediate/Advanced

by Martin S. Matthews with Edward Hartmann and William E. Lloyd

When youre ready for the next step, let the experts at Matthews Technology become your Access consultants.  This object-oriented approach to database design with Microsoft Access illustrates general principles and tricks that can be customized and applied to an infinite variety of situations.  All code in the book is included on a high-density disk, along with fully operational database systems that have been developed with Microsoft Access.  An incredible bargain!  Price:  $39.95.

Order Information:  Available June/July 1993.  Prima Publishing Inc.


Access Advisor

Access Advisor is the magazine that teaches you how to use all the power of Microsoft Access.  Each issue is crammed with information for users of all types, from novice to expert developer.  As a Charter subscriber, youll receive a one-year subscription (6 issues) for only $29 (plus shipping charges outside the U.S.).  This is 25% off the cover price.  A companion disk is available for an additional $60 (50% savings).  Dont miss an issue!

Order Information:  Call (800) 336-6060 or (619) 483-6400.  Advisor Communications International, Inc.


Inside Microsoft Access

If you want to gain a complete understanding of Microsoft Access, Inside Microsoft Access, a monthly publication from The Cobb Group, will provide you with the skills you need.  The articles in Inside Microsoft Access will give you vital information you cant find in books and manualstips and techniques you can use right away to work smarter and faster with Microsoft Access.

The Cobb Group publishes a wide-range of respected software journals including Inside Visual BasicTM for Windows, The Microsoft C/C++ Developers Journal, and Inside Microsoft Windows. A one-year subscription to Inside Microsoft Access (12 issues) costs $49.

Order Information:  To request a free issue of any publication, call (800) 223-8720.  The Cobb Group.


Smart Access

Smart Access, Pinnacle Publishings monthly technical journal for Microsoft Access users, will help you make the most of your Microsoft Access databases from day one.  Our expert authors will show you the ins and outs of queries, macros, forms, reports, and Access Basic code (ABC), as well as how to make the move to Microsoft Access from other database platforms.  You wont have to spend tedious hours digging through the manuals for solutionsand youll save enough time and money to pay for your subscription many times over!

Order Information:  Subscribe to Smart Access today12 monthly issues for just $79youll receive the accompanying source code disks (a $60 value) FREE!  Call (206) 251-1900, (800) 231-1293, or fax (206) 251-5057.  Pinnacle Publishing, Inc.,
P.O. Box 888, Kent, WA 98035-0888.


action

The basic building block of a macro; a self-contained instruction that can be combined with other actions to automate tasks.  This is sometimes called a command in other macro languages.


action argument

Additional information required by some macro actions for example, the object affected by the action or special conditions under which the action is executed.  You enter action arguments in the lower portion of the Macro window.


action list

A list of all actions you can use with a macro.  The list appears when you click the down arrow in the Action column of the Macro window.


action query

A category of queries that includes append, delete, make-table, and update queries.  Delete and update queries change existing data; append and make-table queries move existing data.  In contrast, select queries don't move or change data; they ask a question and return a dynaset.


append query

An action query that adds the records in a querys dynaset to the end of an existing table.


attached table

A table stored in a file outside the open database but from which Microsoft Access can access records.  You can add, delete, and edit records in an attached table, but you can't change its structure.


bound control

A control on a form or report that is tied to a particular field in the underlying table, query, or SQL statement.  For example, a text box that displays an employee's last name is bound to the Last Name field in the Employees table.


bound object frame

A control used to display and manipulate OLE objects that are stored in tables on forms and reports.


breakpoint

A line of code in a Function or Sub procedure at which Access Basic automatically halts execution.  After execution has been halted, you can use debugging tools, continue execution, edit a procedure, or reinitialize the code.  Microsoft Access displays the line in bold type.


caption

The name displayed on a label or the name displayed in the caption bar at the top of a form in Form view or Design view.


case-sensitive

A requirement that text be an exact match of uppercase and lowercase letters.


cell

The intersection of a row and column in a datasheet or grid.  In the Categories datasheet, for example, Seafood is the value in the cell located at the intersection of the third row and the Category Name column.


check box

A control that indicates whether an option is selected or cleared.  An X appears in the box when the option is selected.


Clipboard

The temporary storage area used by the operating environment to store text, graphics, and other data.  You transfer the data to and from the Clipboard using Copy and Paste commands.


column

The visual representation of a field in a datasheet, the QBE grid, or the Filter window grid.  In a datasheet, a column is a stack of values showing the value in that field for every record.  In the QBE and Filter window grids, a column is a stack of information, such as sort order, about each of the fields included in the query or filter.


combo box

A control, similar to a list box and text box combined, in which you enter a value or select an item from a list.


command button

A control that runs a macro or calls an access Basic function.  This is sometimes called a push button in other applications.


comment

Text that you can add to a macro or table to describe or annotate your work.  In Access Basic, a comment is text embedded in the code (but ignored by Access Basic) that explains how the code works or describes what the code does.  Comments in Access Basic must be preceded by an apostrophe (') or the reserved word Rem.


continuous form

A form that displays more than one record on the screen in Form view.  You can create a continuous form by setting a form's DefaultView property to Continuous Forms.


control

A graphical object, such as a text box, an unbound object frame, a rectangle, or a command button, that you place on a form or report to display data, perform an action, or decorate the form or report.


Control menu

The menu in the upper-left corner of an application or a window.  It contains commands to move, resize, and close the window and is designated by a short horizontal line rather than by a menu name.


control properties

Attributes of a control on a form or report that affect the appearance or behavior of the control.  BorderStyle is an example.


Counter data type

A field data type.  Such fields store sequential numbers automatically inserted by Microsoft Access.


criteria

A set of limiting conditions, such as Denmark (meaning equal to Denmark) or > 30000, used in creating a query or filter to show a specific set of records.


crosstab query

A query that computes a grid of summary totals based on values for each row and column.  For example, a monthly sales-by-region query is a crosstab query.


crosstab report

A report in which you calculate totals for fields you select and group them by date year, quarter, month, week, or day.  The data is displayed in a row-and-column format with the date at the top of each column.


Cue Cards

An online coach that walks you through the most common Microsoft Access tasks as you work with your own data.  Choose Cue Cards from the Help menu.


Currency data type

A field data type and an Access Basic data type.  The Currency data type is useful for calculations involving money or for fixed-point calculations in which accuracy is extremely important.  This data type is used to store numbers with up to 15 digits to the left of the decimal point and 4 digits to the right.  The type-declaration character in Access Basic is @.


data type

The attribute of a variable or field that determines what kind of data it can hold.  Supported data types include field data types for end-user tasks and Access Basic data types for programming tasks.


database

A collection of data related to a particular topic or purpose.  A database file can contain tables, queries, forms, reports, macros, and modules.


database objects

Tables, queries, forms, reports, macros, and modules.


Database window

The window that appears when you open a Microsoft Access database.  It contains Table, Query, Form, Report, Macro, and Module buttons that you can click to display a list of all objects of that type in the database.


datasheet

A window that displays data from a table, form, or query in a row-and-column format.


Datasheet view

A window that displays data from a table, form, or query in a row-and-column format.


DDE

An established protocol for exchanging data between applications that run with Microsoft Windows.


delete query

An action query that deletes a set of rows that match the criteria you specify.


Design view

A window in which you design tables, queries, forms, and reports.


dialog box

A window in which you select options before Microsoft Access carries out a command.


disabled field

A field that appears dimmed on a form, can't be tabbed to, and won't respond to typing or clicking.  You disable a field by setting its Enabled property to No.


DLL

A set of routines that extend the capabilities of Microsoft Access.


dynaset

The set of records that results from running a query or applying a filter.  Microsoft Access updates the data in the underlying table or tables when you make changes to a dynaset.


Access Basic

The programming language used by Microsoft Access.


equi-join

A join that combines records from two tables whenever there are matching values in a field common to both tables.


event

A user action, such as a mouse click or key press, recognized by Microsoft Access.  Using certain properties, you can tell Microsoft Access to run a macro in response to an event.


expression

Any combination of operators, constants, functions, and names of fields, controls, and properties that evaluates to a single value.  You can use expressions as settings for many properties and action arguments, to set criteria or define calculated fields in queries, and to set conditions in macros.  You also use expressions in Access Basic.


external table

A table outside the open Microsoft Access database.


field

A category of information, such as last name, that is stored in a table.  A field is represented as a column in a datasheet and as a control on a form.


field data type
field data types

The set of data types you can choose from for a field in a Microsoft Access table.  Microsoft Access has eight field data types: Counter, Currency, Date/Time, Memo, Number, OLE Object, Text, and Yes/No.


field list

A small window that lists all the fields in an underlying table or query.  You can display field lists in forms, reports, and queries; Microsoft Access automatically displays the appropriate field lists in the Filter window.


field properties

Attributes of a field that affect its appearance or behavior.  FieldSize is one example.  The list of field properties for a field appears in the lower half of a table's Design view when you select the field.


filter

A set of criteria applied to records in order to show a subset of the records or to sort the records.


footer

Text and/or graphics appearing at the bottom of each page, at the end of a form or report, or after a group of records.  Microsoft Access uses three kinds of footers: page footers, form and report footers, and group footers.


foreign key

One or more table fields that refer to the primary key field or fields in another table.


form

A Microsoft Access object on which you place controls for entering, displaying, and editing data in fields.


form footer

Text and/or graphics that appear at the bottom of a form on screen or at the end of the form in print.


form header

Text and/or graphics that appear at the top of a form on screen or at the beginning of the form in print.


form properties

Attributes of a form that affect its appearance or behavior.  DefaultView is one example.


Form view

A window that displays data one record at a time in fields on a form.  Using Form view is the primary method for adding and modifying data in a table.


Form window

A window in which you work with forms in Design view, Form view, or Datasheet view.


function

An Access Basic procedure that returns a value.  It can be used in Access Basic programming or in Microsoft Access expressions.


graph

A control used to display a graph in a form or report.


graph report

A report that displays a graph.


GraphWizard

An AccessWizard you use to create a form containing a graph.


group footer

Text and/or graphics that appear at the bottom of a group in a report.


group frame

A box that encloses a group of controls that provide a limited set of alternatives for users to choose among.  Use the option group control to create a group frame that encloses a set of check boxes, option buttons, or toggle buttons.


group header

Text and/or graphics that appear at the top of a group in a report.


group level

Separates groups of data in a report.  It is sometimes referred to as a break level in other database products.


group-level report

A report that organizes data into groups and displays it in a row-and-column format.


header

One or more identifying lines of text that appear at the top of each page, at the top of a form or report, or at the beginning of a group of records.  Microsoft Access includes three kinds of headers: page headers, form and report headers, and group headers.


Help

An online reference in Microsoft Access that contains information about commands and dialog boxes, Microsoft Access procedures, the interface, properties, keyboard equivalents, and Access Basic.


horizontal scroll bar

A scroll bar that appears along a horizontal axis.  You use it to scroll left and right within a form, query, datasheet, or report.


Immediate window

A window in which you can execute individual lines of Access Basic code, usually for the purpose of debugging.  You can use this window anytime a module is open.


index

A Microsoft Access feature that speeds data access by ordering the values in a field.  You can specify an index by using the Indexed property (a field property) or, for multiple-field indexes, by using the Index1...Index5 properties (table properties).


join

A database operation that combines some or all records from two tables.  Microsoft Access supports several kinds of joins:

An equi-join, which combines records from two tables whenever there are matching values in the joined fields.

An outer join, which includes all the records from one table and only those records from the second table in which the joined fields are equal.  In the Join Properties dialog box, you can specify which table will contribute all of its records.

A self -join, which is a table joined to itself.  A self-join is useful when you ask hierarchical questions, such as a query that shows all the managers and the people who report to them.


label

A control that displays descriptive text, such as a title, a caption, or instructions, on a form or report.


link

A connection between a source document and a destination document.  A link inserts a copy of information from the source document into the destination document while maintaining the connection between the two documents.  When the information changes in the source document, the changes are reflected in the destination document.


list box

A control that provides a list of choices.  A list box consists of a list and an optional label.


list index

The sequence of numbers for items in a list, starting with 0 for the first item, 1 for the second item, and so forth.


macro

An action or a set of actions you can use to automate tasks.


macro group

A collection of related macros that are stored together.  It is often referred to simply as a macro.


Macro window

The window in which you create and modify macros.


make-table query

An action query that creates a new table from the dynaset of an existing query.


Memo data type

A field data type.  Such fields can contain up to 32,000 characters.


menu

A list of commands, available at the top of a form or window, that is displayed when you click a menu name on a menu bar.


menu bar

The horizontal bar below the title bar that contains the names of Microsoft Access menus.  You can click a menu name to display the list of commands.


modal

A type of form that retains the focus until you close it.  Most modal forms are dialog boxes, warnings, or pop-up forms.


navigation buttons

The four arrows in the lower-left corner of a datasheet and in Form view.  You click the arrows to move through the records as follows:

The navigation buttons are also available during previewing so that you can move through the pages of your document.


network

A group of computers and other devices that can interact by means of a shared communications link.


normalize

To minimize the duplication of information in a relational database through effective table design.


null field

A field containing no characters or values.  A null field isn't the same as a field with a value of 0.


Number data type

A field data type designed for numerical data that will be used in mathematical calculations.  Use the Currency data type, however, to display or calculate currency values.


object

One of the following types of entities: (1) controls and database objects tables, queries, forms, reports, macros, and modules; (2) special system objects, such as Debug and Screen; and (3) in OLE terminology, information such as a graph, a drawing, or a table that can be linked or embedded.


OLE

A protocol by which an object, such as a graph, in a source application or document can be linked to or embedded in a destination document, such as a form or a report.


OLE object

An object in an application that supports object linking and embedding (OLE) and that can be linked and/or embedded.


option button

A control that can be selected or cleared like a check box.  It's typically used as part of a group in which the user can select one and only one option button.  This button is sometimes called a radio button in other applications.


option group

A control used to create a field on a form or report that frames a set of check boxes, option buttons, or toggle buttons and provides a limited set of alternatives for users to choose among.  For example, to enable users to choose a method of payment, you could use an option group with three option buttons:  Cash, Check, or Credit Card.


outer join

An outer join includes all the records from one table and only those records from the second table in which the joined fields are equal.  In the Join Properties dialog box, you can specify which table will contribute all of its records by choosing option 2 or option 3.  (In database terminology, option 2 is called a left outer join and option 3 is called a right outer join.)


page break

A control you use to insert page breaks in printable objects, such as reports and forms.  You also use this control to insert breaks in multiple-screen forms.


page footer

Text and/or graphics that appear at the bottom of a page in a form or report.


page header

Text and/or graphics that appear at the top of a page in a form or report.


Palette

A dialog box containing choices for color, special effect (raised or sunken), border, and width that you use when designing a form or report.


parameter query

A query that asks you to enter one or more criteria values, such as "Nairobi" for City, before the query is run.  A parameter query is not, strictly speaking, a separate kind of query; rather, it extends the flexibility of other queries (except for crosstab queries).


permissions

A set of attributes that specify whether or not a user has access to objects in a database and what kind of access is allowed.  For example, Read Data indicates that a user can view but not edit data.


pixel

An abbreviation for "picture element"; a dot that represents the smallest graphic unit of display on the screen.


point size

The height of a printed character.  A point equals approximately 1/72 of an inch, or 1/28 of a centimeter.


pop-up
pop-up form

A window, dialog box, or submenu that stays on top of other windows.  For example, the toolbar and Palette are pop-up forms containing tools to help you do your work.  In Help, pop-up windows are used to display definitions and lists of topics.


primary key

One or more fields whose value or values uniquely identify each record in a table.


Print Preview
preview

To view data or modules as they will appear when printed.  There are two preview windows:  Print Preview and Sample Preview.

The Print Preview window is available for forms, reports, datasheets, and modules.

The Sample Preview window is available only for reports in Design view.  Sample Preview provides a quick view of the basic layout of a report but may not include all the data in the report.

In either window, you can choose the Zoom button to switch between a close-up view of a portion of the page and the full view of the page.  Click the navigation buttons in the lower-left corner of the windows to page through the document.

When you preview a report, Microsoft Access displays the report initially in close-up view as shown below.


property sheet

The window in which you can view or modify the properties of a selected object.


QBE (query by example)
QBE

A technique for designing queries.  With graphical QBE, which Microsoft Access uses, you create queries visually by dragging the fields you want to include in the query from the upper portion of the Query window to the QBE grid in the lower portion of the window.


query

With a query you ask a question about the data stored in your tables or perform an action on the data.

Select queries ask questions about the data stored in your tables and return a dynaset without changing the data.  Once the dynaset is displayed, you can view and change the data in the underlying tables.

Action queries change data or move data.  Append, delete, make-table, and update queries are action queries.

Crosstab queries compute summary totals based on values for each row and column.

Parameter queries, which are not a separate type of query, extend the flexibility of other queries by prompting you to change certain criteria each time the query is run.


Query window

A window in which you work with queries in Design view or Datasheet view.


record

A collection of data about a person, a place, an event, or some other item.  A record is represented as a row in Datasheet view of a table, query, or form.


record selector

A small box or bar that you can click to select an entire record in Datasheet view of a table, query, or form and in Form view.


refresh

To redisplay the records in a form or datasheet to reflect changes and indicate deletions that other users have made (in a multiuser environment) or that you have made elsewhere.  You can't use the Refresh command to display newly added records.  Also, Refresh won't rerun a query or reapply a filter to display new records that meet the criteria or eliminate records that no longer meet the criteria.


relational database

A database in which data is stored in tables, allowing for more efficient and nonredundant data storage and manipulation.


relationship

A connection established between common fields (columns) in two tables.  A relationship can be one-to-one, one-to-many, or many-to-many.


report

A Microsoft Access database object that presents information formatted and organized according to your specifications.  Examples of reports are sales summaries, phone lists, and mailing labels.


report footer

Text and/or graphics that appear at the end of a report and typically contain summaries.


report header

Text and/or graphics that appear at the beginning of a report and typically contain a title, the print date, and a company logo.


report properties

Attributes of a report that affect the appearance or behavior of the report.  For example, you can set the PageHeader property so that a page header appears on every page in a report or on every page except the first.


Report window

A window in which you work with reports in Print Preview or Design view.


requery

To update records in the active form or datasheet to reflect changes to the records, display newly added records, and eliminate deleted records.


row

The visual representation of a record in Datasheet view of a table, query, or form.  In a table's Design view, a row contains information about a field.  In a query's Design view and in the Filter window, a row contains information about queries or filters.  In the Macro window, a row contains information about an action.


row selector

A small box or bar that you can click to select an entire row in a table's Design view or in the Macro window.


ruler
rulers

On-screen rulers that you can display by choosing the Ruler command from the View menu.  You use the rulers to align controls horizontally or vertically on a form or a report.


run time

The time during which an application is running.  During run time, you can interact with an application.


run-time error

An error that Microsoft Access can detect only when an application is running.


section

A part of a form or report, such as a header, footer, or detail section.


section properties

Attributes of a form or report section that affect the appearance or behavior of that section.  For example, you can set the SpecialEffect property to specify a three-dimensional effect or color for a form or report header.


security

A set of features used to specify or restrict data access to prescribed users or user groups.


select statement
select query

A query that asks a question about the data stored in your tables and returns a dynaset in the form of a datasheet without changing the data.  Once the dynaset is displayed, you can view and make changes to the data in the underlying tables.  In contrast, action queries do make changes to your data.


self-join

A join of a table to itself.  Use a self-join to create a query that includes two copies of the same table.


separator

A character that separates units of text or numbers.  It is set in the International section of the Microsoft Windows Control Panel.

A list separator separates items in a list (0,3,2).

A thousand separator separates groups of three digits in numbers (2,000 or 456,871,029).

A decimal separator separates integer parts of a number from its fractional parts (9.35).

A field separator separates items in imported or exported text files.

Note   In Microsoft Access, a semicolon is the default list separator and does not have to be set in the International section of the Windows Control Panel.  This is not true for Access Basic, however, which generally uses a comma.


setting

The value of a property that determines how an object or a control looks or behaves.  For example, if you set the SpecialEffect property of a text box to Raised, the box will look three-dimensional.


shortcut key

A function key or a key combination, such as F5  or Ctrl+A, that enables you to carry out a command.  In contrast, an access key enables you to open a menu or select a control by typing a designated letter while pressing the Alt key.


single stepping

A debugging technique that enables you to trace macro execution one action at a time or Access Basic code execution one line at a time.


sort order

The order in which records are displayed either ascending (A-Z or 0-100) or descending (Z-A or 100-0).


Sorting and Grouping window
Sorting and Grouping box

The workspace in which you specify the order of your data and define the group levels for a report.


source

A document or application that supplies data in a DDE conversation or in an OLE operation.


SQL

A language used in querying, updating, and managing relational databases.  You can view or write Microsoft Access queries as SQL statements using the SQL command in the Query window.  You can use SQL SELECT statements anywhere Microsoft Access accepts a table name, query name, or field name.  For example, you can use an SQL SELECT statement in the RecordSource property of a list box on a form to generate a list of items.


string

A collection of characters that can include both numbers and text.


subform

A form contained within another form or report.


submenu

A menu that opens when a command in a higher-level menu is chosen.


subreport

A report contained within another report.


tab order

The order in which the focus moves from one field or button to the next as you press the Tab key.


table

The fundamental structure of a relational database management system.  In Microsoft Access, a table is an object that stores data in records (rows) and fields (columns).  The data is usually about a particular category of things, such as employees or parts.


table properties

Attributes of a table that affect the appearance or behavior of the table as a whole.  One example is the PrimaryKey property.


text

Data consisting of ASCII characters that represent words and symbols.


text box

A control that provides a place to enter or view text in a form or report.  This is sometimes called an edit field in other applications.


Text data type

A field data type.  Such fields can contain up to 255 characters or the number of characters specified by the FieldSize property, whichever is less.


title bar

The bar that appears at the top of the Microsoft Access window and displays its name.


toggle button

A control that acts as an on/off button.  A toggle button can display either text or a picture and can stand alone or be part of an option group.


toolbar

A bar at the top of the Microsoft Access window containing a set of buttons that you can click to carry out common menu commands.  The items displayed on the toolbar depend on which window has the focus.


toolbox

The set of tools you use at design time to place controls on a form or report.  The toolbox usually appears on the left side of the screen.  You can show or hide the toolbox using the View Toolbox command.

Note   To get information on any of the tools in the toolbox while working in Microsoft Access, display the toolbox, click a tool, and press F1 for Help.


topic

The subject of a dynamic-data exchange (DDE) conversation between two applications.  For example, in the syntax Excel|System!Status, System is the topic.


totals query

A query that displays totals or other kinds of summary calculations for values in various fields from a table or tables.  Strictly speaking, a totals query is not a separate kind of query; rather, it extends the flexibility of select queries.


twip

Unit of measurement used by Microsoft Access and implemented as 1/1440 of an inch.  (A twip is also 1/20 of a point.) There are 1440 twips to an inch and 567 twips to a centimeter.


unbound control

A control that's not connected to a field or an expression.  You can use unbound controls to display informational text, such as instructions about using a form, or graphics and pictures from other applications.  For example, lines and rectangles are unbound controls, and text boxes can be either bound or unbound controls.


unbound object frame

A control you place on a form to contain an unbound object, which is an object, such as a picture, whose value isn't derived from data stored in a table.


update query

An action query that changes a set of records according to criteria you specify.


validation

The process of checking whether entered data meets certain conditions or limitations.


validation rule

A rule that sets limits or conditions on what can be entered in a particular field.  Microsoft Access displays an error message whenever the rule is violated.  Rules are set with the ValidationRule property in the property sheet of a table or form.


value

The contents of a field, such as a name in a First Name field.


vertical scroll bar

A scroll bar that appears along a vertical axis.  You use it to scroll up and down through a form, query, datasheet, or report.


view

A window that allows you to work with a Microsoft Access object in a certain way.

In Design view, you can design an object the way you want it to look.

In Datasheet view, you can modify and view data in a row-and-column format.

In Form view, you can modify and view data in fields on a form.

In Print Preview, you can see how an object will appear when printed.


WHERE clause

The part of an SQL statement that specifies which records to retrieve.


The asterisk (*), question mark (?), number sign (#), exclamation point (!), hyphen (-), and brackets ([ ]) are wildcard characters.  You can use these characters in queries, commands, and expressions to include all records, file names, or other items that begin with specific characters or match a certain pattern.  You can also use wildcard characters and matching characters to further refine a search.

Symbol	Example	Usage
*	wh* finds what, white, and why *at finds cat, bat, and what	Like the MS-DOS asterisk (*) wildcard character, this asterisk matches any number of characters.  But unlike MS-DOS, it can be used as the first or last character in the character string.
?	b?ll finds ball, bell, and bill	Like the MS-DOS ? wildcard character, this symbol matches any single character.
#	1#3 finds 103, 113, 123	Matches any single digit.
[ ]	b[ae]ll finds ball and bell but not bill	Matches any single character within the brackets.
!	b[!ae]ll finds bill and bull but not bell	Matches any character not in the list.
-	b[a-c]d finds bad, bbd, and bcd	Matches any one of a range of characters.


aggregate function

A function, such as Count, Avg, and Var, that you use in creating a query that calculates totals.  You can select aggregate functions in the Total row of the QBE grid.  In writing expressions and in programming, you can use SQL aggregate functions (including the three listed above) and domain aggregate functions to determine various statistics.


calculated control

A control on a form or report that displays the result of an expression rather than stored data.  The value is recalculated each time a value in the expression changes.  A calculated field is a field defined in a query that displays the result of an expression rather than stored data.


delimited text file

A file containing values separated by commas, tabs, semicolons, or other characters.


exclusive

A way of opening a database that restricts other users or programs from accessing the database.  You can use the Exclusive and Read Only options in the Open Database command dialog box to prevent others from opening the database or to limit their access to viewing but not modifying the database.


fixed-width text file

A file containing values arranged so that each field has a certain width.


group

A collection of user accounts in a secure system, identified by group name and PIN (personal identification number).  Permissions assigned to a group apply to all users in the group.

In a report, group refers to a collection of records.  You can separate records into groups in a report and display introductory and summary data for each group.


ODBC (Open Database Connectivity)
ODBC

A standard protocol for SQL database servers, such as Microsoft SQL Server.  You can install ODBC drivers that allow Microsoft Access to connect to these SQL database servers and access the data in the SQL databases.


one-to-one relationship

A relationship between tables in which each record in the primary table can be associated with only one record in the related table.  Additionally, the related fields must be the primary keys of both tables.  When you create a one-to-one relationship, Microsoft Access lets you select only primary key fields as matching fields.


one-to-many relationship

A relationship between tables in which each record in the primary table can be associated with many records in the related table (each primary key value can appear many times in the related table).


PIN

A four-digit number that Microsoft Access uses in combination with the account name to identify a user account or group of accounts in a secure system.  You enter the PIN and the account name when creating the account or group.


read only
read-only

A type of access to a database whereby you can view but not modify data and database objects.  Read Only is one of the dialog box options for the Open Database command on the File menu.  You can also make a particular form or record read-only by setting the appropriate properties.


referential integrity

Rules that you follow to preserve the defined relationships between tables when you enter or delete records.  If you enforce referential integrity, Microsoft Access prohibits you from adding records to a related table for which there is no primary record, changing values in a primary table that would result in orphan records in a related table, and deleting records from a primary table when there are matching related records.


update

To accept changes to data in a control or record.  Until the record is saved, these changes are stored in a temporary record.  The changes are saved in the database when you move to another record on a form or datasheet or when you explicitly save the record.


user account

An account identified by a user name and PIN (personal identification number) that is created to manage access to database objects in a secure system.


alias

Access Basic:  An alternate name you give to an external procedure to avoid conflict with an Access Basic reserved word, global variable, constant, or a name not allowed by the standard naming conventions.

SQL:  An alternate name you give to a field or expression in a SELECT statement, often shorter or more meaningful.


command line

The string of characters used to invoke an application.  For example, you enter a command line when you create a program item in the Microsoft Windows Program Manager, when you start Microsoft Access by choosing Run from the File Menu in the Windows File Manager, or when you use the RunApp action.


command prompt

At the MS-DOS command line, the character or characters that appear at the beginning of the line, indicating that the computer is ready to receive input.  Also known as MS-DOS prompt.


installable ISAM

A driver you can install that allows access to external database formats such as Btrieve, dBASE, and Paradox.


library database

A database that contains a collection of database objects that can be loaded automatically when you start Microsoft Access.  You specify that a library database is to be loaded by adding its name to the [Libraries] section of MSACCESS.INI.


Memo object

Access Basic:  An object you can use to hold the contents of a table field that has a Memo field data type.  Memo objects can be up to 32K characters long.


parse

To identify the parts of a statement or expression and then validate those parts against the appropriate language rules for correctness.


system administrator

A member of the group Admins who is responsible for managing and maintaining a database system.  A system administrator can create user accounts and groups and can assign permissions for any database object in the system.


work group

A collection of users in a multiuser environment who share data and the same system database.


action QueryDef

Access Basic:  A variable that contains the definition of an action query.  An action QueryDef must be declared as an object variable, can't be used with a Dynaset or Snapshot, and is used with the Execute method.


aliasing

Access Basic:  A way of assigning an alternate name to an external procedure in a declaration to avoid conflict with an Access Basic reserved word, global variable, constant, or a name not allowed by Access Basic naming conventions (for example, a name that begins with an underscore).


Append mode

Access Basic:  A sequential file output mode that sets the file pointer to the end of a file so that you can add records to the file using the Print # and Write # statements.  The Open statement specifies the mode of access.

The other file input/output modes are Binary, Input, Output, and Random.


argument

A constant, variable, or expression that is passed to an Access Basic procedure.  You use an argument with an operand in an expression or in a macro to supply additional information required by some actions.


bitmap

An image made up of pixels on the screen and stored as a collection of bits, one or more of which correspond to one pixel.  When stored as files, bitmaps usually have the file extension .BMP.


Bookmark

Access Basic:  A property of a recordset object (Table, Dynaset, or Snapshot) that contains a string identifying the current record.  If you assign the Bookmark value to a variable and then move to another record, you can make the earlier record current again by setting the Bookmark property to that string variable.


Boolean

Access Basic:  An expression that can be evaluated either true (nonzero) or false (0).  You can use the reserved words True and False to supply the values of -1 and 0, respectively.  The field data type Yes/No is Boolean and has the value of -1 for Yes and 0 for No.

Several property sheet settings are Boolean, including Yes/No, True/False, and On/Off.


constant

A constant represents a numeric or string value that doesn't change.  True, False, and Null are constants.  You can use constants in expressions in tables, forms, reports, queries, and macros.  In an Access Basic module, you can use the Const statement to declare your own constants.

Microsoft Access also provides intrinsic constants that supply fixed values for action arguments and function values (such as the values returned by the VarType function).


current database

The database opened using the OpenDatabase command from the File menu.  In Access Basic, use the CurrentDB( ) function to return the current database, which you can then assign to a database variable using the Set statement.


current index

For an indexed Table, the index most recently set with the Index property.  It is the basis for ordering records in the Table and is used by the Seek method to locate records.  A Table can have more than one index.


current record

Access Basic:  The record in a recordset that you can modify or retrieve data from.  Use a Move methods to move to the first, last, next, or previous record in a recordset.  Use the Find methods (for a Dynaset or Snapshot) or the Seek method (for a Table) to change the current record position according to specific criteria.


debugging

Access Basic:  The process of finding errors in your program.  Debugging usually involves running specific portions of your program and analyzing code at various points.  You can use breakpoints to stop code execution so that you can examine variables.


Declarations section

Access Basic:  The topmost level of a module that appears before any Sub or Function procedures.  This section contains definitions of user-defined data types, global constants, and global variables.


domain

Access Basic:  A set of records defined by a table, a query, or an SQL expression. Domain aggregate functions return statistical information about a specific domain.


domain function

Access Basic:  A function used to aggregate data over a certain set of records (the domain).  The domain functions are DAvg, DCount, DFirst, DLast, DLookup, DMax, DMin, DStDev, DStDevP, DSum, DVar, and DVarP.


Double data type

Access Basic:  A fundamental data type that holds double-precision floating point numbers.  A Double variable is stored as a 64-bit (8-byte) number ranging in value from -1.79769313486232E308 to -4.94065645841247E-324 for negative values, from 4.94065645841247E-324 to 1.797693134862325E308 for positive values, and 0.  The type-declaration character is # (ANSI character 35).

Double is also a FieldSize property setting.


Dynaset object

Access Basic:  A recordset variable that identifies a Dynaset created using the CreateDynaset method.


Empty

Access Basic:  The state of an uninitialized Variant variable.  Variants that are Empty return a VarType of 0.

Empty is not the same as Null, which is a variable state indicating invalid data.  Variables containing zero-length strings ("") are not Empty, nor are numeric variables having a value of 0.


explicit declaration

Access Basic:  A way to declare variables using a Dim, Global, or Static statement.  If you place an Option Explicit statement in the Declarations section of a module, using implicitly declared variables in the module produces an error.


global variable

Access Basic:  A variable you declare with the Global reserved word in the Declarations section of a module.  A global variable can be shared by all the procedures in every module in a database.


Integer data type

Access Basic:  A fundamental data type that holds integer numbers.  An Integer variable is stored as a 16-bit (2-byte) number ranging in value from -32,768 to 32,767.  The type-declaration character is % (ANSI character 37).

You can use Integers to store Boolean values.

Integer is also a FieldSize property setting.


logic error

A programming error that can cause code to produce incorrect results or halt execution.  A logic error may be caused by using incorrect or similar variable names, incorrect variable types, endless loops, or array problems or by flaws in logical comparisons.

Other kinds of programming errors are syntax errors, compile-time errors, and run-time errors.


Long data type

Access Basic:  A fundamental data type that holds long-integer numbers.  A Long variable is stored as a 32-bit (4-byte) number ranging in value from -2,147,483,648 to 2,147,483,647.  The type-declaration character is & (ANSI character 38).


method

Access Basic:  An operation on a report, recordset, or the Debug or Screen object.  Like properties, methods apply to specific objects and have names that are reserved words in Access Basic.

For example, you can apply the Print method to the Debug object to transfer printed output to the Immediate window.


module

Access Basic:  A collection of declarations, statements, and procedures stored together as one named unit.  Unless explicitly made private to the module in which they appear, procedures in one module are recognized and can be called by procedures in other modules in the same database.


module level

Access Basic:  The scope of a variable you declare in the Declarations section of a module.  The variable can be shared by all the procedures in that module but not by procedures in other modules.


Null

Access Basic:  A reserved word that indicates invalid data.  You can perform validation by assigning Null to a Variant field and then later validating it with the IsNull function.  Variants that are Null return a VarType of 1.

Null is not the same as Empty, which is a variable state indicating uninitialized data.  Zero-length strings ("") are not Null, nor are numeric variables having a value of 0.


page

Access Basic:  A portion of the .MDB (database) file in which record data is stored.  Depending on the size of the records, a page may contain more than one record.


procedure

Access Basic:  A sequence of declarations and code statements that define a Sub or Function procedure.


QueryDef

Access Basic:  An object that contains the SQL statement that describes a query.


reserved word

A word that is part of the Access Basic or Microsoft Access SQL language.  Reserved words include the names of statements, predefined functions and data types, methods, operators, and objects.  Don't use reserved words for variable or object names.


scope

Access Basic:  The attribute of a variable or procedure that determines which sections of which modules recognize it.  There are three levels of scope: global, module, and procedure. Variables that you declare globally can be accessed by any module, whereas variables that you declare in a specific module can be used only within that module.  Further, variables you declare in a Sub or Function procedure can be used only in that particular procedure.


Single data type

Access Basic:  A fundamental data type that holds single-precision floating point numbers.  A Single variable is stored as a 32-bit (4-byte) number ranging in value from -3.402823E38 to -1.401298E-45 for negative values, from 1.401298E-45 to 3.402823E38 for positive values, and 0.  The type-declaration character is ! (ANSI character 33).

Single is also a FieldSize property setting.


Snapshot

Access Basic:  A static image of a set of data, such as the records displayed as the result of a query.  Snapshots are recordsets that can be created from a base table, a query, or another recordset.


Snapshot object

Access Basic:  A recordset variable that identifies a Snapshot created using the CreateSnapshot method.


statement

Access Basic:  A syntactically complete unit that expresses one specific kind of operation, declaration, or definition.  Usually, a statement consists of one line in a procedure or Declarations section.  In most cases, however, you can include more than one statement on a line by separating the statements with a colon (:).


String data type

Access Basic:  A fundamental data type that holds character information.  A String variable can contain approximately 65,535 bytes (64K), is either fixed-length or variable-length, and contains one character per byte.  Fixed-length strings are declared to be a specific length.  Variable-length strings can be any length up to 64K, less a small amount of storage overhead.

The type-declaration character is $ (ANSI character 36).


Sub procedure

Access Basic:  A procedure that carries out an operation.  Unlike a Function procedure, a Sub procedure doesn't return a value.  You declare a Sub procedure with the Sub reserved word and end it with an End Sub statement.


syntax

The prescribed order and punctuation for placing reserved words, variables, and constants in a statement or expression.


syntax checking

Access Basic:  A Module Design option that, when set to Yes, checks the syntax of the code each time you enter a line.


syntax error

An error in the grammatical structure of the code or expression.  If syntax checking is enabled, errors are highlighted when you type a line and press Enter.


system objects
system object

An object defined by Microsoft Access.  The system objects are:

The Forms object and the Reports object.

The Debug object and the Screen object.

Recordset objects (Dynasets, Tables, and Snapshots).

System-defined database objects, such as the table MSysIndexes.  You can display or hide the system-defined database objects by selecting the General options setting after choosing the Options command from the View menu.


Table object

Access Basic:  A recordset variable that identifies a table opened using the OpenTable method.


transaction

Access Basic:  A series of changes made to a recordset.  You mark the beginning of a transaction with the BeginTrans statement.  If you want to commit the transaction, use the CommitTrans statement.  If you want to undo all your changes since BeginTrans, use the Rollback statement.

Transactions are optional and can be nested.


variable

Access Basic:  A placeholder that stores data that can change as Access Basic code runs.  Each variable has a unique name that identifies it within its scope.


Variant

Access Basic:  The default fundamental data type for variables that don't have type-declaration characters when a Deftype statement is not in effect.  A Variant can store numeric, string, date/time, Null, or Empty data.

Variables of other data types convert automatically to a Variant, and Variants attempt conversion to other data types.  You can use the VarType, IsEmpty, IsNull, IsNumeric, and IsDate function to determine the underlying data type of a Variant.


VarType

Access Basic:  A function that indicates the underlying data type of a Variant.  VarType values include:  0 (Empty), 1 (Null), 2 (Integer), 3 (Long), 4 (Single), 5 (Double), 6 (Currency), 7 (Date), and 8 (String).


New Articles
New Articles Since January 14, 1993

INF: Add Database Analyzer to Access Help Menu

INF: Arrow Keys and Mouse Don't Scroll Grid in QBE Grid

INF: Attaching Clipper Tables to Microsoft Access Databases

INF: Checking for EOF and BOF in macros

INF: Converting Currency or Number Values into English Words

INF: Converting Twips to Pixels

INF: Creating a New Linking Column Between Existing Tables

INF: Creating Custom Navigation (VCR) Buttons on a Form

INF: Creating Result Equivalent to SQL UNION Operator Result

INF: dBASE SET DELETED Characteristic in Access

INF: Definitions for Settings in WIN.INI Btrieve Section

INF: Detailed Explanation of the KeepTogether Property

INF: Eliminating White Space in Reports with CanShrink and

INF: Enforcing Transactions on Attached SQL Server Tables

INF: Error MSG: "Unable to connect to data source"

INF: Exporting Queries to ASCII

INF: How to Create Floating Popup Menus for Access

INF: How to Determine if a Form is Minimized

INF: How to Manipulate the Microsoft Access Window

INF: How to Play .WAV Sounds on Events in Access

INF: How to Reference Control/Fields on Subforms

INF: How to Send the Contents of a Control w/SendKeys

INF: Insert Object from File Dialog Missing 'All Files'

INF: Recent File List will Display Deleted .MDB Files

INF: Returning Case Sensitive Match in Queries

INF: Row Fix-up in the NWIND.MDB Order Form

INF: Separating Full Names Into Two Fields in a Query

INF: Set Focus to a Subform Control Using GoToControl Action

INF: Shift+Enter Key Combination vs Ctrl+Enter

INF: Skip Used Mailing Labels and Printing Duplicate Labels

INF: Syntax Error Message May be Due to SList Setting

INF: Updating a Separate Table When a Value Changes on a Form

INF: Use Append Query to Set Initial Value of Counter Field

INF: Use Row Fix-up Technique to Look Up Info Automatically

INF: Using a Subtract Query to Find Unmatched Records

INF: Using Multiple Copies of the Same Table in a Query

INF: Using SHARE.EXE with Microsoft Access

PRACC9301: Incorrect RowSourceType for a combo box may GPFault

PRACC9301: Arrow Keys Don't Scroll Grid in QBE Grid

PRACC9302: Error When Import dBASE, FoxPro, or Paradox Table

PRACC9302: Importing Delimited Text Files Strips Off Decimals

PRACC9302: Running Delete Query Gives Misleading Error Msg

PRB: '|' Isn't A Valid Path Error Message on Start

PRB: Access Error Using Edit Find With the Yes/No Data Type

PRB: Access Toolbox Selection Lost When Closed

PRB: Apply Default Doesn't Change Height or Width of Labels

PRB: Bitmap Does Not Display Correctly in Microsoft Access

PRB: Bound SubReport Does Not Show DDE Data

PRB: Btrieve Files Created with 6.0 Btrieve NLM not Supported

PRB: Can't Change Combo Box Value If ControlSource Is Counter

PRB: Cannot Process Close Action in Report's OnOpen Property

PRB: Clicking Wizard's Background May Change Focus of Control

PRB: Connection Not Open Error Message

PRB: CTRL+HOME in List Box Moves to First Item in List

PRB: Current Record Doesn't Change Immediately on Replace All

PRB: Data Source Not Found, No Default Driver Found Error Msg

PRB: Driver Can't Be Found Error When Attaching SQL Server

PRB: Edit Find Dialog is Modal in Form View

PRB: Empty Table List When Attaching Btrieve Table

PRB: Err Msg: Unable to load communication module

PRB: ERRMSG: Query must have at least one output field

PRB: Error in Column Property Help Menu Topic

PRB: Focus Returns to Control after OnDblClick

PRB: Form Handle Not Released When Closed with Basic Code

PRB: Moving Backward in Report Print Preview Window Is Slow

PRB: No AutoRepeat with GoToRecord/Next and DoMenuItem

PRB: No Field List if Form is Based on SQL Statement

PRB: Not Enough Memory To Run Setup

PRB: Open Object can be Deleted by Another User

PRB: Paste Not Allowed After Record Copied to Clipboard

PRB: Property List Boxes Show Two-Word Options on Two Lines

PRB: Query Fails when Linked SQL Server Table Can't Be Found

PRB: Query Tool bar and Menus Not Updated Concurrently

PRB: Referential Integrity Error With Shared Databases

PRB: Setup Program STFSETUP.EXE Causes GP Fault

PRB: Short Label Autosizes to Cursor Size

PRB: SQL Data Sources Dialog Box Lists No Data Sources

PRB: Stored procedure 'PROCEDURE' not found -- Error Message

PRB: Table Design Edit Menu Commands Grayed Out

PRB: Trailing Spaces Automatically Truncated During Data Entry

PRB: Troubleshooting "ODBC - couldn't find ODBC.DLL" Error

PRB: Troubleshooting Out of Memory Errors in Queries

PRB: Unable to Connect to Attached SQL Server Table Error Msg

PRB: Unfreeze all Columns Does Not Restore Column Order

PRB: User with Full Permissions Can't Change a Query

PRB: Valid Sum Function Returns #Name? in Calculated Control

PRB: WAIT Argument in SendKeys may not Stop Macro Processing


New Articles
Microsoft Access Knowledge Base Since June 20, 1993

Welcome to the Microsoft Access Knowledge Base help file.  This help system includes 227 new articles that were included into the ACC-KB.HLP file relate to the Microsoft Access Relational Data Base for Windows.  Due to the download times from bulletin boards, this file only includes the new articles since the last update of the ACC-KB.HLP file.  To get all Access Knowledge Base articles published by Microsoft, you may want to download ACC-KB.HLP.  This file, ACC-KB.HLP not only includes all the new articles, but also any modifications to older articles that were published in previous ACC-KB.HLP files.

These articles were developed by Microsoft's Product Support Engineers.  This help file is a snapshot of the Knowledge Base as of June 20th, 1993.  New and updated articles can be found on both CompuServe and GENIE.  This help file contains helpful tips, programming examples(INF), known problems(PRB, PRACC), References, and other information that may not be addressed in the manuals.

Please feel free to distribute this information in compliance with the terms of Microsoft.

INF: "Form is read only" error

INF: "ORA-106xx: Message 106xx not found" bug in ORA6WIN.DLL

INF: A Query Within a Query to Simulate a Sub-select

INF: Access 1.0 (rel. 1/14/93) Disks 1-3 Contents 3.5" 1.4 meg

INF: Access 1.0 (rel. 1/14/93) ODBC Disk Cont. 3.5" 1.44 Meg

INF: Access 1.0 (rel.1/14/93) Disks 4-6 Contents 3.5"1.44 meg.

INF: Access Workstation Setup (/N) Instructions Are Confusing

INF: Accessing a Report Dynaset Requires a .Form Reference

INF: Automatic Date Fill When Tabbing Out

INF: Automatically Open a Combo Box Upon Entry

INF: Calculated Fields Must Be Shown to Perform Calculations

INF: Calculating a Credit Card Expiration Date

INF: Calling RegQueryValue() to get an OLE Object Class Name

INF: Can't Create Relationships with Attached Tables

INF: Can't use Analyzer.MDB as Output Database from Analyzer

INF: Cascading  Updates

INF: Changing Area Codes Based on a Telephone Number Prefix

INF: Communicating with Microsoft Access using NetDDE

INF: Concatenating Fields in a Text box to Remove Blank Lines

INF: Conversions for C Data Types in Access Basic

INF: Correct Syntax for TransferDatabase to dBASE and Paradox

INF: Create a Function to Capitalize Words & Sets of Words

INF: Criteria Parameters Require Concatenated References

INF: Currency Format Causes Report Alignment Problems

INF: Data Type of Value Overrides Data Type of Variable

INF: Database Normalization Basics

INF: dBASE's REPORT FORM Command in Access Basic

INF: Default Properties Don't Carry Over on Attached Tables

INF: Deleting Duplicate Records from Two Tables

INF: Determine How Many Instances of Application Are Active

INF: Determining the Version of Catalog Stored Procedures

INF: Disk image of Companion Disk

INF: Displaying Start, Finish, and Elapsed Times on a Form

INF: DoMenuItem Action in BeforeUpdate Property Causes Error

INF: Example Has Wrong Number for Dlookup Ship Postal Code

INF: Executing an Access Macro from Visual Basic using DDE

INF: Expanded Size of the Companion files

INF: Explanation of Option Compare Database

INF: Extend Mode and ESC in Form View

INF: Filling a Multiple-Column List Box by Using Access Basic

INF: Filter Values to Appear in a Combo Box

INF: Finding Out What User You Are Logged

INF: Finding the OLE Class of an Embedded Object

INF: Formatting Axis Labels in Graphs

INF: Four Ways to Goto a Record from a Combo Box Selection

INF: Function to Calculate Age

INF: Functions to Left and Right Pad Character Strings

INF: General Number Format Ignores Decimal Number Setting

INF: Graph May Not Hold Formatting

INF: How Access Variable-Length Fields Export to dBASE

INF: How First Line of Data is Used to Import Delimited Text

INF: How NWIND.MDB Employee Field Photographs Were Created

INF: How To Call Functions using a String Variable

INF: How to Change Default Template for Forms and Reports

INF: How to Change the 'Microsoft Access' Window Caption

INF: How to Change the Font for the Zoom Box

INF: How to Confirm Editing of a Field

INF: How to Convert to and from Unsigned Integers in Access

INF: How To Create a 'Please Wait' Message

INF: How to Create a Query By Form

INF: How to Create Parameter IN() Statement

INF: How to Create Synchronized Combo Boxes

INF: How to Determine Number of Working Days Between Two Dates

INF: How to Determine What View a Form is Displayed

INF: How to Determine when a Shelled Process Has Terminated

INF: How to Determine Whether a Menu Item Is Checked

INF: How to Execute Macro Actions Using DDE

INF: How to Find the Difference Between 2 Time Values

INF: How to get information into Microsoft Access using DDE

INF: How to Get the Last Two Digits of the Year

INF: How to Implement a Timer in Access

INF: How to Import a Microsoft Windows Cardfile Data File

INF: How to Position Microsoft Access on the Screen

INF: How to Print A Single Record From a Form in a Report

INF: How To Print Duplicate Labels

INF: How to Remove a Form's Menu Bar

INF: How to Remove the Caption on a Form

INF: How to Send Information to the Clipboard

INF: How to Simulate Changing the Record Source of a Form

INF: How to Specify a Custom Starting Page Number for a Report

INF: How to Synchronize Two Combo Boxes on a Form

INF: How to Use Access Basic to Derive Statistical Mode

INF: How To Use The CTL3D.DLL In Your Access Database

INF: How to Use the Windows OpenFile Dialog Box

INF: How to Wait for a Shelled Process to Finish

INF: Identify Records with Duplicate Data in Primary Key

INF: Implementing Counter values on Attached SQL Server tables

INF: Importing, Exporting, and Attaching FoxPro Data

INF: Importing Word Print Merge Data Files to Microsoft Access

INF: Improved Print Merge Feature In Microsoft Access 1.1

INF: Install Process of the Companion Disk

INF: Installing Access on a DEC Pathworks Network

INF: Items in a Module Run Menu Are Unavailable (Grayed Out)

INF: Join Type Mismatch Errors Caught at Runtime

INF: Limit to List Set to Yes Needs a Unique Entry

INF: Macro to Enter Date Record Was Last Modified

INF: Mail Merge Using Access Reports

INF: Making a Subform Uneditable and Unenterable

INF: Maximum Number of Rows in Table When Counter is the Key

INF: Microsoft Access Does Not Use Record Numbers

INF: Misleading Documentation for Cancel Property

INF: Multiple Selection List Box Example

INF: Nulls Allowed in Foreign Key With Ref. Integrity

INF: Number of Time a Custom Function Executes in a Query

INF: NWIND Example Has Wrong Number for Dlookup Ship Postal Code

INF: OpenDatabase and CloseDatabase Pseudo Actions

INF: OpenTable Action Argument Does Not List Attached Tables

INF: Operators as Field Names in Query Cause Error Message

INF: Ordering of Items on Graph

INF: Page Locking, No Cluster Indexing Support

INF: Part 1: DDE in Visual Basic to Request Data from Access

INF: Part 2, DDE in Visual Basic to Request Data from Access

INF: Passing a Null Pointer to an External DLL

INF: Print a Sequential Number For Each Detail Line

INF: Print Total Number of Pages on Each Page of Report

INF: Query Optimizing Tips for Attached SQL Database Tables

INF: Query Window Doesn't Always Scroll to Record

INF: Quit Macro Action

INF: Recovering MDB File Larger Than the 128-Megabyte Limit

INF: Removing alpha characters from an alpha/numeric field

INF: Requery, Repaint, and F9/Records Refresh

INF: Requirements to Connect to Sybase SQL Server

INF: Restrictions on Compound Indexes

INF: Round or Truncate Values to Desired Number of Decimals

INF: Sample DDE Macro Communicates with Microsoft Excel 4.0

INF: Sample Preview Ignores Query

INF: Screen Fonts May Not Match Printer Output Fonts

INF: Searching for Characters/Strings in Records

INF: Security Settings for Modifying Data in a Query Dynaset

INF: Sending a MAPI Mail Message from Microsoft Access

INF: Sending the Current Record to Word for Windows with DDE

INF: Short Description of a Dynaset

INF: Size To Fit a Label Without Using Layout Menu

INF: Sorting String Values Based on their Numeric Values

INF: Sorting Text Fields With "A", "An", "The" in Text

INF: SQL Server Views Read Only When Attached

INF: Stored Procedures for Microsoft and Sybase SQL Server

INF: Strange Stored Procedures Found in SYSOBJECTS Table

INF: Tile and Cascade Items Inconsistent with Program Manager

INF: Troubleshooting Access Setup and Installation

INF: Upper limit on QueryTimeout and LoginTimeout

INF: Use of Constants as Field Names in a Query

INF: Using '<' and '>' and '=' Operators in Query Parameters

INF: Using Access Basic to Derive a Statistical Median

INF: Using DataPerfect data in Microsoft Access

INF: Using Microsoft Word to Edit & Spell Check a Memo Field

INF: Using Parameterized Queries in Access Basic

INF: Using the .Parent Property of a Subform

INF: Using WIN.INI & ODBC.INI When Attaching SQL Server Table

INF: Using WordPerfect Print merge Secondary Files in Access

INF: Validating Data with Values From Another Table

INF: Writing Functions to Be Called from Events or Expressions

PRACC1115: ApplyFilter Action Causes Form To Be Read-Only

PRACC1405: System Hangs When Minimizing Access Window

PRACC9210: '#' Appears in Attached Table Name in Error Message

PRACC9210: Fast Search on Indexed Paradox Column Fails

PRACC9210: MS Access Ignores Paradox Private Directory Rules

PRACC9210: Null Boolean Values Default to False

PRACC9210: Opening Objects in Transactions Can Cause Rollback

PRACC9210: Reports Unusable Without Default Windows Printer

PRACC9210: Cannot Use ReportWizard Without Default Win Printer

PRACC9210: StDevP() with All NULL Records Returns #ERROR

PRACC9211: Can't Export Paradox/dBASE Tables

PRACC9301: Access GP Faults in Datasheet View of a Form

PRACC9302: Syntax Error When "(" is First Chr in Criteria Cell

PRACC9303: Access Cue Cards Don't Use Standard Windows Menu

PRACC9303: Bad Results Searching Multicolumn Paradox Indexes

PRACC9303: Can't Add Counter Columns to Tables w/ > 4 MB Data

PRACC9303: Descending Sort Query Returns Wrong Number of Rows

PRACC9303: Error: Not Enough System Resources in Access

PRACC9303: File Truncation on Password-Protected Servers

PRACC9303: Form Record Selector Buttons Disabled

PRACC9303: GP Fault on Update Query Due to Query Design Option

PRACC9303: GP Fault Referencing Form Dynaset w/ Form Variables

PRACC9303: GP Fault Using Invalid IIf() as ControlSource

PRACC9303: GPF Declaring New Object Variable During Break Mode

PRACC9303: GPF Hiding Control in Form Footer in Datasheet View

PRACC9303: GPF Using Empty String with CVDate() or IsDate()

PRACC9303: GPF Using OpenForm Action to Hide Modal Pop-Up Form

PRACC9303: GPF When RunningSum Attempts to Evaluate #ERROR

PRACC9303: GPF When Using ListParameters Method on Database

PRACC9303: Hang Importing .DBF Files Longer Than dBASE IV Max.

PRACC9303: Hang Importing Large Lotus 1-2-3 Spreadsheets

PRACC9303: Multiple Users Adding Fields Causes Cross-Linking

PRACC9303: Orders Form Doesn't Print/Preview SubTotal & Total

PRACC9303: Password Is Case Sensitive But Verification Is Not

PRACC9303: Screen Redraw Problems When Reordering Groups

PRACC9303: Setting OLE Object Property May Cause GP Fault

PRACC9303: Setup Leaves MS-SETUP.T Directory and Files on Disk

PRACC9303: SHIFT+HOME Does Not Select All the Text

PRACC9303: User with Full Permissions Cannot Run Query

PRACC9304: Cue Cards Can't Be Started Because Incomplete Setup

PRACC9304: GPF Printing Subreport with Datasheet Default View

PRACC9304: Importing Numeric Column Names from Spreadsheet

PRACC9304: Invalid Results in Subreport When CanGrow = Yes

PRACC9304: Query Progress Meter Reports Status Incorrectly

PRACC9304: RunMacro May not Work with Large Repeat Count

PRACC9304: SQL Delete Triggers Function Incorrectly

PRACC9304: TrueType Fonts Shift Vertically on HP4 Printer

PRACC9305: Caret Not Painted Correctly In List Box

PRACC9305: GPF Button Caption Text Larger than 2048 Characters

PRACC9305: GPF When Allocating Huge Arrays

PRACC9305: GPF When Erase of a String Array in User Type

PRACC9306: Help Context ID property does not work in subform

PRACC9306: Hidden Subform Maximized If Main Form Is Maximized

PRACC9306: Timeout While Waiting for DDE Response

PRACC9310: Can't Paste Column If Focus Is on One Cell in Query

PRB: "System Error" Sharing Database on LanMan/Workgroups

PRB: 'Circular Reference Caused by Alias' Error Message

PRB: 'Couldn't Change Working Directory

PRB: 'Couldn't Find Object [Object Name]'

PRB: 'Fieldname' Isn't an Index in This Table

PRB: 'Internal Database Error (-5001)' Using the Btrieve NLM

PRB: 'Show All Records' Menu Choice not Available

PRB: 'Table Exclusively Locked' Error Switching to Form View

PRB: Abnormal Action When Debugging Runtime Error

PRB: Access Basic Does Not Support Yes and No Action Arguments

PRB: Access Can Not Find DESKEDIT.EXE

PRB: Access Database Analyzer Error Message

PRB: Alert Appears When it Shouldn't When Running a Macro

PRB: All Data 'Lost' When Doing Save As from Design View

PRB: Allow Editing Set to Unavailable Does Not Work

PRB: Cannot Edit Access Data Using Query with Attached dBASE

PRB: Changed Field Names In Table Are Not Reflected In Query

PRB: Changes in Subform do not Update in Main Form

PRB: Combo Box Displays Only 255 Characters of Memo Field

PRB: Companion Disk install and Out of Disk Space

PRB: Compile Error When Attempting to Use an AccessWizard

PRB: Couldn't Find Object using OpenQueryDef

PRB: Ctrl+C Does Not Copy SQL Statement

PRB: Cursor Position Unchanged in Undo Paste

PRB: DateAdd 'w' Option

PRB: DateDiff "W" Option

PRB: DDE App Name for Access Is Incorrect in Manual

PRB: Empty Row of List Box can be Selected

PRB: Empty Subforms Will Not Be Visible in Print Preview

PRB: Err Msg: Macro '' Not Found

PRB: ErrMsg: Couldn't Open Table MSysAccounts

PRB: ErrMsg: CREATE TABLE Permission Denied in Export to SQL

PRB: Error in Database Analyzer: DTSysQuery already exists

PRB: Error Message: Couldn't Find Input Table or Query

PRB: Error Message: Must Run SETUP /A Before Running SETUP

PRB: Error Occurs in Print Preview Without Driver

PRB: Error Opening Attached Table in Shared MDB

PRB: Export Table to Other Database Type Doesn't Create Index

PRB: Exporting To Fixed Width Text File Left Justifies Numbers

PRB: Extra Unwanted Information Appears in List Box

PRB: File Rename Dialog Still Enabled When No Filename Given

PRB: Form may Lose Focus When Using Shift+F8

PRB: Form Opens Blank Except for Header

PRB: Formatting Yes/No Data Type Example

PRB: GPF Using v1.01 Diamond Viper VESA Local Bus Video Driver

PRB: Graph Object Is Dimmed in Form View

PRB: Importing an Informix Delimited Export File

PRB: Incorrect Btrieve Error Message, [Btrieve ISAM] section

PRB: Incorrect Results Received with DSUM Function

PRB: Internal Database Error (-5207) When Attaching Tables

PRB: Invalid Reference to Field '<Value>' Using SetValue

PRB: Join Is Broken by Value(s) in Fields '[Field Name]'

PRB: Label Is Placed Within Command Button on Forms

PRB: Layout Changes to Subform in Datasheet View Not Saved

PRB: Leading Space in Property Sheet Entry May Cause Problems

PRB: List Box Does Not Scroll when Scroll Box Is Dragged

PRB: Low Number of Share Locks Can Cause Errors

PRB: Macro Condition Evaluates True if Control Is Null

PRB: Macro Condition Example Using COUNT() Is Incorrect

PRB: Macro on Subform Control Executed by Main Form

PRB: Moving Row Down One Grid in Table and Macro Design

PRB: Navigation Button Unavailable in Main/Subform Wizard

PRB: Negative GroupOn Interval Reverses Sort Order

PRB: New OLE Field is Created as Text Box in a New Form

PRB: No Arrows on Scroll Bars if Window Is Larger than Form

PRB: No System Table Permissions After Admin User Deleted

PRB: Not Enough Stack Memory When Opening Form

PRB: Not Part of Aggregate Function or Grouping

PRB: NWIND Order Form Updates Order Amount Field with Zero

PRB: NWIND.MDB Query with Criteria Displays Data in Odd Order

PRB: Objects Cannot Be User-Defined Data Type Elements

PRB: OLE Excel and WinWord Do Not Close when Form Is Closed

PRB: Only One Button Accepts Selection in Yes/No Option Group

PRB: Operation Stops when Editing Attached SQL Tables

PRB: ORDER BYs Must Be Output Columns in DISTINCT Queries

PRB: Page Hdr/Ftr Is Not Under View Menu

PRB: Paradox Character Translation Different in Win 3.0 & 3.1

PRB: Paste Link into Excel Displays First Field Name Only

PRB: Print Preview Displays Only First Line of Toggle Button

PRB: Properties Don't Reset Between Crosstab and Make Table

PRB: Raised and Sunken Check Box and Option Button Controls

PRB: Random Characters in Text Box Bound to OLE Object Field

PRB: Report Prints with Blank Page Between Every Printed Page

PRB: Restore Macro Action Does Not Appear to Work

PRB: Rounding Errors Importing/Exporting dBASE IV Numerics

PRB: RunCode Macro May Not Evaluate Conditions

PRB: Scroll Bars Displayed for a Subform in Datasheet View

PRB: SCSI Drives can Generate "corrupt" Error Message

PRB: Seek Method is Faster Than Find Method

PRB: SendKeys Macro Does Not Run

PRB: SetValue Doesn't Trigger Form Events

PRB: Stacker 3.0 CHECK.EXE Reports Database Files as Corrupt

PRB: Strange Characters Appear in Imported DBASE IV Memo Data

PRB: Strange Characters Appear When Pasting in the Query Grid

PRB: Switching Modes Disables Undo

PRB: System Defaults Not Showing in Imp/Exp Setup

PRB: Text Label Truncated Printing Form on Epson 9-Pin Printer

PRB: Toolbar Disappears When Printing a Document

PRB: TransferSpreadsheet Action Doesn't Add File Extension

PRB: Two Accelerator Keys in Custom Menu Only Show First Key

PRB: Unable to Add All Fields in Graph FormWizard

PRB: Unable to Use Hexadecimal or Octal Values in Properties

PRB: Unexpected Error from External Database Driver [20]

PRB: Unwanted Record Separator at the Bottom of a Subform

PRB: ValidationRule Parses Function Name w/o Parens to String

PRB: Weekday Disappears While Editing Long Date Format Field

PRB: Zoom Box Accessible When Multiple Fields Are Selected


INF: Using the .Parent Property of a Subform

 Article Number: Q10002

 CREATED: 14-JUN-1993

 MODIFIED: 14-JUN-1993

Summary:

This article explains how to use the Parent property of a subform to

obtain the name of its parent form.

More Information:

When you refer to the Parent property of a subform, you need to use

Form.Parent if using the full syntax.

The following syntax will work in macro actions called from a subform:

   Forms![Main Form name]![Subform ControlName].Form.Parent.Formname

   Form.Parent.Formname

   Parent.Formname

The following is incorrect syntax and gives a syntax error:

   Forms!Orders![Orders Subform].Parent.Formname

The following is incorrect and gives the name of the subform:

   Formname

Steps to Reproduce Behavior

--------------------------

1. Open the sample database Northwind Traders (NWIND.MDB) database.

2. Create and save the following macro:

   Macro: Get Parent Name

   ------------------------

   Action: MsgBox

      Message: =Forms!Orders![Orders Subform].Form.Parent.Formname

      Title: Parent Form Name

2. Open the Orders Subform in Design view. Add a macro to the Product

   ID field:

   Object: Text box

   -----------------

   ControlName: Product ID

      OnDblClick: Get Parent Name

3. Save and close Orders Subform.

5. Open the Orders form. Double-click the Product ID in the subform.

   A message box entitled 'Parent Form Name' will display 'Orders',

the

   name of the main (or parent) form.

6. Close the Orders form. Open the Orders Subform in Design view, and

   remove the macro that we added in step #2.

References


PRACC9304: RunMacro May not Work with Large Repeat Count

 Article Number: Q10012

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

SYMPTOMS

Microsoft Access may use an unusual Repeat Count when attempting to

execute a RunMacro action with a Repeat Count greater than 32767, or

return the following error messgae:

   RepeatCount argument in RunMacro action can't be less than 0

CAUSE

Microsoft Access does not explicitly check for values greater than

32767, and such values may "wrap-around" to a negative number or an

unexpected positive number. If the value is negative, Microsoft

Access will produce the above error message. If positive, Microsoft

Access will run the macro using the Repeat Count that it evaluated.

RESOLUTION

Restrict your Repeat Count to fall between 0 and 32767. If you

really need to run a macro more than 32767 times, nest your macros.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. Microsoft is researching this problem and will post

new information here as it becomes available.

MORE INFORMATION

================

For Repeat Counts between 1 and 32767, Microsoft Access returns the

expected results.

For Repeat Counts between 32767 and 65535, Microsoft Access returns

the above error message.

For Repeat Counts above 65535, Microsoft Access will either return (1)

the same results as for values between 0 and 32767, (2) the above

error message, or (3) unexpected results.

If you need to run a macro more than 32767 times, nest your macro. For

example, if you need to run a macro 60,000 times, first create a macro

(Macro1) that has a RunMacro command with a Repeat Count of 30,000.

Then create another macro (Macro2) that has a RunMacro command with a

Repeat Count of 2. Finally, have Macro2 run Macro1.

The following example will allow you to test different Repeat Counts,

and view the results.

Steps to Reproduce Behavior:

---------------------------

1. Open a blank, unbound form. Save this form as Test Form.

2. Create two macros, as follows:

      Macro Name         Action

      =========================

      Increment by One   SetValue

      RepeatCount Test Actions

      ------------------------

      SetValue

         Item: [field0]

         Expression: [field0]+1

      Macro Name         Action

      =========================

      RepeatCount Test   RunMacro

                         MsgBox

      RepeatCount Test Actions

      ------------------------

      RunMacro

         Macro Name: Increment by One

         Repeat Count: 32767

      MsgBox

         Message: Done

3. Add three controls to Test Form, as follows:

      Object: Text Box

      -----------------

      ControlName: Field0

         ControlSource: <leave this property blank>

      Object: Command Button

      ----------------------

      ControlName: Increment

         Caption: Increment

         OnPush: Increment by One

      Object: Command Button

      ----------------------

      ControlName: Repeat

         Caption: Repeat

         OnPush: RepeatCount Test

4. Open Test Form in Form view. Enter the number 1 in Field0, then

   press the Increment button. Notice that the number in Field0

increases

   by one each time that you press the Increment button.

5. Enter the number 1 in Field0, then press the Repeat button. When

   the RepeatCount Test macro is finished running, you will get a

message

   box that says 'Done'. Notice that the value in Field0 is 32767.

6. To test different Repeat Count values, open the RepeatCount Test

   macro in Design view, and change the Repeat Count action argurment.

   Then repeat step #5 above.

References


PRACC9305: Caret Not Painted Correctly In List Box

 Article Number: Q10012

 CREATED: 16-JUN-1993

 MODIFIED: 18-JUN-1993

SYMPTOMS

The gray-bordered box that indicates "no selection," known as the

"caret," is missing from a list box when you scroll a careted item off

the top of the list box, then you minimize and maximize the form and

scroll the item back down again.

CAUSE

This is caused by a painting problem with list box controls on forms.

This only occurs when you minimize then restore a form whose current

control is a list box that has no selection and the top row is

scrolled out of view.

RESOLUTION

Any event that causes the form to repaint, such as pressing the F9 key

or selecting an item from the list box, causes the caret to reappear.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. Microsoft is researching this problem and will

post new information here in the Microsoft Knowledge Base as it

becomes available.

MORE INFORMATION

================

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access and load the Northwind Traders sample

   database (NWIND.MDB).

2. Create a new, blank form.

3. Place a list box control on the form and set its RowSource property

   to "Employee List".

4. Switch to Form view. Notice that the first item,

   "Buchanan, B.L.", has a light gray box (called the "caret") around

   it.

5. Scroll down the names in the list box until "Buchanan, B.L."

   scrolls off the top of the list box. (You should only need to click

the scroll bar once.)

6. Minimize the form, then maximize it.

7. Scroll the names in the list box back up until "Buchanan, B.L." is

   visible again. Notice that the caret is not visible anywhere.

8. To "fix" this, force the form to repaint by pressing the F9 key

   once. Notice the caret reappears around "Buchanan, B.L.".

References


PRACC9304: Importing Numeric Column Names from Spreadsheet

 Article Number: Q10012

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

Microsoft Access replaces the numeric column names from your

spreadsheet with other numbers.

RESOLUTION

Before import, format the column names as text by typing single

quote in front of the number. Or, after import, change the field names

in the table's design view.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. Microsoft is researching this problem and will post

new information here as it becomes available.

MORE INFORMATION

================

Numeric column names are ignored when importing spreadsheets,

regardless of the spreadsheet format. Microsoft Access replaces any

numeric column names with the column numbers in the resultant table.

Steps to Reproduce Problem

--------------------------

1. Create a new spreadsheet in Microsoft Excel, with the following

   information in cells A1 through C2:

      A1: 25

      B1: 1

      C1: 2

      A2: 123456789

      B2: dog

      C2: cat

2. Save the spreadsheet as IMPTEST.XLS, and close Microsoft Excel.

3. Open a database in Microsoft Access.

4. From the File menu, choose Import.

5. In the Import dialog window, select Microsoft Excel as the data

   source. Choose OK.

6. In the Select File dialog window, choose IMPTEST.XLS. Then press

   the Import button.

7. In the Import Spreadsheet Option dialog window, check the First Row

   Contains Field Names box. Choose OK.

8. Choose OK from the Import Result window, then Close the Select File

   window.

Open the IMPTEST table. Microsoft Access replaced the numeric column

names with the actual column numbers from the spreadsheet.

References


PRB: Allow Editing Set to Unavailable Does Not Work

 Article Number: Q10012

 CREATED: 16-JUN-1993

 MODIFIED: 18-JUN-1993

Summary:

SYMPTOMS

You can still edit, add, and delete records from a form, even

though you set the form's AllowEditing property to Unavailable.

RESOLUTION

This behavior is by design.

MORE INFORMATION

================

The AllowEditing property on a form determines whether the AllowEditing

command on the Records menu is enabled when you open a form from the

Database window. If enabled, you can override the form's Default

Editing mode from Form view.

It is a form's DefaultEditing property that determines whether a form

opens to allow editing, only data entry, or is read-only.

To disable editing, set the DefaultEditing property to Read Only, and

the AllowEditing property to Unavailable.

For more information search for "allow editing", then "AllowEditing,

DefaultEditing Properties" using the Help menu.

References


PRB: Negative GroupOn Interval Reverses Sort Order

 Article Number: Q10013

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

When a non-text field in a Microsoft Access report is selected

to sort ascending and group on an interval, the sort order is

actually descending when previewed if the Interval is set to -1.

RESOLUTION

This is by design, as the report is actually sorting on the negative

result of the expression or interval.

MORE INFORMATION

================

Steps to Reproduce Behavior

---------------------------

1. Create a new report in the sample database Northwind Traders

   (NWIND.MDB), and base it on a table or query with a numeric field.

   For this example select the Order Details table.

2. Open the Sorting and Grouping window. Select a numeric field, like

   Order ID, in the first row of the Field/Expression column.

      Sorting and Grouping

      ---------------------

      Field/Expression:     Sort Order:

      Order ID              Ascending

      Group Properties:

      Group Header: Yes

      Group On: Interval

      Group Interval: -1

3. Locate the Order ID field in a text box on the Order ID Header

4. Size the Detail section Height property to 0 in.

5. Preview the Report. Results - the sort order is descending.

References


INF: How to Create Parameter IN() Statement

 Article Number: Q10013

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article describes how to create a Query using the IN() operator

with multiple values. The method described in this article will

implement a query that calls a function which will be passed two

parameters. The first parameter will be the name of a field that

exists in the table the query is based on. The second parameter will

cause the user to be prompted to enter a list of values. The function

will process user's entries as the list of multiple parameters for the

IN() operator.

This article assumes that you are familiar with Access Basic and how

to create and use Access Basic procedures.

More Information:

The following example is based on the sample database Northwind

Traders (NWIND.MDB).

1. Create a new module and enter the following two functions:

'************************************************************

'Declarations section of the module.

'************************************************************

Option Explicit

'============================================================

' The following function defines the delimiter character

'============================================================

Function GetToken (stLn, stDelim)

   Dim iDelim as Integer, stToken as String

   iDelim = InStr(1, stLn, stDelim)

   If (iDelim <> 0) Then

      stToken = LTrim$(RTrim$(Mid$(stLn, 1, iDelim - 1)))

      stLn = Mid$(stLn, iDelim + 1)

   Else

      stToken = LTrim$(RTrim$(Mid$(stLn, 1)))

      stLn = ""

   End If

   GetToken = stToken

End Function

'============================================================

' The following function is the heart of this article. When

' the query runs, this parameter will cause the query parameter

' dialog box to display so you can enter a list of values.

' The values you enter will be interpreted as the list of values

' you would enter within the parentheses of the IN() operator.

'============================================================

Function InParam (Fld, Param)

   Dim stToken as String

   If IsNull(Fld) Then Fld = ""

   Do While (Len(Param) > 0)

     stToken = GetToken(Param, ",")

     If stToken = LTrim$(RTrim$(Fld)) Then

     InParam = -1

     Exit Function

     Else

     InParam = 0

     End If

   Loop

End Function

2. Close and save the Module.

3. Create a new query.

4. Add the Customers table and close the Add Table window.

5. Drag any fields you want down into the QBE grid.

6. Add another column like the following example:

      Query: QueryTest

      ------------------------

      FieldName: InParam([Customer ID],[Enter A List Of IDS Seperated

                  By Commas And No Spaces])

      Show: False

      Criteria: True

NOTE: The value InParam(...) shown for the FieldName should be entered

as one statement on a single line. These functions can be applied to

integer

fields as well as text fields.

7. From the Query menu select the Parameters... option.

8. Type the following line for the Parameter:

    Enter A List Of IDS Seperated By Commas And No Spaces

9. For the DataType choose Text.

10. Select the OK button.

11. Run the query.

12. You will be prompted with a dialog box to enter a list of

    parameters. The dialog box will state:

      Enter A List Of IDS Seperated By Commas And No Spaces.

    Type in the following values without spaces:

      BLUEL,CACTP,DOLLC

13. You will receive the records that meet this criteria.

References


INF: Four Ways to Goto a Record from a Combo Box Selection

 Article Number: Q10013

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

There are basically four different methods to go to a specific

record(s)

based on a Combo box selection:

1. In the AfterUpdate property of the Combo box, call a macro

   using the FindRecord action.

2. In the AfterUpdate property of the Combo box, call a macro

   using the ApplyFilter action.

3. Use a Form/Subform, with the Combo box in the main form,

   and the data in the subform, bound by the LinkMasterFields

   and LinkChildFields properties.

4. Base the form on a query joining two tables and bind the

   combo box to the field that controls the join. (Based on Row Fix-Up

or

   Dynamic Lookup functionality - search Help release 1.1 or the

   Knowledgebase for more information on these.)

More Information:

The four methods are outlined in the following sections. They are all

based

on the NWIND.MDB sample database.

Method 1

========

1. Create a form named ComboTest based on the Products table. You must

   include at least the Product ID field. (Additional fields located

help to

   illustrate that you have changed records based on the value

selected in

   the Combo box.) Set the Form property DefaultView to Single Form.

      Object: Text Box

      ----------------

      ControlName: Product ID

      ControlSource: Product ID

      Visible: Yes

2. Create an unbound Combo box called Combo1 with the following

properties.

   It can be located anywhere on the form, but preferably in the form

header

   or footer.

      Object: Combo Box

      -----------------

      ControlName: Combo1

      ControlSource: <leave blank>

      RowSourceType: Table/Query

      RowSource: Products

      ColumnCount: 4

      ColumnWidths: 0 in;0 in;0 in;2 in

      BoundColumn: 1

      After Update: Locate Product

3. Create a new macro named Locate Product with two actions:

      Macro: Locate Product

      ---------------------

      GoToControl

         ControlName: [Product ID]

      FindRecord

         Find What: =Combo1

         Find First: Yes

   Now browse the data in Form view, when you choose a product name

from

   the Combo box, you are moved to the record selected and the

appropriate

   product id value is displayed.

   Another example of this method is illustrated in the Suppliers form

in

   NWIND.MDB. The form calls the 'Find Company' macro based on the

value

   of the 'Company Pick List' Combo box.

   References: "Microsoft Access User's Guide," version 1.0, chapter

22,

   "Finding a Record".

Method 2

========

Repeat steps 1 and 2 from Method #1.

3. Create a macro named Locate Product with one action:

      Macro: Locate Product

      --------------------------------

      ApplyFilter

         Where:[Product ID]=Forms![ComboTest]![Combo1]

   The Product ID field is the Bound Field for the Combo box, while

the Combo

   box is displaying the Product Name information, it is bound or

internally

   holding the Product ID's value. For more information on how to

reference

   controls on a form see the Help topic "Identifiers in Expressions".

   This method is similar to the Suppliers form in NWIND.MDB which

uses the

   buttons to filter records from A to Z. See the Alpha Apply Filter

Buttons

   macro also.

   References: Microsoft Access User's Guide, Chapter 22, "Filtering

   records".

Method 3

========

1. Create an unbound form. Add a Combo box with the following

properties:

      Object: Combo box

      ----------------

      ControlName: Combo1

      ControlSource: <leave blank>

      RowSourceType: Table/Query

      RowSource: Products

      ColumnCount: 4

      ColumnWidths: 0 in;0 in;0 in;2 in

      BoundColumn: 1

2. Create 2nd form based on the Products table that will be used as a

subform.

   Include at least the Product ID field. (Additional fields located

help to

   illustrate that you have changed records based on the value

selected in

   the Combo box.) Set the Form property DefaultView to Single Form.

      Object: Text Box

      ----------------

      ControlName: Product ID

      ControlSource: Product ID

      Visible: Yes

   Save the subform, and create a subform control on the first form by

   dragging the subform from the database container to the detail

section

   of the first form created above.

   Set the subform control properties in the first form as follows:

      Object: Subform

      ---------------

      LinkChildFields: [Product ID]

      LinkMasterFields: Combo1

   By changing the value in Combo1, Access will make sure that the

records in

   the subform match the combo box.

   The Orders form in NWIND.MDB illustrates this method. The Order

Details

   subform is related by the LinkMasterFields and LinkChildFields

properties.

   "Microsoft Access User's Guide," version 1.0, chapter 10,

   "Linking a Main Form and a Sub Form".

Method 4

========

1. Create a table named 'Prd' with a single field Product ID, (Number

   Datatype and Integer Field Size). (No primary Key is needed).

   Then create  a single blank record.

2. Create a query named 'Prd Query' based on a join between the

   Product ID fields of the Prd and Products tables.

3. Include as output:

      Query: Prd Query

      ----------------

      Field: Product ID

         TableName: Prd

         Show: X

      Field: <any other fields you are interested in>

         TableName: Products

4. Create a form based on Prd Query. Add all fields. Note: you must

add at

   least the Product ID field.

5. Delete the text box control for Product ID and re-create as a Combo

box:

      Object: Combo box

      ----------------

      ControlName: Product ID

      ControlSource: Product ID

      RowSourceType: Table/Query

      RowSource: Products

      ColumnCount: 4

      ColumnWidths: 0 in;0 in ;0 in;2 in

      BoundColumn: 1

   The Orders form in NWIND.MDB illustrates this method. It

   allows the customer name and address to be selected based on

   the Customer ID Combo box. By changing the Customer ID in

   the Orders table, the related Customers record is changed,

   and its fields are updated on the form. See also,the

   Products and Suppliers form for another example.

   References: "Microsoft Access User's Guide," version 1.0, chapter

10,

   Creating a Many-to-One Form".

Comparison of features/drawbacks:

   Method:                         1   2   3   4

   Requires no code/macros                 x   x

   Saves on subforms               x   x       x

   Can scroll to other records     x       x   x

   Doesn't require a query         x   x   x

   Can edit records                x   x   x

Note: These methods can also be applied to text boxes.

References


PRB: Abnormal Action When Debugging Runtime Error

 Article Number: Q10013

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

Abnormal things can happen when debugging a runtime error in an

Access Basic function. A form will not be accessible if it calls a

function that is halted due to a runtime error.

CAUSE

When program execution is halted like this, the handle on the form

is still being used by the system. Even though the program has stopped

running the form handle has not been released.

RESOLUTION

To release the form handle after the program has been halted,

select Reinitialize from the Module's Run menu.

MORE INFORMATION

================

Steps to Reproduce Behavior

--------------------------

1. Create and save a form with the following command button on it:

      Object: Command Button

      ---------------------------

      ControlName: Run Code

      Caption: Run Code

      OnPush: =Test()

2. In a new module create and save the following function called

   Test():

      Function Test()

         Dim x as String

         x = left("abc", -1)

     End Function

3. Open the form that was created in step 1.

4. Push the 'Run Code' button on the form.

   When the button is pushed it calls the function Test. Program

   execution will be halted and an error will display on the screen

   (because you can't specify a negative number in the left function).

   The error message that you will see is:

            Illegal function call

5. Select the OK button to respond to the error message.

6. Minimize the module in which the function is being displayed. (At

   this point, the form should be visible on the screen.)

7. Try to push the button on the form again, or, try to move the form.

   Although you can see the form, it does not seem to be an object

that

   can be made active. The form handle is not available.

8. To release the form handle after the program has been halted,

   select Reinitialize from the Module's Run menu.

References:

"Microsoft Access Introduction to Programming," version 1.0, Chapter

4, "Debugging Your Access Basic Code"

References


PRB: SetValue Doesn't Trigger Form Events

 Article Number: Q10013

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

SYMPTOMS

The macro or function attached to the BeforeUpdate or AfterUpdate

event does not execute.

CAUSE

When you use a macro or Access Basic code to modify the value of a

form's field, it will not trigger any BeforeUpdate or AfterUpdate

events attached to that control.

RESOLUTION

This behavior is by design.

MORE INFORMATION

================

If you modify the value of a form's field or control via a macro

or Access Basic code, you must manually trigger any desired

BeforeUpdate or AfterUpdate events from that macro or Access Basic

code (use the RunMacro or RunCode macro command).

Steps to Reproduce Behavior

--------------------------

1. Open the sample database Northwind Traders (NWIND.MDB).

2. Create and save the following macro:

   Macro Name        Actions

   ------------------------

   Test1             OpenForm

                     SetValue

   Test1 Actions

   ----------------------

   OpenForm

      Form Name: Employees

   SetValue

      Item: Forms![Employees]![Last Name]

      Expression: Null

3. Open the Employees form in design view and add the pre-existing

   Required Entry macro to the Last Name field:

   Object: Text Box

   ----------------

   ControlName: Last Name

      BeforeUpdate: Required Entry

4. Close the Employees form. From the Database window, highlight the

   Test1 macro.

5. Run the Test1 macro. Note that it successfully blanked out the

   employee's last name (you can press Escape twice to get it back).

   The macro attached to the Last Name control's BeforeUpdate property

   does not execute.

6. Try to remove the employee's last name manually. The Required Entry

   macro will be triggered, displaying the following message:

      You must enter a last name

7. Do not save changes when closing the Employees form. This will

   remove the Required Entry macro that we added to the Last Name

   control in step #3 above.

References


INF: Searching for Characters/Strings in Records

 Article Number: Q10013

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article shows a method for searching for and identifying records

containing a particular character or string. In the example below, we

will

search for an asterisk character.

More Information:

Say, for example, you have a table of names. Some of the names have an

asterisk character somewhere in them, and you would like to get a list

of all the names containing asterisks.

The solution is to use the InStr() function. The InStr() function

returns

the position of the first occurrence of a string within another

string. The example below uses the InStr() function to determine

whether

or not the asterisk character exists in the names in the table. If it

does, it becomes a member of the query's dynaset. The example below

illustrates how to do this:

1. Start Microsoft Access, and create a new table called Nametest.

2. Create a text field called Names and enter the following data into

   the table:

      Names

      ------

      *Pat

      Pat*

      Tom

      Ri*ck

      Harry

3. Create a new query based on the Nametest table.

4. Drag the Names field from the field list box onto the query grid.

5. In the Field row of the query grid, next to the Names column, type

   in the expression:

      NewField: InStr(1,[Name],"*")

6. In the Criteria row of the same column, enter:

      >0

7. Uncheck the Show check box of that column.

8. Run the query.

You should get the results:

   *Pat

   Pat*

   Ri*ck

This method can be used to obtain a dynaset containing any sequence of

characters -- just change the asterisk in the expression above to

match the string or character you want to search for.

References:

"Microsoft Access Language Reference," version 1.0, page 259.

References


INF: Function to Calculate Age

 Article Number: Q10013

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article explains how to create a function to calculate an age

based on a given date.

More Information:

Enter the following code into a Module.

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

'==========================================================

' General Declaration

'==========================================================

Option Explicit

'*************************************************************

' FUNCTION NAME: Age

'

' PURPOSE:

'   Calculates the age in years from the supplied date to today

'

' INPUT PARAMETERS:

'   StartDate: The beginning date.. could be a birthdate.

'

' RETURN

'   The age in years.

'*************************************************************

Function Age (ByVal StartDate As String)

    Dim tAge As Double

    tAge = (DateDiff("m", StartDate, Now))

    If (DatePart("d", StartDate) > DatePart("d", Now)) Then

        tAge = tAge - 1

    End If

    If tAge < 0 Then

        tAge = tAge + 1

    End If

    Age = Fix(tAge / 12)

End Function

'*************************************************************

' FUNCTION NAME: AgeMonths

'

' PURPOSE:

'   Complements the Age function by calculating the number of months

'   that have expired since the last month given by the supplied date.

'   If the supplied date is a birthday, it returns the number of

'   months since the last birthday.

'

' INPUT PARAMETERS:

'   StartDate: The beginning date.. could be a birthdate.

'

' RETURN

'   Months passed from the last birthdate.

'*************************************************************

Function AgeMonths(ByVal StartDate As String)

    Dim tAge As Double

    tAge = (DateDiff("m", StartDate, Now))

    If (DatePart("d", StartDate) > DatePart("d", Now)) Then

        tAge = tAge - 1

    End If

    If tAge < 0 Then

        tAge = tAge + 1

    End If

    AgeMonths = tAge Mod 12

End Function

Testing the Age functions using the Access Immediate window

-----------------------------------------------------------

To test these functions, open or create a new module and choose

Immediate

Window from the View menu.

Suppose your friend's birthday was on November 15th 1967 and today was

the

3rd of June, 1993. Type the following in the Immediate windows and

press

ENTER:

   ? Age("11/15/67")

Microsoft Access will respond with 25.

Now type the following and press ENTER:

   ? AgeMonths("11/15/67")

Microsoft Access will respond with 6 indicating that 6 months have

passed

since this person's birtday. This person is 25 years, 6 months old.

Example: Using the Age functions on a form

------------------------------------------

The following example calculates how old orders are contained in the

sample Northwind Traders (NWIND.MDB) database supplied with Microsoft

Access.

1. Enter the Age and AgeMonth functions in a new module in the

   NWIND.MDB.

2. Open the Orders form in Design view, and add an unbound text box

   to the form.

3. Enter the following in the ControlSource property of the unbound

   text box:

    =Age([Order Date]) & " ys " & AgeMonths([Order Date]) & " mo"

4. Switch to Form view. The age of the order will be shown in the

   new control.

References


INF: Cascading  Updates

 Article Number: Q10013

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article demonstrates how to create a query that will update the

many side of a one-to-many relationship automatically when you change

the value of the one side.

NOTE: This can be done under the condition that referential integrity

does not exist in the relationship.

More Information:

In the sample database Northwind Traders (NWIND.MDB), there is a one-

to-many relationship between the Categories and Products tables. The

following steps show how to create a query that automatically updates

information in the Products table (many side) whenever you change a

value in the Categories table (one side).

1. Open the sample database Northwind Traders (NWIND.MDB)

2. Make a copy of the Categories table and name it Categories Test.

3. Make a copy of the Products table and name it Products Test.

4. From the Edit menu, choose Relationships. Establish a one-to-many

   relationship between Categories Test and Products Test on the

   Category ID field. Do not enforce referential integrity.

5. Create a new query based on the Categories Test and the Products

   Test tables. From the View menu, choose Table Names.

6. Drag the Category ID field from both the Categories Test and

   Products Test tables to the QBE grid.

7. From the Query menu, choose Update. Then design your query as

   follows:

      Query: UpdateManySide

      ----------------------

      FieldName: Category ID

         Table: Categories Test

         Update To: [Enter New Value]

         Criteria: [Enter Old Value]

      FieldName: Category ID

         Table: Products Test

         Update To: [Enter New Value]

         Criteria: [Enter Old Value]

8. To test this query, we will update the Category ID from "SEAF" to

   "FISH". Run this query that we just created by choosing Run from

   the Query menu.

9. When Microsoft Access prompts you to Enter New Value, enter FISH

   and choose OK. When Microsoft Access prompts you to Enter Old

   Value, enter SEAF.

10. Microsoft Access will tell you how many records will be updated.

    Choose OK, then save this query.

Open the Categories Test and Products Test tables. You will notice

that SEAF has been changes to FISH on both the one side (Categories

Test) and the many side (Products Test) of the one-to-many

relationship.

References


PRB: New OLE Field is Created as Text Box in a New Form

 Article Number: Q10013

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

When you drag an OLE field from a form's Field List, Microsoft

Access creates a text box, not a Bound Object Frame. When you switch

to Form view you can type text into the text box. However, if you open

the table you see 'Invalid Object' in the OLE field.

CAUSE

While you were designing this form you opened the table in design

view and added the OLE field to the table. The form has not been saved

and reopened since adding this new OLE field to the table.

RESOLUTION

Save the form before dragging the new OLE field onto the form.

After the form has been saved and reopened an OLE field that is

dragged from the Field List will correctly generate a Bound Object

Frame.

MORE INFORMATION

================

A new OLE field, added to a table that the form is based on, will not

be properly recognized if the form has not been saved and reopened. In

order for Microsoft Access to properly recognize this field's data

type you must save and reopen the form.

Steps to Reproduce Behavior

--------------------------

1. Create and save the following table named Table1:

      Table: Table1

      -------------

      FieldName: Stuff

         DataType: Text

2. Create a new form based on Table1 and DO NOT save it. Place the

   field named Stuff on the form.

      Object: Text box

      ----------------

      ControlName: Stuff

         ControlSource: Stuff

3. With the form still open in design view, open Table1 in design view

   and add the following field. Save and close Table1.

      Table: Table1

      -------------

      FieldName: Photo

         DataType: OLE

4. Go back to your form and show the Field List by choosing Field List

   from the View menu. Drag the new OLE field, Photo, from the Field

List

   onto the form. Microsoft Access creates a text box is instead of a

   Bound Object Frame.

References


INF: Database Normalization Basics

 Article Number: Q10013

 CREATED: 16-JUN-1993

 MODIFIED: 18-JUN-1993

Summary:

This article explains database normalization terminology for

beginners. A basic understanding of this terminology is helpful when

discussing the design of a relational database.

More Information:

Description of Normalization

----------------------------

Normalization is the process of organizing data in a database. This

includes creating tables and establishing relationships between those

tables according to rules designed both to protect the data and to

make the database more flexible by eliminating two factors: redundancy and

inconsistent dependency.

Redundant data wastes disk space and creates a maintenance problem. If

data exists that more than one place must be changed, the data

must be changed in exactly the same way in all locations. A customer

address change is much easier to implement if that data is stored only

in the Customers table and nowhere else in the database.

What is an "inconsistent dependency"? While it is intuitive for a user

to look in the Customers table for the address of a particular

customer, it might not make sense to look there for the salary of the

employee who calls on that customer. The employee's salary is related

to, or dependent on, the employee and so should be moved to the

Employees table. Inconsistent dependencies can make data difficult to

access; the path to find the data may be missing or broken.

There are a few rules for database normalization. Each rule is called

a "normal form." If the first rule is observed, the database is said

to be in "first normal form." If the first three rules are observed,

the database is considered to be in "third normal form." Although

other levels of normalization are possible, third normal form is

considered the highest level necessary for most applications.

As with many formal rules or specifications, the real world does not

always allow perfect compliance. In general, normalization requires

additional tables and some users prefer not to deal with the extra

overhead. If you decide to violate one of the first three

normalization rules, make sure that your application anticipates any

problems that could occur, such as redundant data and inconsistent

dependencies.

  NOTE: The following descriptions are followed by examples.

First Normal Form

-----------------

 - Eliminate repeating groups in individual tables.

 - Create a separate table for each set of related data.

 - Identify each set of related data with a primary key.

Don't use multiple fields in a single table record to store similar

data. For example, to track an inventory item that may come from two

possible sources, an inventory record may contain fields for Vendor

Code 1 and Vendor Code 2.

But what happens when you add a third vendor? Adding a field is not

the answer; it requires program and table modification and does not

smoothly accommodate a varying number of vendors. Instead, place all

vendor information in a separate table called Vendors, then match

inventory to vendors with an item number key, or vendors to inventory

with a vendor code key.

Second Normal Form

------------------

 - Create separate tables for sets of values that apply to multiple

   records.

 - Relate these tables with a foreign key.

Records should not depend on anything other than a table's primary key

(or a compound key, if necessary). For example, consider a customer's

address in an accounting system. The address is needed by the

Customers table, but also by the Orders table, Shipping table,

Invoices table, Accounts Receivable table, and Collections table.

Instead of storing the customer's address as a separate entry in each

of these tables, store it in  one place, either in the Customers table

or in a separate Addresses table.

Third Normal Form

-----------------

 - Eliminate fields that do not depend on the key.

Values in a record that are not truly a  part of that record's key do

not belong in the table. In general, any time the contents of a group

of fields might apply to more than a single record in the table,

consider placing those fields in a separate table.

For example, in an Employee Recruitment table, a candidate's

university name and address might be included. But you need a complete

list of universities for group mailings. If university information is

stored in the Candidates table, there is nowhere to list universities

that with no current candidates. Create a separate Universities table

and link it to the Candidates table with a university code key.

  EXCEPTION: Adhering to the third normal form, while theoretically

  desirable, is not always practical. If you have a Customers table

  and you want to eliminate all possible interfield dependencies, you

  would have to create separate tables for cities, ZIP codes, sales

  representatives, customer classes, and any other factor that might

  be duplicated in multiple records. In theory, normalization is worth

  doing; however, many small tables may degrade performance or exceed

  open file and memory capacities.

It might be more feasible to adhere to the third normal form only for

data that changes frequently. If some dependent fields remain, design

the application to require the user to verify all related fields when

any one is changed.

Other Normalization Forms

-------------------------

Boyce Codd Normal Form (BCNF), fourth normal form, and fifth normal

form exist, but are rarely considered in practical design.

Disregarding these rules may result in less than perfect database

design, but should not affect functionality (see pages 223-225 of the

Foxpro2 a Developer's Guide & Using Access for Windows pages 799-800

for more information).

***********************************

*  Examples of Normalized Tables  *

***********************************

Normalization Examples:

  (from Foxpro2 a Developer's Guide by Jeff Winchell et.al.)

Unnormalized table:

    Student#   Advisor   Adv-Room  Class1   Class2   Class3

    -------------------------------------------------------

    1022       Jones      412      101-07   211-02   214-01

1. First Normal Form:  NO REPEATING GROUPS

   Tables should have only 2 dimensions so when 1 Student

   has several Classes these 'several Classes' should

   be on a separate table. Indications of trouble are the

   Class1, Class2, & Class3 fields on the above record.

   Spreadsheets often use this 3rd dimension but tables

   should not. Another way to look at it is when you have

   a one to many relation don't include the many in the

   same table with the one.

   Instead you should have another table that is in First

   Normal Form by eliminating the repeating group (Class#).

     Student#   Advisor   Adv-Room    Class#

     ---------------------------------------

     1022      Jones      412       101-07

     1022      Jones      412       143-01

     1022      Jones      412       159-02

     4123      Smith      216       201-01

     4123      Smith      216       211-02

     4123      Smith      216       214-01

2. Second Normal Form:  ELIMINATE REDUNDANT DATA

   Notice in the above table the multiple Class# values

   for each Student# value. Class# is not functionally

   dependent on the Student#(Primary key) so this relation

   is not in second normal form.

   For Second Normal Form we need the following two tables:

    Students:   Student#    Advisor   Adv-Room

                ------------------------------

                1022        Jones       412

                4123        Smith       216

    Registration:   Student#    Class#

                    ------------------

                    1022        101-07

                    1022        143-01

                    1022        159-02

                    4123        201-01

                    4123        211-02

                    4123        214-01

3. Third Normal Form: ELIMINATE DATA NOT DEPENDENT ON KEY

   In the last example, Adv-Room (the advisor's office

   number) is functionally dependent of the ADVISOR

   attribute. The solution is to move the attribute out

   of the student relation to the faculty table (below).

    Students:   Student#    Advisor

                -------------------

                1022        Jones

                4123        Smith

    Faculty:    Name    Room    Dept

                --------------------

                Jones   412     42

                Smith   216     42

References:

"Microsoft Access User's Guide," version 1.0, pages 18-19.

References


PRACC9210: Reports Unusable Without Default Windows Printer

 Article Number: Q10014

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

A report is unusable if created with the Microsoft Access

ReportWizard on a system without a default Windows printer defined.

Once a default Windows printer is defined, the report can be

printed.

RESOLUTION

Be sure that a default Windows printer is defined in your WIN.INI

file before creating reports with the ReportWizard. For example:

   [windows]

   device=QMS-PS 810,pscript,LPT1:

If you don't have a default printer defined, then select or install

one, following the instructions in the "Microsoft Windows User's

Guide" or in Windows Help.

Once a default Windows printer is defined, the report works as

expected, with no error messages.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. We are researching this problem and will post

new

information here as it becomes available.

MORE INFORMATION

================

Steps to Reproduce the Problem:

------------------------------

1. Temporarily disable the loading of your default Windows printer in

   your WIN.INI file by placing a ";" (comment) before the "device=".

   (See above.)

2. Start Microsoft Access.

3. Open the sample Northwind Traders(NWIND.MDB) database.

4. Select a table (such as Categories.)

5. Create a report based on that table using the Microsoft Access

   ReportWizard. (Don't create a blank report.)

   Results: You get 2 default printer alert windows stating, "There is

no

   default printer. Select or install one using Windows control

panel."

   This alert comes up whenever you attempt to preview, edit, or print

   the report, making the report unusable.

References


INF: How to Find the Difference Between 2 Time Values

 Article Number: Q10014

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article describes how to use TimeValue to find the difference

between

two times within a 24 hour period using values with a data type of

Date/Time.

More Information:

This article uses a form with two text boxes with the following

properties:

   Object: Text Box

   ----------------

   ControlName: Start_Time

   Object: Text Box

   ----------------

   ControlName: End_Time

To calculate the difference between these two times, create a third

text

box with the following properties:

   Object: Text Box

   ----------------

   ControlName: Time_Difference

   ControlSource: =Format(TimeValue([End_Time])_

                   -TimeValue([Start_Time]),"Short Time")

Note: The above ControlSource should be on one line and the "_"

character

should be removed

The format function is used to format the time difference. In this

example,

Short Time "hh:mm" displays the difference in time in hours and

minutes.

For more information search for "Format", then "Format, Format$

functions"

using the Help menu.

References


INF: How to Remove the Caption on a Form

 Article Number: Q10014

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

Microsoft Access will, by default, display the name of the form in the

caption bar.

To alter the form so that it does not display a caption, enter a space

in the Caption property of the form.

References


INF: How to Remove a Form's Menu Bar

 Article Number: Q10014

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

To remove a form's menu bar, enter =1 (or any Access Basic

function that evaluates to a numeric result) in the OnMenu property of

the form.

More Information:

Entering =1 causes Microsoft Access to evaluate the OnMenu property.

Because there is nothing to place in the menu bar, the menu bar will

not display.

Steps to Reproduce Behavior:

---------------------------

1. Open the sample database Northwind Traders (NWIND.MDB).

2. Open the Categories form in Design view.

3. Open the form's property sheet by choosing Properties from the View

   menu.

4. Enter =1 in the OnMenu property.

5. Switch the form to Form view by choosing Form from the View menu.

The menu bar does not appear in the Microsoft Access application

window. The menu bar will reappear when the focus leaves the form or

when the form is closed.

References:

"Microsoft Access Language Reference," version 1.0, pages 339-340

References


PRB: 'Show All Records' Menu Choice not Available

 Article Number: Q10014

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

You are unable to select the Show All Records menu choice from the

Records menu.

CAUSE

The form's AllowFilters property is set to No. This behavior is by

design.

RESOLUTION

Set the form's AllowFilters property back to Yes.

MORE INFORMATION

================

When the AllowFilters property is set to No, the following commands on

the Records menu are disabled: Edit Filter/Sort, Apply Filter/Sort,

and Show All Records.

For more information on the AllowFilters property, search for

"AllowFilters", then "AllowFilters Property" using the Help menu.

References


PRB: Extra Unwanted Information Appears in List Box

 Article Number: Q10014

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

Unwanted or excess information appears in your list box, along with

the desired information.

CAUSE

Check for a control located behind the list box.

RESOLUTION

Possible solutions involve either removing the underlying control

or repositioning the list box.

MORE INFORMATION

================

A combo box does not exhibit this same behavior.

Steps to Reproduce Behavior

--------------------------

1. Open the sample database Northwind Traders (NWIND.MDB).

2. Open the Employees form in design mode.

3. Add a list box to the form, with the following properties:

   Object: List Box

   -----------------

   ControlName: List Box Test

      ControlSource: Employee ID

      RowSourceType: Table/Query

      RowSource: Employees

      Left: 2.99 in

      Top: 0.67 in

5. From the View menu, choose Form.

Initially, the list box displays the correct information, but as you

go from record to record the information in the underlying control

(First Name) bleeds through. Thus, your list box appears to contain

garbled or excess information.

References


INF: How To Print Duplicate Labels

 Article Number: Q10014

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article describes a method to print multiple labels for each

record. The example that follows uses the NWIND.MDB database and the

Customers table.

More Information:

This example will print 10 labels for each record

1. In the NWIND.MDB, create a new table called Label Count

   with one number field. Use the default properties and do not

   create a Primary Key. After the table is created, enter a 1

   in the first record, a 2 in the second, onto 10 for a total

   of 10 records.  You will need to enter as many records into this

   table as the amount of times you would like to be able to duplicate

   the label when printing.  In this example, we will limit the amount

   of duplicates to 10.

      Table: Label Count

      ------------------

      FieldName: Count

         DataType: Number

2. Create a new query based on Label Count and the Customers table

that

   has the address information for the label.

      Query: LabelQuery

      -----------------

      Type: Select Query

      Tables: Label Count and Customers

      Join: None

   From the View menu choose Totals so that all fields have Group By

   specified.

      Field: Company Name

         Table: Customers

         Total: Group By

      Field: Contact Name

         Table: Customers

         Total: Group By

      Field: Address

         Table: Customers

         Total: Group By

      Field: City

         Table: Customers

         Total: Group By

      Field: Region

         Table: Customers

         Total: Group By

      Field: Postal Code

         Table: Customers

         Total: Group By

     Field: Count

         Table: Label Count

         Total: Group By

         Criteria: <= [Enter Number of Labels to Print for Each

Customer]

    The Count field from the Label Count table can have an *optional*

    parameter value specified in the criteria cell to fill in the

number of

    labels to print for each record in the Customers table. If this

query is

    used without a parameter value then 10 identical labels will be

printed

    for each record in the Customers table.

3. Using the ReportWizard, create a new mailing label report based on

   the LabelQuery query. If the parameter option is used, you will be

   prompted for the number of labels to print for each customer.

Without

   the label option 10 labels will be printed for each customer.

References


PRB: Couldn't Find Object using OpenQueryDef

 Article Number: Q10014

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

When using the OpenQuerydef method on a parameter query, the

following error message is generated:

   Couldn't Find Object.

This error will occur when using the sample on page 137 of the

"Introduction to Programming".

CAUSE

Either the name of the query to open is misspelled, the parameter

is misspelled, or the parameter is not explicitly defined. In the

sample on page 137 of the "Introduction to Programming", the query

name is misspelled and the parameter is misspelled.

RESOLUTION

'*****************************************************************

' The following function will fix the documentation errors on page

' 137 of the "Introduction to Programming" and will run correctly.

' Declarations section of the module

'*****************************************************************

Option Explicit

Function TestQP ()

   Dim db As Database, Q As QueryDef, DataRecs As Dynaset

   Set db = CurrentDB()

   Set Q = db.OpenQueryDef("Products by Category (Parameter)")

   Q![Enter a category id:] = "COND"    'This is an explicit parameter

   Set DataRecs = Q.CreateDynaset()

   DataRecs.Close

   Q.Close

End Function

MORE INFORMATION

================

References: "Microsoft Access Introduction to Programming" , Chapter

8, pg. 137

References


INF: OpenDatabase and CloseDatabase Pseudo Actions

 Article Number: Q10014

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

Microsoft Access version 1.1 includes two new DDE Commands, also

known as pseudo actions, available through the DDE "System" Topic:

   OpenDatabase and CloseDatabase.

This article describes these pseudo actions, which allow you to open

and close Microsoft Access databases over a DDE channel.

More Information:

The syntax for the pseudo actions OpenDatabase and CloseDatabase is:

   OpenDatabase DATABASE_LOCATION

   CloseDatabase

Where DATABASE_LOCATION is the path and filename of the Microsoft

Access database to be opened. The CloseDatabase action does not take a

parameter since Microsoft Access can only have one database open at a

time.

The following example creates a macro in Microsoft Excel that

demonstrates how the OpenDatabase and CloseDatabase pseudo actions

work. This macro will not work with Microsoft Access version 1.0.

Sample DDE Macro from Microsoft Excel to Microsoft Access

---------------------------------------------------------

1. Open Microsoft Access (This macro will only work when Microsoft

   Access is already running).

2. Open a new Macro Sheet in Microsoft Excel. Enter the following

   macro:

      Cell    Command

      ----    -----------------------------------

      A1      PseudoOpenCloseDDEExample

      A2

      A3      chan=INITIATE("MSACCESS","SYSTEM")

      A4      =APP.ACTIVATE("Microsoft Access",FALSE)

      A5      =EXECUTE(chan,"[opendatabase nwind.mdb]")

      A6      =EXECUTE(chan,"[Sample AutoExec]")

      A7      =EXECUTE(chan,"[closedatabase]")

      A8      =TERMINATE(chan)

      A9      =APP.ACTIVATE(,FALSE)

      A10     =RETURN()

3. Before running this macro, size your Microsoft Access and Microsoft

   Excel windows so that you can view both applications at the same

   time.

4. To run the macro, select cell A3. Then choose Run from the Macro

   menu and choose OK.

The commands in cells A3 and A4 initiate a DDE channel to Microsoft

Access on the SYSTEM topic, and activate the Microsoft Access

application.

The command in cell A4 opens the sample database Northwind Traders

(NWIND.MDB) file in the current working directory using the

OpenDatabase pseudo action.

The command in cell A5 runs the Sample AutoExec macro which is in the

sample database Northwind Traders (NWIND.MDB) database file.

The command in cell A6 closes the currently opened database file using

the CloseDatabase pseudo action.

The commands in cells A8:A10 terminate the DDE channel, activate the

Microsoft Excel application, and end the macro.

For more information on using macro actions in DDE, query on the

following words in the Microsoft Knowledge Base:

   dde and macro and action

References


INF: Quit Macro Action

 Article Number: Q10014

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article provides an example of using the Quit macro action to

quit Microsoft Access over a DDE channel.

More Information:

The syntax for the action Quit is:

   Quit

There is no parameter for the Quit action.

The following example creates a macro in Microsoft Excel that

demonstrates how the Quit action works. This macro will not work with

Microsoft Access version 1.0.

Sample DDE Macro from Microsoft Excel to Microsoft Access

---------------------------------------------------------

1. Open a new macro sheet in Microsoft Excel and enter the following

   macro:

   Cell     Command

   ----     -------------------------------------------

   A1       QuitDDEExample

   A2

   A3       =APP.MINIMIZE()

   A4       =ERROR(FALSE)

   A5       =APP.ACTIVATE("Microsoft Access",FALSE)

   A6       chan=INITIATE("MSACCESS","system")

   A7       =APP.ACTIVATE("Microsoft Access",FALSE)

   A8       =EXECUTE(chan,"[QUIT]")

   A9       =TERMINATE(chan)

   A10      =APP.ACTIVATE(FALSE)

   A11      =RETURN()

2. Before running this macro, size your Microsoft Access and Microsoft

   Excel windows so that you can view both applications at the same

   time.

3. To run the macro, select cell A3. Then choose Run from the Macro

   menu and choose OK.

For more information on using macro actions in DDE, query on the

following words in the Microsoft Knowledge Base:

   access and 1.1 and dde and macro and action

References


PRB: Macro on Subform Control Executed by Main Form

 Article Number: Q10015

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

If a macro is attached to the OnEnter or OnExit properties of the

first control in the tab order of a subform, the macro will be

executed each time the main form is moved from one record to another

record.

In addition, a macro attached to OnEnter of the first control in the

tab order of the subform will be executed when the main form is opened

and a macro attached to the OnExit of the first control in the tab

order of

the subform will be executed when the form is closed.

More Information:

Steps To Reproduce Problem:

1. Open the Northwind Traders database (NWIND.MDB) supplied with

   Microsoft Access and create the following macro called "Test":

      MacroName     Action

      ====================

      Test          MsgBox

      Test1 Actions

      -------------

      MsgBox

         Message: Testing!

2. Open the "Orders Subform" and change the OnEnter and OnExit

   properties of the Property ID box to "Test".

      Form:  Orders Subform

         OnEnter:  Test

         OnExit:   Test

3. Save the Orders Subform, open the Orders form and navigate between

   records. The message "Testing!" will appear twice for each record.

Work Around:

To cause a macro to only be executed when actually moving in and out

of the control on the subform, a test condition with a flag must be

used. A macro will be used to set a flag on the mainform to indicate

whether the subform was entered by navigating into the subform from

the mainform. The macro attached to the OnEnter and OnExit macros can

check this flag to see if the user really did navigate into the

subform and continue execution if appropriate.

1. Create the following macro called "Subform Flag":

      Macro Name      Action

      ======================

      Set             SetValue

      UnSet           SetValue

      "Subform Flag" Actions

      ----------------------

      SetValue

         Item: [Subform Flag]

         Expression: True

      SetValue

         Item: [Subform Flag]

         Expression: False

2. Create an unbound textbox on the main form (Orders) with the

   following properties:

      Form:  Orders

      Text Box: Subform Flag

         ControlName: Subform Flag

         Visible: No

         Default Value: False

3. Select the subform control on the main form (Order Details) and

   make the following property changes:

      Form:  Orders Subform:

         On Enter: Subform Flag.Set

         On Exit: Subform Flag.UnSet

4. Add the following macro action to the top of the macro that is

   attached to the On Enter and On Exit properties of the first

control

   in the tab order of the subform. This macro will not execute any

   actions if the subform flag is not set.

      Condition                          Action

      --------------------------------------------

      Parent![Subform Flag] = False      StopMacro

Limitation:

The macro attached to the OnEnter property of the first control in the

subform will not execute when you enter the control from the main form

and the control is in the selected record on the subform (denoted by a

triangle in the record selector). As a result, the macro will not

execute by tabbing into the subform, or by mouse clicking on the first

control in the selected record on the subform. However, it will

execute if you mouse click in this control on a different record in

the subform.

References:

"Microsoft Access User's Guide" Chapter 22, "Using Macros with Forms"

and Chapter 9, "Designing Forms;" Appendix C

References


PRACC9304: TrueType Fonts Shift Vertically on HP4 Printer

 Article Number: Q10015

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

SYMPTOMS

When a form or report which is formatted with a TrueType font is

printed to an HP Laserjet 4 printer, the data which is formatted with

the TrueType font is shifted vertically towards the top of the

controls.

CAUSE

The HP Laserjet 4 driver is reporting incorrect font metrics for

some TrueType fonts. This causes Microsoft Access to incorrectly

compensate by shifting the fonts up vertically when sending the form

or report to the printer.

RESOLUTION

Use a non-TrueType font when printing to the HP Laserjet 4 printer,

or use another printer driver that is compatible with the HP Laserjet

4 printer (for example, the HP Laserjet 3 printer driver).

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0, using HP Laserjet 4 driver versions 31.1.03 and 31.V1.08.

Microsoft Access version 1.1 corrects this problem.

MORE INFORMATION

================

If you experience the same problem with a non-TrueType font, check to

see if that font is a printer font. If not, it may be mapped to a

TrueType font by Windows for printing. If it is re-mapped to a

TrueType font then you will see the same vertical shift of information

when printing.

The following example assumes that you have an HP 4 printer connection

and that you are using an HP 4 printer driver version 31.1.03 or

31.V1.08.

Steps to Reproduce Problem

--------------------------

1. Create a new unbound form.

2. Add 2-text box controls to the form, as follows:

   Object: Text Box

   ----------------

   ControlName: Field0

      ControlSource: ="Testing TrueType font"

      FontName: Arial

   Object: Text Box

   ----------------

   ControlName: Field2

      ControlSource: ="Testing non-TrueType font"

      FontName: Microsoft Sans Serif

3. From the View menu, choose Form.

4. After verifying that you are configured to print to an HP 4

   printer, open the form in Print Preview by choosing Print Preview

   from the File menu.

   The Print Preview will look normal and the data will not be shifted

in

   either control.

8. Print the form out by choosing Print from the File menu.

The result is that the data in Field0 will be shifted up vertically in

the control. The data in Field2 will maintain the correct positioning.

The HP Laserjet 4 printer driver (HPPCL5E.DRV) is manufactured by

Hewlett-Packard(HP), a vendor independent of Microsoft; we make no

warranty, implied or otherwise, regarding this product's performance

or reliability.

References


PRACC9210: Reports Unusable Without Default Windows Printer

 Article Number: Q10015

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

A report is unusable if created with the Microsoft Access

ReportWizard on a system without a default Windows printer defined.

Once a default Windows printer is defined, the report can be

printed.

Before the printer is defined, the following error message will be

displayed whenever you try to Print Preview or Print the report:

   There is no default printer. Select or install one using Windows

   control panel.

RESOLUTION

Be sure that a default Windows printer is defined in your WIN.INI

file before creating reports with the ReportWizard. For example:

   [windows]

   ...

   device=QMS-PS 810,pscript,LPT1:

If you don't have a default printer defined, then select or install

one, following the instructions in the "Microsoft Windows User's

Guide" or in Windows Help.

Once a default Windows printer is defined, the report works as

expected, with no error messages.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0 and 1.1. We are researching this problem and will post new

information here as it becomes available.

MORE INFORMATION

================

Steps to Reproduce the Problem

------------------------------

1. Temporarily disable the loading of your default Windows printer in

   your WIN.INI file by placing a ";" (comment) before the "device=".

2. Start Microsoft Access and open the Northwind Traders sample

   database (NWIND.MDB).

3. Select a table (such as Categories).

4. Create a report based on that table using the Access Report Wizard.

   (Don't create a blank report.)

   Results: You get 2 default printer alert windows stating, "There is

no

   default printer. Select or install one using Windows control

panel."

   This alert message comes up whenever you attempt to preview, edit,

or

   print the report, making the report unusable.

References


INF: Using DataPerfect data in Microsoft
INF: Using DataPerfect data in Microsoft Access

 Article Number: Q10015

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

The following information describes how to import data into Microsoft

Access from WordPerfect DataPerfect.

More Information:

In order to use DataPerfect data in Microsoft Access, the information

must first be saved from DataPerfect using the "DOS Delimited Text"

format. Once this process is done, Microsoft Access can import the

data

using the "Text (Delimited)" option from the Export menu.

Problems with multi-line field entries

--------------------------------------

DataPerfect allows you to press ENTER in fields (creating a carriage

return character) to create multiple line entries. In the "Customer

Information" panel of the "CLIENT1" database supplied with

DataPerfect, the Address and Comment fields in some records contain 2

line entries.

Note: A "panel" in DataPerfect is equivalent to a table in Microsoft

Access.

"DOS Delimited Text" files use carriage returns to mark the end of a

record and cannot be included in field information. DataPerfect does

not account for this when it saves the data in "DOS Delimited Text"

format and generates an invalid file which will not successfully

import into Microsoft Access. The offending carriage returns must be

removed prior to importing the data into Microsoft Access.

The following instructions demonstrate how to:

1. Export the "Customer Information" panel supplied with DataPerfect.

2. Use Microsoft Write, the word processor supplied with Microsoft

   Windows, to clean up the troublesome carriage returns.

3. Import the resulting information into Access.

Exporting the "Customer Information" panel from DataPerfect

-----------------------------------------------------------

1. Start DataPerfect by typing DP from the DATA directory at the DOS

   command prompt.

2. You will be presented with a list of databases to open. Choose your

   database or "CLIENT1" and press ENTER.

3. You will be presented with a list of "panels" in the database to

   work with. Choose your panel, or "Customer Information" if you

chose

   "CLIENT1" in step 1, and press ENTER.

4. Press SHIFT+F7 to access the report list

5. Choose "Built-In Short Reports" from the list and press ENTER to

   access the Built-In Report/Export menu.

6. Press 2 to select Disk File On/Off and press 1 to select Create

   File.

7. Type in the name "CUST.TXT", or any convenient name, preferably

   with a TXT extension, and press ENTER.

8. Press 8 to select Report/Export Format options.

9. Press 6 to select Export DOS Delimited Text.

10. Press ENTER to accept the pipe symbol, "|", as the Field

    Delimiter.

11. Press the spacebar key to overwrite the "~" mark as the Record

    Delimiter, leaving <CR><LF> in place.

12. Press Shift+F7 to begin the export.

13. When the exprot is finished, press any key to return to the list

    of reports.

14. Press F1, then F7, then F7, then 0 to exit DataPerfect.

Removing the extra carriage return characters from CUST.TXT

-----------------------------------------------------------

1. Start Microsoft Write, found in your Accessories group.

2. Choose Open from the File menu.

3. From the list of files, select CUST.TXT and press ENTER. You may

   have to navigate the directory list to your DataPerfect directory

   which is usually called DATA. Type in *.TXT and press ENTER to see

a

   list of TXT files in this directory.

4. Choose "No Conversion" when asked to convert the text file.

The document should now appear on the screen, with each piece of

information separated by a pipe symbol and each record ending with a

carriage return. Each record can be lengthy and word wrap to the next

line.

5. The lines that begin with the following text have an extra carriage

   return that incorrectly continues the record to the next line:

    1|Burnett

    26|Corrales, Jr.

    7|Frame

    19|Rhoton

    22|Tolman

Navigate to the end of these lines and press the DEL key to bring the

next line up flush with the first one, effectively removing the faulty

mark.

6. The second line of the records that begin with the following text

   have extra paragraph marks that incorrectly mark the end of the

   record.

    10|Grayson

    21|Sergeant

Navigate to the end of the second line of these records and remove the

incorrect mark by pressing DEL.

7. Choose Save from the File menu.

8. Choose Exit from the File menu to exit Write.

Importing the exported DataPerfect data into Microsoft Access

-------------------------------------------------------------

1. Open the desired database in Access to import the data into.

2. Choose Import from the File menu.

3. Choose "Text (Delimited)" from the Data Source list.

4. From the file list choose "CUST.TXT" just as you did when loading

   the file into Write, and choose the Import button.

5. In the Import Text Options window, choose the Options button.

6. Delete the double quote mark from the Text Delimter box.

7. Type the pipe symbol, "|", in the Field Separator box.

8. Choose the OK button to begin the import.

Access will report any errors discovered during the import. You can

examine the data imported into the resulting table and check to see

that the proper data was imported into the proper columns. If you find

data from one record spilling into fields in another record, this

suggests that this record has an extra carriage return that was not

removed. Open the file with a text editor, remove the offending

carriage return, and reimport the data.

References: "DataPerfect User's Guide", page 339-343

References


PRACC9305: GPF Button Caption Text Larger than 2048 Characters

 Article Number: Q10015

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

You receive the following error message:

   Application Error - MSACCESS caused a General Protection Fault

   in module MSACCESS.EXE at 0058:40DC.

CAUSE

You may have set the caption of a command button to a text string

that is larger than 2048 characters in length.

RESOLUTION

Captions are limited in length to 2048 characters. Trying to set

the caption to something larger than 2048 characters with Access

Basic can result in unexpected behaviors such as the error message

described above.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.1. Microsoft is researching this problem and will post

new information here as it becomes available.

MORE INFORMATION

================

Steps to Reproduce Problem

--------------------------

The following steps will generate the message box described above.

1. Add the following code to an Access Basic module:

      Function mod_CreateForm ()

         Dim F As Form

         Dim C As Control

         Set F = CreateForm("", "")

         Set C = CreateControl(F.FormName, 104, 0, "", "", 100, 100)

         C.Caption = String$(3000, "M")

      End Function

2. Run the code by typing at the Immediate window:

      ?mod_CreateForm()

3. Notice that an icon for the form is created. Restore the form from

   the iconized state and set focus to the button. Click on the

   button as if you were going to change some of the text of the

   command button.

4. Try to change from Design mode into Browse mode. At this point you

   should get the error message as described above.

References


INF:  1.0 (rel. 1/14/93) Disks 1-3 Contents 3.5" 1.4 meg
INF: Access 1.0 (rel. 1/14/93) Disks 1-3 Contents 3.5" 1.4 meg

 Article Number: Q10015

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

The following lists the directory contents of diskettes 1-3 shipped

with Microsoft Access version 1.0  release date: 1/14/93 (3.5 inch,

1.44 meg).

The WBTRCALL.DLL was removed from the original release of Microsoft

Access 1.00.  Due to this removal, the SETUP.EXE was changed. No

functionality of Microsoft Access was changed for this release.

More Information:

Contents of DISK1

-----------------

1        WMF      4470 01-04-93  12:00a

1E       WMF      4022 01-04-93  12:00a

BTRVISAM DL$     57918 01-04-93  12:00a

COMMDLG  DL$     46406 10-09-92  10:02a

COMMDLG  DL_     89248 01-04-93  12:00a

CTL3D    DL$      7524 08-16-92   7:35p

DBSISAM  DL$    135919 01-04-93  12:00a

DDEML    DL$     20305 03-10-92   3:10a

DETCMD   DL_     24128 01-04-93  12:00a

MSACCESS IN$       519 01-04-93  12:00a

MSACCESS RE$       552 01-04-93  12:00a

MSAIN100 DL$     71625 01-04-93  12:00a

MSAJU100 DL$     38945 01-04-93  12:00a

OLECLI   DL$     41083 10-09-92  10:02a

OLESVR   DL$     13129 10-09-92  10:02a

ORDENTRY TX$      2281 01-04-93  12:00a

ORDENTRY HL$     14224 01-04-93  12:00a

ORDENTRY MD$    200396 01-04-93  12:00a

PIM      HL$      8119 01-04-93  12:00a

SETUP    EXE     21472 01-04-93  12:00a

SETUP    INI       149 01-04-93  12:00a

SHARE    EX$      8112 10-09-92  10:02a

SHELL    DL$     23296 10-09-92  10:02a

SMALLB   FO$      9687 03-06-92   7:16p

SMALLE   FO$     11236 03-06-92   7:16p

SMALLF   FO$      9376 03-06-92   7:16p

STFSETUP EX_    477392 01-04-93  12:00a

STFSETUP IN_     58041 01-04-93  12:00a

VER      DL$      5653 10-09-92  10:02a

VER      DL_      9008 01-04-93  12:00a

WORKGRP  IN_      1393 01-04-93  12:00a

       31 file(s)    1415628 bytes

Contents of DISK2

-----------------

2        WMF      8022 01-04-93  12:00a

2E       WMF      6870 01-04-93  12:00a

MSACCESS HL$   1189376 01-04-93  12:00a

PDXISAM  DL$    106830 01-04-93  12:00a

REGEDIT  EX$     18176 10-09-92  10:02a

        5 file(s)    1329274 bytes

Contents of DISK3

-----------------

3        WMF      8950 01-04-93  12:00a

3E       WMF      8470 01-04-93  12:00a

MSABC100 DL$    187802 01-04-93  12:00a

MSAES100 DL$     16899 01-04-93  12:00a

MSAFIN   DL$     18553 01-04-93  12:00a

WIZARD   MD$    174297 01-04-93  12:00a

MSACCESS EX$    790199 01-04-93  12:00a

        7 file(s)    1205170 bytes

References


INF: How to Specify a Custom Starting Page Number for a Report

 Article Number: Q10015

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

In Microsoft Access, the "Page Property" specifies the current page

number on each page of a report. By Default the page numbers will

start

at 1. This article describes two methods to allow for user defined

starting

page numbers. Both provide custom page numbers, however the second

method

uses Access Basic and can therefore include some error checking.

More Information:

Method 1

--------

Change the ControlSource of the text box where the page number is

being

displayed from "=Page" to "=Page + [Enter a Starting Page Number] -1"

This will cause the user to be prompted to enter a starting page

number

each time the report is previewed or printed. For example, in

NWIND.MDB,

open the Alphabetical List of Products report in design view. In the

right

side of the page footer, there is a text box with a ControlSource of

"=Page". Change the ControlSource of the text box to "=Page + [Enter a

Starting Page Number] -1"

Method 2

--------

The second method assumes that you are familiar with Access Basic and

how

to create and use Access Basic Procedures. This method is more

complex, but

avoids the possibility that a non-numeric value be entered by the user

when

prompted for a starting number.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access.  For more information on Access Basic,

please refer to "Introduction to Programming" manual.

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

1. First open a new Module or a previously created module and enter

   the following code:

     '******************************************************

     'Declarations Section of Module

     '******************************************************

     Option Explicit

     Global PageChoice As Integer

     '=============================================================

     ' Create the following GetPageChoice() function in the Module

     '=============================================================

     'This function is called in the OnOpen property of the Report.

     Function GetPageChoice ()

        Dim choice As String

        Do

           choice = InputBox("Enter a Starting Page Number:","Number _

                         Report", "1")

           If Not (IsNumeric(choice)) Then

              MsgBox "Value Entered is not a Number."

           End If

        Loop While Not (IsNumeric(choice))

        PageChoice = CInt(choice)

     End Function

     '=============================================================

     ' Create the following ReturnPageChoice() function in the Module

     '=============================================================

     'This function is called by the text box that will contain the

     ' pagenumber.

     Function ReturnPageChoice (pgnumber As Integer)

        ReturnPageChoice = PageChoice + pgnumber - 1

     End Function

2. Open your report in Design view.

3. From the Edit Menu choose "Select Report" and from the View menu

select

   "Properties" to display the Property Sheet. Change the following

Report

   Property:

      OnOpen: =GetPageChoice()

4. To display the page numbers, create a text box in the Page Footer

   of the report with the following properties:

      Text Box:  Text1

      ----------------

         ControlName: PageNumber

         ControlSource: =ReturnPageChoice(Page)

When you Print Preview or Print the report, you will be prompted for a

starting page number. Each page will be numbered consecutively

starting with this number.

References:

"Microsoft Access User's Guide," version 1.0, Chapter 18, "Designing

Reports," pages 422-424, 440-444 and Chapter 23, "Using Macros to

Print

Reports or Transfer Data" pages 571-572.

"Microsoft Access Language Reference," version 1.0, page 364

References


PRACC9306: Help Context ID property does not work in subform

 Article Number: Q10015

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

When the F1 key is pressed while the insertion point is in a

subform control, Microsoft Access will invoke the main form's help

file

with the contents window rather than invoke the appropriate topic for

the subform control.

CAUSE

Microsoft Access ignores the Help Context ID property of the subform

control.

RESOLUTION

See the code workaround listed below.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. This has been fixed in Microsfot Access version 1.1.

MORE INFORMATION

================

The following workaround can be used in Microsoft Access version 1.0

to

circumvent the problem described above. This solution provides a

custom help function which will be invoked by the F1 key. This

function will test to see which control is currently active on a form

and call the WinHelp API call to invoke the appropriate help topic for

the control.

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

Create the following macro and save it with the name "AutoKeys":

   MacroName     Action

   =====================

   {F1}          RunCode

   AutoKeys Actions

   ----------------

   RunCode

      Function Name: =Help("c:\access\yourhlp.hlp")

   Note: Change "c:\access\yourhlp.hlp" to the path and filename of

the

   desired help file to use.

Create the following module:

'*************************************************************

'Declarations section of the module.

'*************************************************************

' NOTE: In the following sample code, an underscore (_) is used as a

line

' continuation character. Remove the underscore when re-creating this

code

' in Access Basic.

Option Explicit

Declare Function WinHelp% Lib "User" (ByVal hwnd%, ByVal lpHelpFile$,_

                                      ByVal wCmd%, ByVal dwData As

Any)

Global Const HELP_CONTEXT = &H1

Global Const HELP_CONTENTS = &H3

'*************************************************************

' FUNCTION NAME: Help

'

' PURPOSE:

'   Based on the currently active control, it will call the

'   WinHelp API to invoke help on a predefined Context ID for

'   the control. If the control name is not represented, a

'   message box will appear indicating no help is available.

'   If there is no active form available, the contents of the

'   help file will be invoked.

'

' INPUT PARAMETERS:

'   HelpFile: The path/filename of the help file to use

'

' RETURN

'   None

'*************************************************************

Function Help (HelpFile As String)

   Dim ContextID As Long

   Dim Ret As Integer

   On Error GoTo HelpError

   ' Determine which control needs help and set the

   ' .. appropriate ContextID for the control

   Select Case Screen.ActiveControl.ControlName

'Note: You will have to customize the Case statements that follow

'      for your specific control names and the ContextID to call for

'      the control name.

      Case "Category ID"

        ContextID = 1

      Case "Category Name"

        ContextID = 1

      Case "Description"

        ContextID = 1

      Case "Product ID"

        ContextID = 2

      Case "Product Name"

        ContextID = 2

      Case "Unit Price"

        ContextID = 2

      Case "Picture"

        ContextID = 2

      Case Else

         MsgBox "No help for " & Screen.ActiveControl.ControlName

         ContextID = -1

   End Select

   ' Call the help file with the appropriate ContextID.

   If ContextID > -1 Then

      Ret = WinHelp(Screen.ActiveForm.hwnd, HelpFile, _

                    HELP_CONTEXT, ContextID)

   End If

   GoTo ByeHelp

HelpError:

   ' Display the contents window of the help file

   Ret = WinHelp(0, HelpFile, HELP_CONTENTS, 0&)

   Resume ByeHelp

ByeHelp:

End Function

References


INF:  1.0 (rel. 1/14/93) ODBC Disk Cont. 3.5" 1.44 Meg
INF: Access 1.0 (rel. 1/14/93) ODBC Disk Cont. 3.5" 1.44 Meg

 Article Number: Q10015

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

The following lists the directory contents of the ODBC disk shipped

with Microsoft Access version 1.0  release date: 1/14/93 (3.5 inch,

1.44 meg).

The WBTRCALL.DLL was removed from the original release of Microsoft

Access 1.00.  Due to this removal, the SETUP.EXE was changed. No

functionality of Microsoft Access was changed for this release.

More Information:

Contents of ODBC

-----------------

DBNMP3   DLL      8241 10-22-92   3:06p

INSTCAT  SQL     93796 01-04-93  12:00a

MSCOMSTF DLL     74528 01-04-93  12:00a

MSDETSTF DLL     24544 01-04-93  12:00a

MSINSSTF DLL     65440 01-04-93  12:00a

MSSHLSTF DLL     14928 01-04-93  12:00a

MSUILSTF DLL      6144 01-04-93  12:00a

ODBC     DLL     44736 01-04-93  12:00a

ODBC     INF      1226 01-04-93  12:00a

ODBCADM  EXE      9136 01-04-93  12:00a

ODBCADM  HLP      4942 01-04-93  12:00a

ODBCINST DLL      6016 01-04-93  12:00a

SETUP    EXE     54464 01-04-93  12:00a

SETUPI   DLL     44032 01-04-93  12:00a

SQLSETUP DLL     11024 01-04-93  12:00a

SQLSRVR  DLL    135792 01-04-93  12:00a

VER      DLL      9008 10-22-92   3:06p

7        WMF      5846 01-04-93  12:00a

7E       WMF      5366 01-04-93  12:00a

WFWDRV   TXT      2134 01-04-93  12:00a

WFWDRV   EXE     23581 01-04-93  12:00a

WFWNET   DR_    165600 01-04-93  12:00a

LANMAN21     <DIR>     01-04-93  12:00a

       23 file(s)     810524 bytes

References


PRB: SCSI Drives can Generate "corrupt" Error Message

 Article Number: Q10015

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

It is possible that a Microsoft Access database file (MDB) loading

from a SCSI hard drive could generate the following error message:

   "<filename> is corrupted or is not a database file.

    Attempt to Repair?"

Attempts to repair the Database do not solve the problem.

CAUSE

Typically, the database file is OK but Microsoft Windows itself

is having trouble accessing the Drive.

RESOLUTION

Add the following line to the Config.Sys file.

   Device=c:\windows\smartdrv.exe /double_buffer

Note:  If the machine is running MS-DOS 6.0 point to the

"\dos" directory for the newest version of Smartdrv.exe.

MORE INFORMATION

================

With most SCSI(small computer system interface) drives,

Windows 3.1 requires the Smartdrv double buffer statement to

boot Windows 3.1 into enhanced mode and access the drive.

On a machine where windows is not on the SCSI drive, it is

possible that windows boots into enhanced mode but Smartdrv

Double_buffer is not loading.

References: Windows 3.1 Users Guide Chap 14

References


PRB: "System Error" Sharing Database on LanMan/Workgroups

 Article Number: Q10016

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

SYMPTOMS

If you attempt to save a Microsoft Access database larger than 2000

bytes on a Microsoft LAN Manager server with a boot drive that uses

File Allocation Table (FAT) format, the error message "System

error... Network error on drive <x>" occurs.

This only occurs on Microsoft Windows for Workgroups workstations

if you attempt to open a database already in use by a Microsoft LAN

Manager workstation or another Windows for Workgroups workstation.

CAUSE

The problem is due to the Microsoft LAN Manager server responding

incorrectly to a request by Windows for Workgroups to share the

file. The server responds with a message that is too long for

Windows for Workgroups to correctly process, resulting in an error

from Netbios.

RESOLUTION

There are two ways to work around this problem:

   -  Change the format of the Microsoft LAN Manager server's boot

      drive from FAT to HPFS and place the Microsoft Access

      database you want to share on the boot drive.

   -or-

   -  Place the database on a Windows for Workgroups server.

References


INF:  1.0 (rel.1/14/93) Disks 4-6 Contents 3.5"1.44 meg.
INF: Access 1.0 (rel.1/14/93) Disks 4-6 Contents 3.5"1.44 meg.

 Article Number: Q10016

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

The following lists the directory contents of diskettes 4-6 shipped

with Microsoft Access version 1.0  release date: 1/14/93 (3.5 inch,

1.4 meg).

The WBTRCALL.DLL was removed from the original release of Microsoft

Access 1.00.  Due to this removal, the SETUP.EXE was changed. No

functionality of Microsoft Access was changed for this release.

More Information:

Contents of DISK4

-----------------

4        WMF      8246 01-04-93  12:00a

4E       WMF      7766 01-04-93  12:00a

ANALYZER MD$     49740 01-04-93  12:00a

MSAJT100 DL$    338672 01-04-93  12:00a

NEWCUST  DB$      1212 01-04-93  12:00a

NWIND    MD$    555226 01-04-93  12:00a

PIM      MD$    109267 01-04-93  12:00a

SYSTEM   MD$     98863 01-04-93  12:00a

UTILITY  MD$     47055 01-04-93  12:00a

WINHELP  EX$    147911 10-09-92  10:02a

WINHELP  HL$     28161 10-09-92  10:02a

       11 file(s)    1392119 bytes

Contents of DISK5

-----------------

5        WMF      4662 01-04-93  12:00a

5E       WMF      4150 01-04-93  12:00a

CBTLIB4  DL$     11179 01-04-93  12:00a

CUECARD  EX$     60269 01-04-93  12:00a

CUECARDS DL$      2047 01-04-93  12:00a

CUECARDS LE$    887544 01-04-93  12:00a

GRAPH    EX$    364877 10-09-92  10:02a

MSGRAPH  HL$    110291 10-09-92  10:02a

        8 file(s)    1445019 bytes

Contents of DISK5

-----------------

6        WMF      5846 01-04-93  12:00a

6E       WMF      5366 01-04-93  12:00a

MSACCES2 HL$   1134560 01-04-93  12:00a

PSSKB    TX$      7951 01-04-93  12:00a

README_  TX$     10186 01-04-93  12:00a

ERRATA   TX$      9805 01-04-93  12:00a

WFWNET   DR$    151762 01-04-93  12:00a

        7 file(s)    1325476 bytes

References


PRB: Companion Disk install and Out of Disk Space

 Article Number: Q10016

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

You will get the following error message if you run out of disk space

during the install of the Microsoft Access Companion Disk files.

   Out of space. Insert new disk and press RETURN:

Problem is you cannot insert a new hard disk. Also even if you were

installing under windows and you went and cleaned some disk space off

the error message continues -- it doesn't re-check disk space on the

hard drive.

CAUSE

This is a limitation of the install process (COMPRESS.EXE) provided

with the Companion disk.

RESOLUTION

1. Press Ctl+C to break out of the batch job.

2. Delete any files that may have already been copied over (MSCMS.MDB,

   MSDIRECT.MDB, MSFORMS.MDB, MSSWEETS.MDB)

3. Free up more that 3.8Megs of disk space

4. Run install again

MORE INFORMATION

================

Steps to Reproduce Behavior

---------------------------

1. Create a RAM Drive or Find a drive with less than 3.0Megs of disk

   space free.

2. Install into a directory on that drive

3. When the drive fills up and the setup process hasn't completed

   (i.e. it can't expand all 4 files) you will get the error.

References


INF: Expanded Size of the Companion files

 Article Number: Q10016

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article discusses the files sizes of the Microsoft Access

Companion disk databases after the install process.

More Information:

By default (if you don't specify the directory as a parameter) the

Companion disk will install the files into a directory called

'C:\ACCESS'. Note it will prompt you for an OK before proceding.

Once those file are expanded (and before they are used) the file sizes

should be as follows:

MSCMS    MDB   2490368 05-10-93   6:34p

MSDIRECT MDB    557056 05-10-93   1:47p

MSFORMS  MDB    294912 05-11-93   7:22a

MSSWEETS MDB    458752 05-10-93   1:51p

        6 file(s)    3801088 bytes

References


INF: How To Call Functions using a String Variable

 Article Number: Q10016

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article describes how Access Basic or User Defined Functions can

be called when the function name is stored in a string variable. This

provides the like functionality provided by pointers to functions in

other languages.

More Information:

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to "Introduction to Programming" manual.

Calling a function in Access Basic when the function name is stored in

a variable is a desirable feature that provides the functionality like

that of pointers to functions.

To get this you store the function name and parameters in string

variable and then use the Access Basic Eval() function to evaluate the

string. The process of evaluating the variable will call the function.

Open a new Module or a previously created Module and enter the

following code:

' Note: Each command should be entered on one line. The line

' continuation character '_' improves the readability of the code.

'---------------------------------------

'GLOBAL DECLARATIONS SECTION

'---------------------------------------

Option Explicit

'------------------------------------------------------------------

' The following function will create an array of strings

'    and then will loop using the Eval() function to call

'    each element in the array.

'------------------------------------------------------------------

   Function CallMyArray ()

      Dim MyArray$()

       For i = 0 To 2

          ReDim Preserve MyArray$(i)

          MyArray$(i) = "MyFunc" & i & "(" & i & ")"

       Next i

       For i = 0 To 2

           x = Eval(MyArray(i))

       Next i

   End Function

'------------------------------------------------------------------

'    The first function called by CallMyArray().

'------------------------------------------------------------------

   Function MyFunc0 (nParam)

      MsgBox "This is function: " & nParam

   End Function

'------------------------------------------------------------------

'    The second function called by CallMyArray().

'------------------------------------------------------------------

   Function MyFunc1 (nParam)

      MsgBox "This is function: " & nParam

   End Function

'------------------------------------------------------------------

'    The third function called by CallMyArray().

'------------------------------------------------------------------

   Function MyFunc2 (nParam)

      MsgBox "This is function: " & nParam

   End Function

References: Microsoft Access Introduction to Programming

References


INF: How To Use The CTL3D.DLL In Your  Database
INF: How To Use The CTL3D.DLL In Your Access Database

 Article Number: Q10016

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article describes how to get the 3-D look in your Access database

provided by the CTL3D.DLL. Calling the CTL3D.DLL APIs will give your

message boxes and other dialogs that you create in your database that

3-D look.

More Information:

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to "Introduction to Programming" manual.

You can use CTL3D.DLL to add 3-D effects to the common dialog boxes

and message boxes for an Access Basic application. CTL3D.DLL does not

currently work for the controls on an Access Basic form. To use

CTL3D.DLL to enhance the common dialog boxes and message boxes from

Access Basic, follow the steps below.

You may have some Windows API functions defined in an existing

Microsoft Access library, therefore your declarations may be

duplicates. If you receive the duplicate procedure name error, remove

or comment the declare statement from your code.

' Note: Each command should be entered on one line. The line

' continuation character '_' improves the readability of the code.

'---------------------------------------

'GLOBAL DECLARATIONS SECTION

'---------------------------------------

Option Explicit

Declare Function GetModuleHandle% Lib "Kernel" (ByVal lpModuleName$)

Declare Function Ctl3dAutoSubClass% Lib "Ctl3D.DLL" (ByVal hInst%)

Declare Function Ctl3dRegister% Lib "Ctl3D.DLL" (ByVal hInst%)

Declare Function Ctl3dUnRegister% Lib "Ctl3D.DLL" (ByVal hInst%)

'------------------------------------------------------------------

' The following function needs to be called when your application

'    starts.

' This will register Access and subclass dialogs and message boxes

'    with the 3D look.

'------------------------------------------------------------------

Function Init ()

   Dim Inst%

   Dim ret

   Inst% = GetModuleHandle("MSACCESS.EXE")

   ret = Ctl3dRegister(Inst%)

   ret = Ctl3dAutoSubClass(Inst%)

End Function

'------------------------------------------------------------------

' The following function needs to be called when your application

'    quits.

'------------------------------------------------------------------

Function ShutDown ()

   Dim Inst%

   Dim ret

   Inst% = GetModuleHandle("MSACCESS.EXE")

   ret = Ctl3dUnRegister(Inst%)

End Function

After running the Init() function from the Immediate window, an

AutoExec macro or a RunCode macro action you can see the 3-D effects

by running a macro or function that displays a message box.

*****************************************************************

Remember to run the ShutDown function before quitting Access

*****************************************************************

References:

References


INF: Implementing Counter values on Attached SQL Server tables

 Article Number: Q10016

 CREATED: 16-JUN-1993

 MODIFIED: 17-JUN-1993

Summary:

When someone creates a table in Microsoft Access and ports it over to

SQL Server, they will immediately realize that SQL Server does not

include a Counter data type and something that is so easily done in

Microsoft Access can be very difficult to implement in SQL Server.

This article talks about how to maintain the counter functionality of

an attached SQL Server table.

More Information:

If this is a multi-user system there are special precautions you will

want to take. First of all, let's assume the counter column in the

SQL Server is called ID and it is the unique index for this table. In

most cases, everyone tries to simulate counters with a SQL Server

OnInsert trigger that computes the maximum value and adds one. This

would work except that Microsoft Access uses that index (bookmark)

as a pointer to the record and Microsoft Access would not be aware of

the trigger changing the index value. Thus, Microsoft Access would

lose track of that record until the next time the table was queried.

Since SQL Server triggers will not work and SQL Server does not have a

unique counter data type like Microsoft Access, you must use an Access

Basic function to control the counter value.

This is how it can be done. In a single column and single row

Microsoft Access table, store a single value that represents the next

highest counter value. You must store the table in Microsoft Access

since OpenTable does not work on an attached SQL Server table and

therefore, it can not be opened exclusively -- which is essential to

this process.

In the form that is used for data entry, apply a function to the

BeforeUpdate event so that this function opens the table that contains

the counter value (open it exclusively -- see OpenTable Method in the

Language Reference manual) grab the value to use for the current

record, add one to the value in the table, and then close the table.

Now, you will need to do some error checking when trying to open the

table exclusively because someone else might have it open at that

time. If this occurs, the program should loop around and retry

several times before alerting the user. ** It is imperative that each

user gets "exclusive" access to that table to insure no duplicate

values.

Once the value has been retrieved, set the ID of the current record

equal to that value and commit the record to the SQL Server database.

References:

For more information regarding and an example of creating a unique

custom counter, query on the following words in the Microsoft

Knowledge Base:

   table and counter and custom and unique

References


INF: How to get information into Microsoft Access using DDE

 Article Number: Q10016

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

Microsoft Access will not allow you to Poke data into a table through

a DDE Channel. However, using a function with parameters in a DDE

channel to the SQL Topic, you can get information passed to an Access

Basic function. The data can then be processed by the function and

added

to a table.

More Information:

The following example will show you how to add a new Customer to the

Customers table in NWIND.MDB, with information from Excel.

To pass data to Microsoft Access for processing, use the following

steps:

1. Create a table called "None", with one field in it. Any field type

   will do.

2. Open a module and create a function that has the parameters that

   you want to pass.

   For example:

   Function AddNewCust$ (CustomerID$, CompanyName$)

      Dim MyDB As Database, MyTable As Table

      Set MyDB = CurrentDB()

      Set MyTable = MyDB.OpenTable("Customers")  ' Open Table.

      MyTable.Index = "PrimaryKey"               ' Set index.

      MyTable.AddNew                             ' Prepare new record.

      MyTable("Customer ID") = CustomerID$       ' Set record key.

      MyTable("Company Name") = CompanyName$     ' Set company name.

      MyTable.Update                             ' Save changes.

      MyTable.Close                              ' Close Table.

   End Function

3. In another application initiate to MSACCESS with a query that

   refers to the table called "None" and selects the function that

   you created. For example in Excel the following macro is

   appropriate:

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in the Excel Macro.

   AddNewCustomer

   chan=INITIATE("MSACCESS","NWIND.MDB;SQL SELECT_

        AddNewCust$(""JOHNJ"",""John's Place"") FROM None; ")

   =TERMINATE(chan)

   =RETURN()

When you run this command macro the parameters will be passed to

Microsoft Access and the function will update the Customer table

while you are initiating to the table called "None".

References: "Microsoft Access Language Reference, version 1.0"

pages 118-124. "README.TXT from Access 1.0"

References


PRACC9305: GPF When Erase of a String Array in User Type

 Article Number: Q10016

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

You receive the following error message:

   An error has occurred in your application. If you choose

   Ignore, you should save your work in a new file. If you choose

   Close, your application will terminate.

CAUSE

You are trying to perform the Erase statement on a string array

that is defined in a user defined data structure.

RESOLUTION

You will need to use a loop construct to initialize the string

array in the structure.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0 and 1.1. Microsoft is researching this problem and will

post new information here as it becomes available.

MORE INFORMATION

================

Steps to Reproduce Problem

--------------------------

The following code will generate the error message described above.

   Type Foo

      X(1) As String

   End Type

   Sub Main ()

      Dim Arrays As Foo

      Erase Arrays.X

   End Sub

To work around this problem, use the following loop construct instead

of the Erase statement:

   Sub Main ()

      Dim Arrays As Foo

      For i = 1 To UBound(Arrays.X)

         Arrays.X(i) = ""

      Next i

   End Sub

References


INF: How NWIND.MDB Employee Field Photographs Were Created

 Article Number: Q10016

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

Below is a synopsis of how the photos for the Photo field of the

Employees table in the Northwind Traders sample database (NWIND.MDB)

were prepared and processed.

More Information:

1. Photographs were taken of the subjects with a camera and developed

   as prints.

2. The prints were scanned on a color scanner connected to an

   Apple Macintosh.

3. The resulting files from the Macintosh (in .TIFF file format) were

   transferred to a PC (to .BMP file format).

4. The images were converted from 256-color to 16-color (dithered) so

   that pictures would display correctly in 16-color mode, and also

   because 16-color images display faster than 256-color images.

5. The images were then added as embedded objects in the Employees

   table of the Northwind Traders database, following the

   instructions given in the "Microsoft Access User's Guide," Ch. 13,

   "Using Pictures, Graphs, and Other Objects," pages 314-339.

Note: If you plan on using this process yourself, steps can be

eliminated if you use a scanner directly connected to a PC, since the

image transfer from the Macintosh (step #3) would not be necessary and

step #4 can often be handled by the scanner software.

Software helpful for processing graphic images:

Apple Macintosh

---------------

Adobe "Photoshop"

PC / PC Compatibles

-------------------

"PaintShop" (Shareware - can be used for image file conversions.)

"WinGif"    (Shareware - can be used for image file conversions.)

Microsoft "Paintbrush" (Great for touching up stray pixels.)

References: "Microsoft Access User's Guide," Ch. 13,

   "Using Pictures, Graphs, and Other Objects," pages 314-339.

References


INF: Disk image of Companion Disk

 Article Number: Q10017

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This is the disk image of the Companion Disk that was sent out to all

registered Microsoft Access v1.0 users at the release of Microsoft

Access

Version 1.1.

More Information:

COMPRESS   EXE   25563    03-02-90   1:13p

INSTALL    BAT   4677     05-11-93   7:48a

MSCMS      MD$   622969   05-10-93   6:34p

MSDIRECT   MD$   141957   05-10-93   1:47p

MSFORMS    MD$   108739   05-11-93   7:22a

MSSWEETS   MD$   186343   05-10-93   1:51p

YNC        EXE   13023    03-15-91   2:42p

        7 file(s)    1103271 bytes

This disk can also be obtain from CompuServe in the MSACCESS Access

forum

Library 14, file name COMPAN.ZIP.

Note this disk only went out on 1.44M 3.5in disks however it may be

downloaded and fit on a 1.2M 5.25in disk.

References:

References


INF: Install Process of the Companion Disk

 Article Number: Q10017

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article shows the entire install process (defaults only) of the

Microsoft Access Companion Disk setup process.

More Information:

B:\>install

**********************************************************************

*                                                                    *

*                   Microsoft Access Companion Disk                  *

*               Copyright (c) Microsoft Corporation 1993             *

*                      May 10, 1993 - Edition 1.0                    *

*                                                                    *

**********************************************************************

*                                                                    *

*  This batch program installs the companion disk to your C:\ACCESS  *

*  directory by default. If you wish to override this default        *

*  installation path, enter a new installation path on the command   *

*  line as shown below.                                              *

*                                                                    *

*  REQUIREMENTS:  3.8 MB of free hard disk space                     *

*                                                                    *

*  USAGE:  INSTALL [drive]:\[path]                                   *

*                                                                    *

*     Where [drive] is the drive letter and [path] is the directory  *

*     into which the files will be installed.                        *

*                                                                    *

*  Example:  INSTALL C:\ACCESS                                       *

*                                                                    *

**********************************************************************

.

Install into default directory (Yes/No/Cancel)? [ync]y

.

creating c:\access

.

Decompressing Sample Applications...

.

msforms.mdb (file 1 of 4)

mssweets.mdb (file 2 of 4)

mscms.mdb (file 3 of 4)

msdirect.mdb (file 4 of 4)

.

**********************************************************************

*                                                                    *

*                       INSTALLATION COMPLETE                        *

*                                                                    *

* Please load Microsoft Access to view your sample database files.   *

*                                                                    *

*         MSFORMS.MDB .... sample data entry forms                   *

*         MSSWEETS.MDB ... sample database for small businesses      *

*         MSCMS.MDB ...... sample Contact Management application     *

*         MSDIRECT.MDB ... directory of Access products & services   *

*                                                                    *

* The sample databases contained on this 'companion disk' have been  *

* provided purely as an aid to help users learn more about Microsoft *

* Access and are therefore provided 'as is'. Microsoft is unable to  *

* provide support for these samples due to the nature of their design.

*                                                                    *

**********************************************************************

B:\>

Note due to the restrictions of the KB width some spaces were removed

in the psuedo diolog boxes and thus the one missing astrisk because

of the last line being so long.

References


PRB: GPF Using v1.01 Diamond Viper VESA Local Bus Video Driver

 Article Number: Q10017

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

When using version 1.01 of the Diamond Viper VESA Local Bus video

driver for Windows 3.1 (from Diamond Computer Systems,) you receive a

General Protection Fault (GPF) when you attempt to run Microsoft

Access. This GPF occurs immediately after attempting to open a

database.

CAUSE

This is caused by a fault in the Diamond Viper VESA Local Bus video

driver for Windows 3.1.

RESOLUTION

According to Diamond Computer Systems, version 1.02 fixes the problem.

Version 1.02 is available directly through Diamond Computer Systems

phone support or can be downloaded with a modem through their Bulletin

Board Service (BBS) at (408) 730-1100. The name of the version 1.02

video driver to download is VPR102.EXE.

References


PRB: Unexpected Error from External Database Driver [20]

 Article Number: Q10017

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

When you try to import, export or attach to a Btrieve table using the

Network Loadable Module (NLM) version of Btrieve, you receive the

following error;

   Unexpected error from external database driver [20]

CAUSE

This error message is actually a Novell error message that is returned

when you try to access Btrieve data with Microsoft Access and the

BREQUEST.EXE program was not executed prior to loading Windows. The

Xtrieve manual lists this error with the following description:

   20  Record Manager inactive

       You made a request before starting the Record Manager. Restart

       the Record Manager."

RESOLUTION

Create a batch file to execute the BREQUEST.EXE program before

starting Windows.

MORE INFORMATION

================

Refer to the Novell Xtrieve manual, Appendix A for a complete list of

error messages and status codes.

References


INF: How to Simulate Changing the Record Source of a Form

 Article Number: Q10017

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

Although you can't change the actual RecordSource property of a form,

you can use the Macro Action Apply Filter to simulate the effect.

More Information:

The following steps demonstrate the method to simulate changing the

record source.

1. Open NWIND.MDB and make a copy of the Employees Table and save the

   copy as Employees2. Delete 5 records from the Employees2 Table.

2. Create a Macro that has the following action and save it as

   Employees2 Macro.

      Employees2 Macro Action

      ------------------------

         ApplyFilter

            Filter Name: Select * from Employees2;

            Where Condition:

4. Open the Employees Form in Design View and add a command button to

   the Employees Form and set the OnPush property of the command

button

   to Employees2 Macro.

5. Open the form in Form view and go to the last record of the form.

   Note how many records are in Employees. Next, push the command

button

   and go to the last record of the form. Notice that there are now 5

   less records in the form.

If you apply this method to your own tables and the tables don't have

the same fields, you will need to set the visible property of the

invalid controls to no to prevent #Name? errors.

References:

Microsoft Access User's Guide, pages 375-382

References


PRACC9305: GPF When Allocating Huge Arrays

 Article Number: Q10017

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

SYMPTOMS

You receive the following error message:

   An error has occurred in your application. If you choose

   Ignore, you should save your work in a new file. If you choose

   Close, your application will terminate.

CAUSE

If you have allocated an array element, which includes a string or

variant data type, and the size of the array exceeds 64K, you may

receive the error message described above given the criteria

described below.

To generate this error, the following criteria must be met:

   1. Must be a huge array which spans two or more data segments.

   2. Each array element must contain at least one dynamic string

      or variant.

   3. The number and size of array elements must cause the last

      segment worth of data to be exactly the same size as the

      first segment worth of data.

RESOLUTION

Dimension the array so the last data segment contains a

different amount of elements than the first data segment.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0 and 1.1. Microsoft is researching this problem and will

post new information here as it becomes available.

MORE INFORMATION

================

Access Basic has the ability to define huge arrays which are larger

than the normal data segment of 64K. Any element or index of a huge

array may not extend across the 64K segment boundary. If all elements

of the array cannot be allocated within the 64K segment, then only the

elements of the array that will fit evenly in the segment are

allocated. Microsoft Access will then allocate another 64K segment to

the array and continue to fill the new segment with the rest of the

elements.

If the size of the data type defined in the array is a power of 2,

then the 64K segment will be completely filled. In the instance when

the data type is not a power of two, there will be wasted space in the

segment since Microsoft Access cannot place only a portion of one

element in the segment and continue with the rest of that element in

the next segment. An example:

   Type Foo

      A(3000) As double

      d As String

   End Type

The size of this structure is 24012 bytes (3000 * 8bytes/Double +

12bytes/String). If you dimension this array as Array with 3

elements, you will two data segments such as:

   Data Segment  1#      Data Segment  2#

   -----------------     -----------------

   Free Space 17512      Free Space 41524

   Array(1)   24012      Array(3)   24012

   Array(2)   24012

Note that if the size of an array is a power of two, then you will be

able to fill the entire data segment and have no wasted free space.

An example of this is where an array size of 4096 bytes will fill the

data segment with 16 elements evenly.

With Microsoft Access you can create a GPF if the amount of elements

in the first segment is equal to the amount of elements in the last

segment, and the data structure used to define the array is made up of

either a string or variant data type. An example of this would be if

we defined the data structure above with an amount of elements of 4,

or 6, or 8, etc. With 6 elements, our memory map would look like:

   Data Segment  1#      Data Segment  2#        Data Segment  3#

   -----------------     -----------------       -----------------

   Free Space 17512      Free Space 17512        Free Space 17512

   Array(1)   24012      Array(3)   24012        Array(5)   24012

   Array(2)   24012      Array(4)   24012        Array(6)   24012

And the actual dimension statement would look like:

   Function Sample()

      Redim Array(6) As Foo

   End Function

To work around this problem, dimension the array so that the last data

segment does not contain the same amount of elements as the first data

segments. As an addition to the example above, you would most likely

choose to define the array with seven elements instead of six

elements. This would cause Microsoft Access to allocate 4 data

segments where the first data segment would have 2 elements of the

array, and the last data segment would only have one element of the

data structure.

Also note that this is very easy to duplicate with large data

structures, but is less likely to be duplicated with smaller data

structures. With our element size of 24012 bytes, element sizes of 4,

6, 8 etc. would cause the problem. With a data size of 1K though, the

amount of elements that will duplicate this problem are 128, 192, 256

etc.

References


INF: Upper limit on QueryTimeout and LoginTimeout

 Article Number: Q10017

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

This article describes  the maximum limit allowed for the

QueryTimeout and LoginTimeout parameters.

More Information:

These are two settings in the [odbc] section of the MSACCESS.INI as

they are described in the Access 1.1 README.TXT.

Entry               Value   Effect

------------        -----   ------

QueryTimeout         S      Wait S seconds for queries sent to

                            ODBC, and then stop trying to process

                            the query results (for asynchronous

                            queries only). (Default: 60 seconds).

LoginTimeout         S      Wait S seconds for ODBC login response,

                            and then stop trying to connect to a

                            server. (Default: 20 seconds).

The README.TXT fails to state the limit at which these values can be

set.

Since the values for QueryTimeout and LoginTimeout are unsigned 4-byte

values (long integer), the maximum value is +/- 2,147,483,648. If the

value is set to zero (0), then the timeout is disabled and the

query/login will never timeout.

References:

References


INF: Importing, Exporting, and Attaching FoxPro Data

 Article Number: Q10017

 CREATED: 16-JUN-1993

 MODIFIED: 16-JUN-1993

Summary:

In Microsoft Access version 1.1 you can now import, export, and attach

to FoxPro 2.0 and 2.5 data.

More Information:

If you select either Import or Attach Table from the File menu, FoxPro

2.0 and FoxPro 2.5 now appear as choices in the Data Source window.

When you attach to a FoxPro file you can also associate the

appropriate FoxPro index (.IDX or .CDX) file. The import, export, and

attach procedure is the same as it is with Dbase, or Paradox file

types.

References:

"Microsoft Access Users Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 60-65.

References


INF: Adding a New Record to a Combo Box with a Double-Click

 Article Number: Q88148

 CREATED: 18-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes how to set up a macro that will allow users to

add a new value to a combo box. The steps to add this functionality to

the Order form in the NWIND database are also explained.

More Information:

To generate an example, do the following:

1. Open NWIND, the sample database included with Access.

2. Create a new macro called Macro1.

   Below is an example of how Macro1 should look, and below is an

   explanation of each action:

   Macro Name  Condition                    Action

   -----------------------------------------------

   NewRecord                                OpenForm

   OnClose     [Employee ID] Is Not Null    DoMenuItem

               ...                          SelectObject

               ...                          ReQuery

               ...                          SetValue

   NewRecord Actions

   -----------------

   OpenForm:  Opens the employees form to add a new employee.

      Form Name: Employees

      View: Form

      Data Mode: Add

      Window Mode: Normal

   OnClose Actions

   ---------------

   DoMenuItem:  Saves the record entered into the employees form and

                prevents errors if no record is entered.

      Menu Bar:  Form

      Menu Name: File

      Command: Save Record

   SelectObject:  Selects the open Orders form

      Object Type: Form

      Object Name: Orders

      In Database Window:   No

   ReQuery:  Requery the combo box in the Orders form.

      ControlName: Employee ID

   SetValue:  Takes the value from the newly entered Employee ID in

              the Employees form and puts it in the Employee ID in the

              Orders form.

      Item: Forms!Orders![Employee ID]

      Expression: Forms!Employees![Employee ID]

3. Modify the Orders form [Employee ID] combo box property by changing

   the following properties:

      On Double Click: Macro1.NewRecord

      Status Bar Text: Double-click to Add a New Employee

4. Modify the Employees form by changing the Form property:

      On Close: Macro1.OnClose

To see how this process works, open the Orders form in browse mode,

then double-click on the Employee ID combo box; the Employees form

will open. After filling in the pertinent data, close the form. When

the form is closed, the newly entered data will be transferred to the

Orders form.

References


INF: 'Continued...' Header for Groups on More than One Page

 Article Number: Q88156

 CREATED: 18-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes how to create a label that will print at the

top of each report page when a group of data spans more than one page.

The events used capture the value of the group in the page footer, and

if this value is the same as the page header value on the next page,

the label containing "Continued from previous page..." is displayed.

More Information:

Below is a step-by-step example of how to create this report by

modifying the sample database NWIND report "List of Products by

Category."

Open NWIND, the sample database that is included with Microsoft

Access.

 1. From the File menu, choose Module to create a new module.

 2. Enter the following global declaration and functions into the

    module:

      '-----------------------------------------------

      'Global Declarations

      '-----------------------------------------------

      Global CurrentGroupVal as String

      '-----------------------------------------------

      'Code Section

      '-----------------------------------------------

      Function SetGlobalVar (InReport as Report)

         CurrentGroupVal = InReport!SetGroupVal

      End Function

      Function SetContinuedLabel (InReport as Report)

         'Note: The following three lines are placed on one line:

             InReport!ContinuedLabel.Visible =

                 IIf(Trim(InReport!CheckGroupVal =

                    Trim(CurrentGroupVal)), True, False)

      End Function

 3. In the Database window, choose the Report button to open the

    "List of Products by Category" report. Select "List of Products by

    Category," then choose the Design button.

 4. Increase the height of the Details sections to approximately 1

    inch. This will make more than one category split between two

    pages so that "Continued from previous page..." will be displayed.

 5. From the View menu, choose Toolbox so that the toolbox is

    displayed.

 6. Using the toolbox, create a label in the page header section,

    below the existing field, with a caption that reads

    "Continued from previous page...". Change the Control Name

    property to "ContinuedLabel". Set the Visible property to "No".

    You will have to increase the height of the page header to

    accommodate the label. For additional help on the toolbox and

    labels, search the online Help file for "toolbox" and "label."

 7. From the View menu, choose Field List to display the field list.

 8. Create a hidden text box bound to the group field [Category Name].

    Place this text box in the page header section, and change the

    Control Name property to "CheckGroupVal." For additional help

    binding controls on a form, search the online Help for "Controls:

    Adding" and select "Binding a control to a field."

 9. From the View menu, choose Properties to display the property

    sheet.

10. Click on any portion of the page header not covered by a control

    to display the page header properties in the property sheet.

11. Set one of the following properties of the page header:

       OnFormat:   =SetContinuedLabel(Report)

    -or-

       OnPrint:    =SetContinuedLabel(Report)

12. Create a hidden text box bound to the group field [Category Name]

    in the page footer section, and change the control name property

    to SetGroupVal.

13. Click on any portion of the page footer not covered by a control

    to display the page footer properties in the property sheet.

14. Set one of the following properties of the page footer:

       OnFormat:   =SetGlobalVar(Report)

               -or-

       OnPrint:    =SetGlobalVar(Report)

15. From the File menu, choose Print Preview. The report "List of

    Products by Category" will have a "Continued from previous

    page..." message at the top of the pages where the category

    details span more than one page.

References


INF: How to Programmatically Create a Table

 Article Number: Q88157

 CREATED: 18-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

There is no inherent command in Access to programmatically create a

table. However, the following is a procedure that needs only a special

template table to programmatically create any kind of table you want.

This article discusses a user-defined function for Access Basic that

you can use to accomplish this task. This user-defined function also

requires a "template table" that the user can create. The template

table is discussed further below.

This information applies to Microsoft Access 1.0.

More Information:

Before you create the function, you must create a template table. You

must use a template table to define your own data types. For example,

you may want to create a data type called "Long Text" that is a text

field with a 255-character length. In order to represent this in the

template table structure, "Long Text" is defined as a text column with

a length of 255.

For example, in the template table below, the user has created a data

type called "Long Text," which is a 255-character Text field. The user

has also created a "Short Text," "Long Int," and so on.

Table Name: MyTemplate

----------------------

Field Name     Field Type     Length

------------------------------------

Long Text      Text           255

Short Text     Text           50

Long Int       Number         Long Integer

Integer        Number         Integer

Memo           Memo           N/A

Date/Time      Date/Time      N/A

OLE Object     OLE Object     N/A

This template can be used as a generic template for using the

CreateTable procedure. Once you have defined your data types in a

template table, you can use the CreateTable procedure in the following

manner:

Definition

----------

CreateTable <target table>, <template table>, <structure definition>

Where:

<target table> is the name of the table to create and MUST NOT exist

in the database. You may want to code a routine to check for the

existence of such a table before invoking this procedure.

<template table> contains the user-defined data types that will be

used in creating the target table.

<structure definition> defines the structure of the columns in the

table.

Where:

<structure definition> = "<field name> As <user-defined data

type>,..."

Note: There are quotation marks around the entire <structure

definition> parameter.

Below is an example of how you would invoke the CreateTable procedure

to create a table based on the template table discussed earlier:

CreateTable "NewTable",

            "MyTemplate",

            "First Name As Short Text,

             Last Name As Short Text,

             Description As Long Text,

             Amount As Integer,

             Notes As Memo"

How CreateTable Works

---------------------

As mentioned earlier, there is no Access Basic command or function to

create a table. Fortunately, Access supports the SQL SELECT INTO

command that can be used to create a table. However, SELECT INTO

requires a table for its FROM clause, which explains why you need to

have a template table.

CreateTable simply parses out the structure definition, then builds a

SELECT INTO statement based on that definition. Once the SQL statement

is built, the QueryDef object is employed to invoke the command,

resulting in a new table.

Procedure Listing

-----------------

Note: Some lines below have an underscore (_) to denote line breaks.

These commands should be placed on one line.

Sub CreateTable (TargetTbl As String, TemplateTbl As String,

   StructureDef As String)

   Dim LineChunk As String, SelectStmt As String, TempChunk As String

   Dim CharPos As Integer, HomePos As Integer, BuildLoop As Integer

   Dim CrtTblDB As Database, CrtTblQry As QueryDef

   BuildLoop = True

   HomePos = 1

   SelectStmt = "Select "

   Do While BuildLoop

      If InStr(HomePos, StructureDef, ",") <> 0 Then

         LineChunk = Trim(Mid$(StructureDef, HomePos, (InStr(HomePos,_

                     StructureDef, ",") - HomePos)))

      Else

         LineChunk = Trim(Mid$(StructureDef, HomePos))

         BuildLoop = False

      End If

      TempChunk = Trim$(Mid$(LineChunk, InStr(UCase$(LineChunk),_

                  " AS ") + 3))

      SelectStmt = SelectStmt & "[" & Trim(Mid$(TempChunk, 1))_

                   & "]" & " As [" & Trim(Mid$(LineChunk, 1, _

                   InStr(UCase$(LineChunk), " AS "))) & "],"

      HomePos = InStr(HomePos, StructureDef, ",") + 1

   Loop

   SelectStmt = Left$(Trim(SelectStmt), Len(Trim(SelectStmt)) - 1) & "_

                Into [" & TargetTbl & "] From [" & TemplateTbl & "];"

   Set CrtTblDB = CurrentDB()

   Set CrtTblQry = CrtTblDB.CreateQueryDef("TempQuery", SelectStmt)

   CrtTblQry.Execute

   CrtTblQry.Close

   CrtTblDB.DeleteQueryDef ("TempQuery")

End Sub

References


INF: How to Create a Multiuser Custom Counter

 Article Number: Q88159

 CREATED: 18-AUG-1992

 MODIFIED: 23-APR-1993

Summary:

Microsoft Access allows you to define a field in a table as a counter.

When defined as a counter, Microsoft Access manages the unique

numbering of fields in the table. If you add a record, Access gives

this counter field the next unique value available. As a user, you

have no control over this value.

There may be times when you need unique counters that are not

immediately sequential in nature. Examples are counters that

decrement, or counters that step according to some formula (such as in

steps of 10).

This article describes how to implement a custom counter field with

Access Basic commands. This will give you more flexibility over the

assignment of the actual value you use in this field.

More Information:

To following steps outline in general how to create a custom counter.

Further below is a more detailed description on how to create a custom

counter.

1. Create a separate table that will maintain the next available

   custom counter. This table will have one field and one record, with

   the value of the next available counter in this one record.

2. From within Access Basic, open this counter table and retrieve the

   value stored there.

3. Increment the value retrieved and store the number back into the

   database.

4. Close the table and use the value in the appropriate table as the

   next available counter.

In a single user environment, the steps described above can be done

with macro actions. In a multiuser environment, Access Basic is needed

to handle the event where this counter table is locked. Macro actions

do not provide the locking control needed in the multiuser

environment.

Example

-------

The following example describes how to create a custom counter field

with positive number values divisible by 10 (that is, 10, 20, 30, and

so on) in sequential order.

The Table

---------

 1. From the File menu, choose New, then select Table.

 2. Add a field to the table called "Next Available Counter." Set the

    data type of "Next Available Counter" to number.

 3. From the Edit menu, choose Primary Key to make "Next Available

    Counter" the primary key.

 4. From the View menu, choose Datasheet View.

 5. A dialog box will prompt you to save the table. Save it as

    "Counter Table."

 6. Once in Datasheet view, enter a value of 10 into the "Next

    Available Counter" field.

 7. From the File menu, choose Close to close the table.

The Module

----------

 8. From the File menu, choose New, then select Module to create a new

    module.

 9. Add the following function to the module:

    Function Next_Custom_Counter ()

       Const TABLE_LOCKED = 3000

       On Error GoTo Next_Custom_Counter_Err

       Dim MyDB As Database

       Dim MyTable As Table

       Dim NextCounter As Integer

       '==============================================================

       'Open table and get the next available number, increment value

       'by 10 and save the number back into the table.

       '==============================================================

       Set MyDB = CurrentDB()

       Set MyTable = MyDB.OpenTable("Counter Table")

       MyTable.Edit

       NextCounter = MyTable("Next Available Counter")

       '==============================================================

       'The next line can be changed to conform to your custom counter

       'preferences. This example only increments the value by +10

       'each time.

       '==============================================================

       MyTable("Next Available Counter") = NextCounter + 10

       MyTable.Update

       MsgBox "Next available counter value is " & Str$(NextCounter)

       Next_Custom_Counter = NextCounter

       Exit Function

       Next_Custom_Counter_Err:

          If Err = TABLE_LOCKED Then Resume

          MsgBox "An unexpected error has occurred:" & Err

       End

    End Function

10. From the File menu, choose Save. Save the module as "Custom

    Counter Demo."

The Form

--------

11. From the File menu, choose New, then select Form. Choose the Blank

    Form button to start with a blank form.

12. Add a command button to the form from the toolbox. If the toolbox

    is not displayed, from the View menu, choose Toolbox.

13. If the Properties window is not displayed, choose Properties from

    the View menu.

14. Select the command button with the mouse so that the Properties

    window displays "Command Button" on the title bar.

15. Set the OnPush property to =Next_Custom_Counter().

16. Save the form as "Custom Counter Demo" by selecting the Save As

    command from the File menu.

Execution

---------

17. From the View menu, choose Form view to move to Form view. Click

    on the command button; a message box will display the value of the

    next counter.

References


INF: How to Hide the Database Window at Startup

 Article Number: Q88160

 CREATED: 18-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

During normal startup of Microsoft Access, the Access Database window

is visible. If you do not want to give a user access to the Database

window, you can create an AUTOEXEC macro that will hide the Database

window from the user. This article describes how to create a macro to

do this.

More Information:

The ability to access the Database window allows the user to modify

database objects, which could lead to corruption of the database and

database objects. Limiting the user to specific forms and windows can

minimize the potential loss of objects and data.

When an Access database is first loaded into the environment, Access

checks for an AUTOEXEC macro and runs it if it exists. The following

macro will hide the Database window from the user:

1. From the File menu, choose New to create a new database. Give the

   database a unique name.

2. From the File menu, choose New to create a new macro.

3. Add the following actions:

   Action              Comment

   ----------------------------------------------------------------

   SelectObject        Select a macro in the Database window so the

                       focus is set to the Database window.

   DoMenuItem          Hide the object that has the current focus.

4. Set the following properties for the actions entered above:

   SelectObject Action

   -------------------

   Object Type: Macro

   Object Name: Autoexec

   In Database Window: Yes

   DoMenuItem Action

   -----------------

   Menu Bar: Form

   Menu Name: Window

   Command: Hide

5. From the File menu, choose Save As, and save the macro as

   "Autoexec."

The macro will hide the Database window from the user; however, menu

options still exist to show the Database window. To hide these options

from the user, you can create a custom menu for your application, or

disable the Show command on the File menu. For more information about

using Windows application programming interface (API) function calls

to disable menu commands, query on the following words in the

Microsoft Knowledge Base:

   GetMenu and GetSubMenu

References


INF: Importing the Named Range 'Database' from Excel

 Article Number: Q88161

 CREATED: 19-AUG-1992

 MODIFIED: 29-APR-1993

Summary:

When trying to import the named range "Database" from Microsoft Excel

versions 3.x and 4.x files, the following error appears:

   Invalid Range.

More Information:

There are three recommended workarounds that enable you to import data

successfully from Microsoft Excel.

 - Save the Excel file in 2.x format (in the File Save As dialog)

   before importing the file into Microsoft Access.

 - Give the range "Database" a second name (such as "My_Database_Range").

   Microsoft Excel allows users to assign multiple names to the same

   range.

 - Use the range specification rather than a named range (for example,

   A1:D50).

This error is caused by the difference in the Excel BIFF (binary

information file format) structures between versions. BIFF2 has the

range listed in its internally defined named range table, which

Microsoft Access can read. BIFF3 and BIFF4 use an internal construct

rather than listing "Database" in the internal named range table.

Microsoft Access cannot read the internal construct of BIFF3 and

BIFF4.

References


INF: Introduction to Windows Programming for MS-DOS Programmer

 Article Number: Q88164

 CREATED: 19-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article discusses some differences between programming in the

MS-DOS environment and programming in the event-driven Windows

environment.

More Information:

For the purposes of this discussion, consider the use of the term

"traditional programmer" as someone who has not programmed in Windows,

but has experience programming in an MS-DOS environment.

As a traditional programmer, you may not only have become comfortable

with a particular programming style, but also with certain accepted

fundamentals, such as writing an instruction and expecting it to be

carried out in a controlled order. Access Basic makes good use of

Windows, making it easy to learn to program.

"One Entry, One Exit" vs. Event-Driven Programming

--------------------------------------------------

Consider the following pseudocode of a program designed to get user

input, count all the records in a table, and display the result in a

box if the user presses 1, or exit if the user presses 2.

START PROGRAM

LOOP WHILE TRUE

   GET KEYPRESS INTO X

   IF X IS "1"

      COUNT ALL RECORDS IN THE TABLE INTO Y

      DRAW BOX FROM ROW 10 COLUMN 5 TO ROW 12 COLUMN 7

      DISPLAY Y AT ROW 11 COLUMN 6

   IF X IS "2"

      EXIT LOOP

END LOOP

STOP PROGRAM

The purpose of this program is to continuously loop until a key

press of a 1 or 2 is detected. At that point, a decision is made to

perform some sort of operation, or to ignore the keypress and continue

looping. The programmer has full control over what happens.

The Windows programming model is event-driven and graphic object

oriented. In other words, programming in Windows involves creating

objects and modifying aspects (or properties) of those objects based

on different events. Consider the following sample program that

presents two buttons to the user. If the user chooses the Count

button, the program counts the records in the database and displays

the result in a window. The user can press the Exit button to exit

from the program.

First, you create the necessary objects. Most of this phase of Access

Basic programming is created graphically with the Access Forms

designer. The list of controls and properties below defines a form

that will be used to illustrate this.

Form: "MasterForm"

------------------

Push Button: "CountButton"

    Caption: "Count"

     OnPush: "=DisplayCount()"

Push Button: "ExitButton"

    Caption: "Exit"

    Caption: "=CloseProgram()"

Text Box: "DisplayWindow"

Note: OnPush is a property of command buttons that gives you the

ability to invoke an Access Basic procedure or macro.

You can then create the modules that the objects will invoke. In this

case, buttons are the only objects that will have the ability to

invoke procedures. The procedures shown below are pseudo-code

examples.  The first procedure defined is the DisplayCount procedure:

PROCEDURE DisplayCount()

   COUNT ALL THE RECORDS IN THE TABLE INTO Y

   CHANGE THE DISPLAYWINDOW TEXT PROPERTY TO Y

END PROCEDURE

Notice that the code did not direct the resulting count to display in

a box painted on the screen. Instead, the Text property of

DisplayWindow was changed to the resulting count value. The next

procedure defined is the CloseProgram procedure.

PROCEDURE CloseProgram

   CLOSE MASTERFORM

END PROCEDURE

Notice that this procedure does not provide an exit from some kind of

loop or other program structure. Instead, it closes the object that

contains the buttons and window.

At this point, you have a master form object containing two buttons, a

window, and a couple of coded procedures. They are in no special

order, they simply exist as part of the form. So, where is the loop

that checks for button activity? Where is the command to invoke the

program?

The answer is that these do not exist as you might expect them to.

You "run" the program by opening MasterForm. When you open the form,

all the control objects (that is, the buttons and so on) exist on

the form waiting for something to happen. In this example, there is no

flow of control (no looping to check activity).

While the form is active, Windows constantly checks for events. When

an event occurs, the user's input is put in a queue and "waits in

line" until it is processed. For example, when you push the "Count"

button, Windows detects that the button object you placed on the form

has been affected.  Windows sends a "Mouse Click" message to Access.

Access then translates the message and determines that the

DisplayCount() function should be called based on the "On Push" field

of the command button.

Advantages

----------

The traditional programmer will find this new approach to programming

a bit challenging. There are a few things to learn and "unlearn," but

there are many advantages.

Windows Interface

-----------------

The Windows interface is one that has been regarded throughout the

industry as being very user-friendly. Familiar objects such as push

buttons, radio buttons, list boxes, and a wide variety of colors and

screen fonts are generally more appealing than standard ASCII text

characters.

The Windows Standard

--------------------

Because Access Basic forces you to some extent into the Windows

standard, others who are familiar with Windows applications can

immediately recognize the "look and feel" of your application. This

reduces the learning time because the user does not have to learn

entirely new interface controls and prompts.

Advantages Offered by the Windows Environment

---------------------------------------------

You do not have to worry too much about different devices such as

monitors, printer drivers, and so on. The Windows operating

environment takes care of most device compatibility and user

preference issues. In addition, because Windows handles and processes

events, you will find it much easier to create and manage many aspects

of an application.

References


INF: Like vs. '=' with Wildcard Characters in Query Searches

 Article Number: Q88166

 CREATED: 19-AUG-1992

 MODIFIED: 29-APR-1993

Summary:

When searching a string using wildcards (for example, * or ?), you

must use Like or Not Like in the Criteria field rather then = or <>.

When you use the = (or the <>) operators, Access treats them as actual

characters to search for.

More Information:

If you have a table with one column called Col_Name and the following

four records

   Col_Name

   --------

   Foos

   Foosball

   Foos ball

   Foos*

and you make a query based on the table with the criteria

   ="Foos*"

your query will return:

   Foos*

If your criteria is:

   Like "Foos*"

your query will return the following four records:

    Foos

    Foosball

    Foos ball

    Foos*

The SQL statements built by Access for these queries are as follows.

The SQL statement using Like is:

   SELECT  DISTINCTROW tablename.Col_Name

   FROM [tablename]

   WHERE ((tablename.Col_Name Like "foos*"));

The SQL statement using = is:

   SELECT  DISTINCTROW tablename.Col_Name

   FROM [tablename]

   WHERE ((tablename.Col_Name="foos*"));

References


INF: How to Determine if a Specific Windows Program Is Running

 Article Number: Q88167

 CREATED: 19-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

There are times when you only want one instance of an application to

run within Windows. If you place a command button on a form that

starts the Windows Calculator (CALC.EXE) program, the user can start

many instances of Calculator. This is very inefficient on memory and

system resources. If your program determines if the application is

already running, it can either start the application for the first

time, or bring the existing application to the front.

To determine if a specific program is running, call the Windows API

function FindWindow. FindWindow returns the handle of the window whose

class is given by the lpClassName parameter and whose window name, or

caption, is given by the lpCaption parameter. If the returned value is

zero, the application is not running.

More Information:

When an application is started from the Program Manager, it registers

the class name of the form. The window class provides information

about the name, attributes, and resources required by your form. The

Access window has a class name of "OMain." For additional command

class names, see further below.

By calling FindWindow with a combination of a specific program's class

name and/or the title bar caption, your program can determine whether

that specific program is running.

You can determine the class name of an application by using SPY.EXE,

which is supplied with Microsoft Windows Software Development Kit

(SDK) version 3.1.

If the window has a caption bar title, you can also use the title to

locate the instance of the running application. This caption text is

valid even when the application is minimized to an icon.

The following example shows three ways to determine if the Windows 3.1

Calculator is running. To create the program, do the following:

 1. From the Program Manager File menu, choose Run, and enter CALC.EXE

    to start Calculator.

 2. From the File menu, choose New to create a new database.

 3. From the File menu, choose New, then select Form to create a new

    blank form.

 4. When the form is displayed, from the View menu, choose Toolbox.

 5. Select the command button tool on the Toolbar, then double-click

    on the form to place a command button on the form.

 6. From the View menu, choose Properties to display the Properties

    window. Set the following command button property:

       Property       Value

       --------------------

       On Push        =CalculatorUp()

 7. Close and save the form as "FindWindow Form."

 8. From within the Access database container, open a new module and

    enter the Microsoft Access Basic code listed below.

'=====================================================================

'Declarations section

'=====================================================================

Option Explicit

'NOTE: ENTER THE DECLARATION FUNCTION ON ONE LINE.

Declare Function FindWindow% Lib "user" (

                       ByVal lpClassName As Any,

                       ByVal lpCaption As Any)

'=====================================================================

'End of Declarations section

'=====================================================================

'=====================================================================

'Code section

'=====================================================================

Function CalculatorUp ()

   Const lpClassName = "SciCalc"

   Const lpCaption = "Calculator"

   'This demonstrates three different ways to call FindWindow:

      '1. The ClassName only.

      '2. The Caption only.

      '3. Both the ClassName and the Caption

   MsgBox "Calculator Handle = " & FindWindow(lpClassName, 0&)

   MsgBox "Calculator Handle = " & FindWindow(0&, lpCaption)

   MsgBox "Calculator Handle = " & FindWindow(lpClassName, lpCaption)

   'This function could return the existence of a window.

   CalculatorUp = FindWindow(lpClassName, 0&)

End Function

'=====================================================================

'End of code section

'=====================================================================

 9. Close and save the module as "FindWindow Code."

10. From within the database container, open FindWindow Form. Choose

    the FindWindow Form command button with CALC.EXE running and

    without CALC.EXE running. If CALC.EXE is running, your application

    will print an arbitrary handle. If CALC.EXE is not running, your

    application will print the number zero as a handle.

Below are some class names of common applications that are shipped

with Windows:

   Class Name         Application

   ------------------------------

   OMain              ACCESS.EXE

   SciCalc            CALC.EXE

   CalWndMain         CALENDAR.EXE

   Cardfile           CARDFILE.EXE

   Clipboard          CLIPBOARD.EXE

   Clock              CLOCK.EXE

   CtlPanelClass      CONTROL.EXE

   XLMain             EXCEL.EXE

   Session            MS-DOS.EXE

   Notepad            NOTE.EXE

   pbParent           PBRUSH.EXE

   Pif                PIFEDIT.EXE

   PrintManager       PRINTMAN.EXE

   Progman            PROGMAN.EXE   (Windows Program Manager)

   Recorder           RECORDER.EXE

   Reversi            REVERSI.EXE

   #32770             SETUP.EXE

   Solitaire          SOL.EXE

   Terminal           TERMINAL.EXE

   WFS_Frame          WINFILE.EXE

   MW_WINHELP         WINHELP.EXE

   #32770             WINVER.EXE

   OpusApp            WINWORD.EXE

   MSWRITE_MENU       WRITE.EXE

Reference(s):

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3," by Charles Petzold, Microsoft Press, 1990

"Peter Norton's Windows 3.0 Power Programming Techniques," by Peter

Norton and Paul Yao, Bantam Computer Books, 1990

"Microsoft Windows 3.0 Software Development Kit: Reference Volume 1"

WINSDK.HLP file shipped with Microsoft Windows 3.0 SDK

References


INF: Error Msg: Can't Hide the Control that Has Focus

 Article Number: Q88168

 CREATED: 19-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

If you change the Visible property of a control to False, and that

control has focus, you will receive the following error message:

   Can't hide the control that has focus

Although you can't trap this error message within a macro, you can

call Access Basic code that can trap this error and return the results

to a macro.

More Information:

Steps to Reproduce Behavior:

 1. From the File menu, choose New to create a new form.

 2. Using the Toolbox while in Design view, place a command button on

    the form.

 3. Set the following properties for the command button:

      Control name:  Controller

      Caption:       Turn Off

      On Push:       TurnOff

   Note: To display the command buttons properties, choose  Properties

   from the View menu. Once the Properties window is displayed, choose

   the command button with the mouse. The caption of the Properties

   window should be "Command Button" at this time.

 4. Close and save the form as "Turn Off Controller".

 5. Repeat steps 2-3 for the second form, but use the following

    properties for the new command button:

      Control name:  Subject

      Caption:       Subject

 6. Close and save the form as "Turn Off Controller Subject".

 7. From the File menu, choose New to create a new macro.

 8. From the View menu, choose Conditions to display the Condition

    field.

 9. Add the following actions to this macro:

    Condition        Action      Comment

    ------------------------------------

    TurnOff()<>2509  MsgBox      Successfully turned off

          ...        StopMacro   Note the ellipsis (...)

                     MsgBox      Message here

    MsgBox Action

    -------------

    Message: Successfully turned off

    StopMacro Action

    ----------------

    none to set

    MsgBox Action

    -------------

    Message: Message here

10. Close and save the macro. Save the macro as "Turn Off."

11. From the File menu, choose Module to create a new module.

12. Within the Code window of the module, add the following code:

    '-----------------------------------------------------

    'Global Section

    '-----------------------------------------------------

    Options Explicit

    '-----------------------------------------------------

    'Functions

    '-----------------------------------------------------

    Function TurnOff ()

       'If a control has focus, then this will trap error 2509

       On Error GoTo errhandler

       DoCmd SetValue Forms![Turn Off Subject]![Subject].Visible, False

       TurnOff = True

    Exit Function

    errhandler:

       If Err = 2509 Then

          TurnOff = 2509    'trap the "Has focus scenario"

       Else

          TurnOff = 0

       End If

    Exit Function

14. Close the module window and save as "Turn Off."

15. Open both the "Turn Off" and the "Turn Off Subject" forms.

16. With the mouse, choose the Controller button.

Because "Subject" has focus on the form within the scoping of the

form, this will error out and display the message box:

   Message here

References


INF: Incrementing the Number Portion of String

 Article Number: Q88169

 CREATED: 19-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes a formula that sets the default value of a

bound text field in a form to the next higher value of its numeric

portion.

The formula finds the highest used number in the table, strips the

leading text characters, adds one to the result, and then concatenates

the text characters back on.

More Information:

Note: This example assumes that the number of leading text characters

is known at the time the form is designed.

 1. Open an existing database, or create a new database from the File

    menu.

 2. From the File menu, choose New, then select Table to create a new

    table.

 3. Add a field called Book ID of type text. From the Edit menu,

    choose Set Primary Key to define the field as the primary key.

 4. Add a second field of any type to the table.

 5. From the File menu, choose Save As, and name the table

    "Increment."

 6. Switch the table to design view and enter the following values in

    three separate rows:

       Book ID       Second Field

       -------       ------------

       BO-110

       BO-111

       BO-112

 7. From the File menu, choose Close to close the table.

 8. From the File menu, choose New, and select Table to create a new

    blank form. Base the form on the Increment table.

 9. From the View menu, choose Field List to display the form's field

    list.

10. The Properties window should now display the form's properties.

    Change the following form property:

       Default View:   Single Form.

11. Drag both the field [Book ID] and [Second Field] from the Field

    List to the form.

12. From the View menu, choose Properties to display the [Book ID]

    properties. Click on the [Book ID] text box to display the [Book

    ID] properties in the Properties window.

13. Set the following property of this new bound text box as follows:

    Default Value:  ="BO-" & Right(DMax("[Book ID]","Increment"),

                           Len(DMax("[Book ID]","Increment"))-3)+1

    (Note: The formula above must all be on one line.)

14. From the View menu, choose Form to change the form to Browse view.

The formula does the following:

 - DMax("[Book ID]","Increment") get the highest value in the table.

 - Len(DMax(...)) finds the length of the value returned by DMax().

 - Right(DMax(...),Len(...)-3) strips the three text characters.

 - +1 increments the result of the Right() function.

 - "BO-" and concatenates the text "BO-" onto the incremented number.

Note: This works when the form is in Single view; it may not work

consistently in Continuous view. When you move to a new record and

begin to enter data, Access displays the next empty record. The

default values for the next empty record are calculated before the

record you are currently editing is committed. Because DMax()

calculates the maximum value from those stored in the table, the ID of

the record you are editing will be repeated.

If you are working in a multiuser environment, it is possible that

more than one user will receive the same calculated Book ID. Although

a user can change the ID by hand, you may want to track the highest

number portion in a separate table and use either a macro or Access

Basic code to maintain it. For more information about multiuser

counters, query on the following words in the Microsoft Knowledge

Base:

   multiuser and counter

References


INF: Determining the Existence of a Query in Access

 Article Number: Q88170

 CREATED: 19-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes how to determine the existence of a query with

Access Basic code.

More Information:

Access does not have an intrinsic function to determine the existence

of a specific query. Using Access Basic code, you can easily determine

if a query exists in the database.

Example

-------

To create a function that will return the existence of a query,

do the following:

1. Within the NWIND.MDB database, create a new module by choosing New

   from the File menu, and then select Module from the list.

2. Enter the following function into the Code window:

   Function QueryExists%(QueryName as String)

      On Error GoTo ItExists

      Dim MyDb as Database

      Dim MyQry as QueryDef

      Set MyDb = CurrentDB()

      '----------------------------------------------------------

      'If there is a query by this name, an error will occur

      'on the MyDb.CreateQueryDef method when you try to create the

      'existing query. Code execution will transfer to the ItExists

      'label if this is the case.

      '----------------------------------------------------------

      Set MyQry = MyDb.CreateQueryDef(QueryName)

      '----------------------------------------------------------

      'If the query was create, we need to clean up by deleting the

      'newly create query. You may elect to have this function

      'create the query. If this is the case, delete the

      'My.DeleteQueryDef line from this function.

      '----------------------------------------------------------

      MyDB.DeleteQueryDef(QueryName)

      QueryExists = False

      Exit Function

   ItExists:

      '----------------------------------------------------------

      'The query exists. Return True and exit from the function.

      '----------------------------------------------------------

      QueryExists = True

      Exit Function

   End Function

3. From the View menu, choose Immediate Window. Enter the following

   command, then press ENTER:

      ?QueryExists("Catalog")

4. "-1" should be printed in the Immediate window (-1 in Access

   represents True).

5. Experiment by calling the function with a nonexistent query. This

   should print "0" (which represents False).

References


INF: Using APIs to Make a Modal Microsoft Access Program

 Article Number: Q88171

 CREATED: 19-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

In Microsoft Access Basic, you can make an application modal so that

users cannot switch to other Windows-based programs while the

Microsoft Access application is active. This functionality is achieved

by calling the Windows API functions SetSysModalWindow and FindWindow.

This article discusses the API functions used to make Microsoft Access

a system-modal window. A sample function is described that displays

how the Windows API functions are used to make Microsoft Access

system-modal.

For more detailed information on Windows API calls, query on the

following words in the Microsoft Knowledge Base:

   handle and API and DLL and kernel and user and GDI

Also query the Knowledge Base on the following word:

   findwindow

More Information:

Microsoft Windows is designed so that users can switch between

applications without terminating one program to run another program.

However, there may be times when a Microsoft Access application needs

to take control of the entire environment and run from only one

window, restricting the user from switching to any other application.

An example of this is a security system, or a time-critical

application that needs to run uninterrupted.

Passing the handle of the window as an argument to SetSysModalWindow

will limit the user to that particular window. This will prevent the

user from moving to other applications or bringing up the Task Manager

with the mouse or by pressing ALT+ESC or CTRL+ESC. Using

SetSysModalWindow in conjunction with the GetSystemMenu can disable

the Control (system) menu and prevent the user from quitting Windows

by pressing ALT+F4.

All child windows that are created by the system-modal window become

system-modal windows.  For example, if Microsoft Access is system-

modal and a form is opened, the form becomes system-modal until it is

closed.

When developing applications in Microsoft Access and using the

SetSysModalWindow API function, keep in mind the restrictions that

will be placed upon the user. A window that is system-modal cannot be

minimized, maximized, moved, or sized. Microsoft Access help is

created with a separate Windows Help file; therefore, help windows

created with the Windows Help Compiler will not be available to the

user.

When the SetSysModalWindow API function is used, the system-modal

window (in this case, the Microsoft Access window) must be destroyed

before other applications or windows can be accessed. Therefore,

make sure the application has a means to exit Microsoft Access.

To use the SetSysModalWindow API function within Microsoft Access

Basic, do the following:

1. Within the Declarations Section, enter the following, with each

   Declare statement on a single line:

      Option Explicit

      Declare Function SetSysModalWindow% Lib "User" (

                      ByVal hwnd%)

      Declare Function FindWindow% Lib "User" (

                      ByVal lpszClassName As Any,

                      ByVal lpszWindow As Any)

2. Create a procedure by entering the following:

      Sub System_Modal_Test ()

        Const lpClassName = "OMain"

        ' Declares the class name constant used in

        ' the FindWindow API function.

        Dim AccessHandle

        Dim Success As Integer

        ' FindWindow returns the Handle for Microsoft Access.

        AccessHandle = FindWindow(lpClassName, 0&)

        ' The Handle for Microsoft Access is sent then Microsoft Access

        ' becomes modal.

        Success = SetSysModalWindow(AccessHandle)

      End Sub

3. Save the module by choosing Save from the File menu. Save the

   module as "Modal Access" and choose the OK button.

4. From the Run menu, choose Compile All.

5. From the View menu, choose Immediate Window. In the Immediate

   Window, type the following, then press ENTER:

      System_Modal_Test()

After running the program, explore the possibilities of the functions

by trying to select other windows. Note that the windows cannot be

saved, maximized, or minimized. Prior to using this procedure in an

Microsoft Access application, make sure all situations have been

considered so that the application is designed to be thoroughly modal.

For more information on API functions, refer to:

   "Microsoft Windows Software Development Kit," Microsoft Press, 1992

   "Programming Windows: The Microsoft Guide to Writing Applications

   for Windows 3," Charles Petzold, Microsoft Press, 1990

   "Programmer's Reference Library: Microsoft Windows 3.1 Guide to

   Programming Reference," Volumes 1-6, Microsoft Press, 1992

References


INF: Norton Desktop 1.x Is Not Compatible with Access

 Article Number: Q88172

 CREATED: 19-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

Running Norton Desktop for Windows versions 1.x with Access results in

unpredictable behavior in Access (for example, you may lose the

background screen or experience a general protection [GP] fault in

Access). To resolve these problems, upgrade to version 2.0 of Norton

Desktop for Windows.

The product included here, Norton Desktop for Windows, is manufactured

by a vendor independent of Microsoft; we make no warranty, implied or

otherwise, regarding this product's performance or reliability.

References


INF: ODBC Setup for Access and SQL Server

 Article Number: Q88173

 CREATED: 19-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

Installation and setup of Microsoft ODBC for Microsoft SQL Server

requires the use of ISQL command line procedures to properly run the

INSTCAT.SQL script.

If INSTCAT.SQL has not been properly implemented in SQL Server,

the following error will be displayed while attaching a SQL table

in Access:

   [Microsoft][ODBC SQL Server Driver] The ODBC catalog stored

   procedures installed on server <server_name> are version xx.xxxx;

   version xx.xx.xxxx is required to ensure proper operation.  Please

   contact your system administrator.

More Information:

To properly configure SQL Server for use with Microsoft ODBC, you must

run the SQL script file INSTCAT.SQL (shipped with ODBC) to set up the

proper stored procedures that provide catalog information used by

Microsoft ODBC. Microsoft SAF for MS-DOS and OS/2 are limited to 511

lines of code in a SQL script. INSTCAT.SQL has well over 511 lines of

code in it.

SQL Administrator does not recognize the GO command used in

INSTCAT.SQL.

The proper way to install the catalog stored procedures using

INSTCAT.SQL is to run INSTCAT.SQL from the command line using the SQL

Server facility ISQL (Interactive SQL).

The ISQL facility is run from either the MS-DOS or OS/2 command

prompt. The syntax for this procedure is:

   isql /U <sa login name> /n /P <password> /S <SQL server name> /i

   <drive:\path\INSTCAT.SQL> /o <drive:\path\output file name>

(Note: The above two lines should be entered as one line at the

command prompt. Do not include the angle braces <> in the command.)

   /U    The login name for the system administrator

   /n    Eliminates line numbering and prompting for user input

   /P    Password used for the system administrator

   /S    The name of the server to set up

   /i    Provides the drive and fully qualified path for the location of

          INSTCAT.SQL

   /o    Provides isql with an output file destination for results or the

         process including errors

(Note: The /P option is case sensitive.)

Example

-------

   isql /U sa /n /P skier /S DUMMY_SERVER /i d:\SQL\INSTCAT.SQL /o

   d:\SQL\output.txt

After you run INSTCAT.SQL, you should run the RECONFIGURE command

against the MASTER database using SAF. See pages 205-212 of the

"Microsoft SQL Administrator's Guide" version 4.2 manual for more

information.

Note: This information is available in the Microsoft Access README.TXT

file.

References


INF: How to Obtain Access Startup Directory with API Calls

 Article Number: Q88174

 CREATED: 19-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

Access Basic does not have an inherent command to return the Access

startup directory. However, this can be accomplished within an Access

Basic program by making Windows API calls.

This article describes the steps involved in creating a function that

returns the Access startup directory.

For more detailed information on Windows API calls, query on the

following words in the Microsoft Knowledge Base:

   handle and api and dll and kernel and user and gdi

More Information:

The Access Basic CurDir$ function returns the current directory.

Because Access can be started from a directory other than the current

directory, the CurDir$ function cannot be used to determine the

startup directory.

The following program module makes use of the Windows API functions

GetModuleHandle and GetModuleFileName. With the module handle, the

path can be obtained with the GetModuleFileName function.

Module

------

To create an Access Basic function that returns the Access startup

directory, do the following:

1. From the Access File menu, choose New, and select Module.

2. In the Declarations section of the module, enter the following

   Declare statements (each on a single line):

    Declare Function GetModuleHandle% Lib "kernel" (ByVal FileName$)

    Declare Function GetModuleFileName% Lib "kernel" (ByVal hModule%,

                        ByVal FileName$, ByVal nSize%)

3. Enter the following commands to create the function:

    Function StartUp_Dir ()

       hModule% = GetModuleHandle("MSACCESS.EXE")

       Buffer$ = Space$(255)

       Length% = GetModuleFileName(hModule%, Buffer$, Len(Buffer$))

       Buffer$ = Left$(Buffer$, Length%)

       Msg$ = "Startup path and filename: " + Buffer$

       MsgBox Msg$

    End Function

4. From the Run menu, choose Compile All to compile the function.

5. From the File menu, choose Save, and enter "Startup Directory" as

   the name of your module. Choose OK.

6. From the View menu, choose Immediate Window to invoke the function.

   Type the following command into the Immediate window, then press

   ENTER:

      ? StartUp_Dir()

Uses and Variations

-------------------

The Startup directory is displayed when

   ? StartUp_Dir()

is issued in the Immediate window. This function can also be

incorporated into other program modules and used in expressions. For

example, entering =Startup_Dir() as the OnPush property of a button on

a form returns the startup directory of Access whenever the button is

chosen.

For additional functionality, you can change the ACCESS.EXE argument

for the Windows API GetModuleHandle function so the function returns

the startup directory of another program started within the Windows

environment. Furthermore, you can pass a program name as a variable to

the Windows API function, giving even more flexibility to the

function.

Reference(s):

"Microsoft Windows Software Development Kit", Microsoft Press, 1992

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3", Charles Petzold, Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference" Volumes 1 - 6, Microsoft Press, 1992

References


INF: Creating, Debugging, and Using an Access Library

 Article Number: Q88175

 CREATED: 19-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes a Microsoft Access library and discusses some

basics on how to create and debug a library, as well as some things to

watch out for.

This article assumes that you are familiar with Access Basic and with

creating Access applications with the programming tools provided with

Access.

More Information:

Access Basic Library Defined

----------------------------

When you write an Access application, such as the NWIND application

with the package, the application works only within the database in

which it was created. This is satisfactory for many applications that

specifically use the data that resides in the application's database.

However, many Microsoft Access developers write generic applications,

programs, and utilities that are designed to work on any user

database. An example of this is Wizards. Wizards are Access Basic

programs that reside in their own database, but are available to the

user in any database the user has open. If this weren't the case, you

could not use a Wizard outside of the database that the Wizard program

and system objects reside in. In order to use a program (such as a

Wizard) so that its code and objects are available to any user

database, you must load the database containing the program and its

objects as a library.

To load a database as a library, you must open MSACCESS.INI and add an

entry to the Libraries section. When you open MSACCESS.INI initially,

you will probably see a Libraries section with an entry for the

Wizards library:

   [Libraries]

   wizard.mda=ro

Note: If there is no Libraries section, add it to the end of the file

and continue. The MSACCESS.INI file can be found in your Windows

directory.

The "ro" in the Wizard entry means that the library is read-only. If

you have an application that uses system tables that are to be written

to at any point in your program, you would specify "rw" rather than

"ro". For example, suppose you have an application in a file called

STOCKAPP.MDB that employs the use of system tables that can be

modified. You would add the following entry to use the MDB file as a

library:

   [Libraries]

   wizard.mda=ro

   stockapp.mdb=rw

Given these library entries, the WIZARD.MDA library will be loaded

read-only, and the STOCKAPP.MDB library will be loaded as read- write.

You can now open an Immediate window in a user database and invoke sub

and function procedures from STOCKAPP.MDB, or open tables, queries,

forms, or reports with DoCmd commands. Even though you can access the

code and the database objects, you cannot see them in the Database

window.

When a database is loaded as a library, it cannot be opened as a user

database.

Writing and Debugging Access Basic Library Code

-----------------------------------------------

When you write an Access Basic application for use as a library, you

are doing little more than writing the application in a user database

with the intention of using it as a library at a later point. Because

of this, a rule of thumb is to make sure the application works

completely before trying to use it as a library.

Although this rule of thumb is enough to successfully create many

types of library applications, there are some important pitfalls to

watch for when writing a library application, even if the application

works perfectly as a user database.

Debugging an Error in a Library Database

----------------------------------------

If the library database generates an error that only occurs while it

is a library, it can be very difficult to locate. An error might occur

that gives you some idea of the general area of the problem, but there

may be little or no indication of the offending line. Because you

cannot set and use breakpoints and stepping in library applications,

you should design error traps that convey meaningful messages and

indicate the location of the problem.

Another debugging tip is to place MsgBox's at milestone areas of the

code so that you always have an idea of which code is being executed.

CodeDB() Versus CurrentDB()

---------------------------

Access Basic includes the CodeDB() function for opening library

databases. CodeDB() works identically to CurrentDB() if you are

running the application as a user database. However, if you are

running the application as a library, CodeDB() returns the database

object for the library database from which it was called, while

CurrentBD() returns the database object from the current open user

database. Because of this, it is easy to confuse one for the other,

which results in logical errors that do indicate this is the problem.

Domain Functions

----------------

Domain functions include a parameter that is used as criteria for

applying the function to a specified set of records. The criteria is

in the form of a SQL WHERE statement and assumes first that any table

in the criteria is located in the user database. This could pose a

problem for your application if you intend to perform a domain

function on a library table that happens to have the same name as a

user table. Of course, this does not happen frequently; but it becomes

very important when you work with Microsoft Access system tables which

will have the same name in both databases. If you are to include a

table within your library, you should  give this table a unique name

that you do not expect a user to duplicate such as "My Library

Table1."

Macros in a Library Cannot Be Called from a User Database

---------------------------------------------------------

Of all the objects you can create in a Microsoft Access database,

macros are the only type of object you cannot use in a library

application. The most obvious problem this presents is that forms

require the use of macros in order to have menus. Because of this

limitation, you must make sure to use only Access Basic code for

programming.

References


INF: Programming with the Object Analyzer Engine and Utilities

 Article Number: Q88620

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

When the Database Analyzer library is loaded into memory, you not only

have access to the Database Analyzer tool, but also to all the core

commands that do the actual analysis. This article discusses those

commands and functions and how you can use them to include this sort

of data analysis in your custom applications or to write your own

database-object analysis tool.

This article assumes that you have some experience with developing

applications in Microsoft Access using macros and Access Basic.

More Information:

Included with Microsoft Access is a tool called the Database Analyzer.

You can use this tool to retrieve information on the design of the

objects in your database, such as tables, queries, forms, and so on.

For more information on what the Database Analyzer is and how to

install and use it, choose Contents from the Help and choose the

Product Support topic.

Once you have loaded the Database Analyzer library into memory (by

following the instructions in the Help file), you not only have access

to the Database Analyzer tool, but also to all the core commands that

do the actual analysis. You can use these commands and functions to

add data-analysis capability in your custom applications or to write

your own database-object analysis tool.

Before learning the commands and command syntax available, you should

know the basic makeup of the Database Analyzer tool. The Database

Analyzer consists of three pieces:

 - Database Analyzer

   This is the "front end" form that you see when you start the

   Database Analyzer tool. It includes the code that gives it the

   ability to display and select objects for analysis.

 - Object Analyzer

   This is the core engine that actually creates the object tables,

   performs the analyses, and writes the resulting information to the

   object tables.

 - Object Analyzer Utilities

   This piece contains global procedures and functions that support

   some of the commands in the Object Analyzer.

The purpose of the Database Analyzer is to find out which objects the

user wants analyzed, then call the Object Analyzer to perform the

actual analyses using one of the following commands:

   DumpTableInfo

   DumpQueryInfo

   DumpFormOrReport

   DumpMacroInfo

   DumpModuleInfo

Assuming you have loaded the Database Analyzer library in memory,

these commands are available to you from the Immediate window. To

use one of these commands, do the following:

1. Load the Database Analyzer library into memory. For information on

   how to install the Database Analyzer library, choose Contents from

   the Help menu, then choose the Product Support topic.

2. Open the NWIND database in Microsoft Access.

3. In the Database window, switch to Modules. Select the Introduction

   To Programming module and choose the Design button.

4. From the View menu, choose Immediate Window.

5. In the Immediate window, type the following command, then press

   ENTER:

      DumpTableInfo "NWIND.MDB", "MyTableInfo", "Employees", False

Upon executing this command, you will notice some disk activity. Once

the disk activity has stopped, you will find a new table called

"MyTableInfo" in the Database window. This table will contain the

structure information for the Employees table.

Described below are the functions that you can call with the Object

Analyzer.

DumpTableInfo <TargetDB>, <DetailsTable>, <ObjectName>, <IsAttached>

---------------------------------------------------------------------

   Formal Parameter   Definition

   ----------------   ----------

   TargetDB$          The name of the database that will receive the

                      table.

   DetailsTable$      The name of the table that will receive the

                      information.

   ObjectName$        The name of the table to report on.

   IsAttached%        True if the table being reported is an

                      Attached Table; otherwise False.

DumpQueryInfo <TargetDB>, <SQLTable>, <DetailsTable>, <ObjectName>

---------------------------------------------------------------------

   Formal Parameter   Definition

   ----------------   ----------

   TargetDB$          The name of the database that will receive

                      the table. SQLTable is the name of the table that

                      will receive the SQL representation of the

                      query.

   DetailsTable$      The name of the table that will receive the

                      detailed information of the query.

   ObjectName$        The name of the query to report on.

DumpFormOrReport <TargetDB>, <PropsTable>, <DetailsTable>,

   <ObjectName>, <IsForm>

---------------------------------------------------------------------

   Formal Parameter   Definition

   ----------------   ----------

   TargetDB$          The name of the database that will receive the

                      table.

   PropsTable$        The name of the table that will receive the

                      information on the form's or report's properties.

   DetailsTable$      The name of the table that will receive the

                      detail information about the form or report.

   ObjectName$        The name of the form or report.

   IsForm%            True if reporting on a form, False if on a

                      report.

DumpMacroInfo <TargetDB>, <DetailsTable>, <ObjectName>

---------------------------------------------------------------------

   Formal Parameter   Definition

   ----------------   ----------

   TargetDB$          The name of the database that will receive the

                      table.

   DetailsTable$      The name of the table that will receive the

                      information.

   ObjectName$        The name of the macro to report on.

DumpModuleInfo <TargetDB>, <ProcsTable>, <VarsTable>, <ObjectName>

---------------------------------------------------------------------

   Formal Parameter   Definition

   ----------------   ----------

   TargetDB$          The name of the database that will receive the

                      table.

   ProcsTable$        The name of the table that will receive the

                      listing of procedures.

   VarsTable$         The name of the table that will receive the

                      listing of variables.

   ObjectName$        The name of the module to report on.

Note: DumpModuleInfo will not work if it is executed from an Immediate

window.

If you would like more information on how to use these commands in a

program, search in the Microsoft Knowledge Base for the article

titled "Practice Using Object Analyzer Commands" (Q88651).

References


INF: How to Force a Cascading Delete

 Article Number: Q88635

 CREATED: 30-AUG-1992

 MODIFIED: 27-APR-1993

Summary:

The capabilities of referential integrity in Access do not extend to

performing cascading deletes. A cascading delete is a method of

deleting all records of a child table when the corresponding record in

the master table is deleted. This article discusses how to write a

macro to perform a cascading delete upon deleting a record from a

related master table.

More Information:

As an example of a cascading delete, suppose you are viewing the

Northwind Traders sample database (NWIND.MDB) Categories table, and

you decide to delete the "BEVR" Category ID. If the Categories table is

related to the Products table which contains many child Category ID

records with the value "BEVR", and if referential integrity is enabled

for this relationship, Microsoft Access will not permit you to delete

the record in the Categories table until you delete all of the child

"BEVR" records in the Products table. With the ability to perform a

cascading delete, all of the Products "BEVR" records would be deleted

automatically before the actual deletion of the Categories "BEVR" took

place.

To force a cascading delete using the Categories/Products example,

first create a macro and attach it to the OnDelete event of the

Categories form:

1. In the Database window, choose the Macro button, then choose New.

2. If the Condition column does not appear in the macro sheet, choose

   the Conditions command from the View menu.

3. Add the following actions and their corresponding properties:

  Condition                                                Action

  ---------------------------------------------------------------

  MsgBox("Delete record & all child records?",33)<>1       CancelEvent

  ...                                                      StopMacro

                                                           SetWarnings

                                                           SendKeys

                                                           RunSQL

  SetWarnings Action

  ------------------

  Warnings On:   No

  SendKeys Action

  ---------------

  Keystrokes:   {enter}

  RunSQL Action

  -------------

  SQL Statement:     DELETE * FROM [Products] WHERE [Category ID] =

                     Forms!Categories![Category ID];

                     Note the semicolon (;) at the end of the SQL

                     statement.

4. Close and save the macro, naming it "Cascade".

To use this macro with an existing form, do the following:

1. Open the form in design mode.

2. From the Edit menu, choose Select.

3. In the property sheet, specify "Cascade" for the OnDelete event.

4. Close and save the form.

Now when you use the form, deleting any records will delete any

matching child records in a related table.

To delete a record on the Categories form (because there are no Record

Selectors on this form), choose the Select command from the Edit menu,

then choose the Delete command from the Edit menu.

References


PRB: Irregular Characters in Attached dBASE IV Memo Field

 Article Number: Q88647

 CREATED: 30-AUG-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   If you have an attached dBASE IV table with a memo field, a strange

   character resembling an "i" (ASCII 161) appears randomly throughout

   the memo field when viewed in Access.

CAUSE

   This problem is the result of the way dBASE IV handles its memo

   fields and how this translates when you view the memo field in

   Access.

   When you open a memo field in dBASE IV, you are presented with an

   editor that is fixed at 65 characters per line and cannot be adjusted.

   In order to format your memo data so that it fits comfortably in the

   memo editor, dBASE IV inserts invisible characters that act as

   carriage returns. These characters become an actual part of the data

   in the .DBF file. Access does not use these characters to format the

   memo data because the size of a memo control is adjustable, so they

   are ignored and consequently appear in the memo control on your form.

RESOLUTION

   These characters can be stripped out of the memo field by using an

   Access Basic procedure. The procedure would go through each record

   in the table, grab the memo field, and copy it to a temporary

   holding area character for character, ignoring all instances of

   Chr(161), then copy the string from the holding area back into the

   memo field.

STATUS

   This behavior is by design.

More Information:

The product included here, dBASE IV, is manufactured by a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

References


INF: Easy Way to Add Items to the Help Menu

 Article Number: Q88648

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

The Help menu item that appears at the top of the screen in Microsoft

Access can be supplemented so that your own custom menu items appear.

This can be done through the use of an undocumented MSACCESS.INI

section.

More Information:

The section is called [Menu Add-Ins]. You can use this feature to

invoke a macro, an Access Basic program, or an Access Basic function

from a Help menu item. To add this section to MSACCESS.INI, follow

these instructions:

1. Close Microsoft Access if it is open.

2. From your Windows Program Manager, start Notepad.

3. In Notepad, open the file MSACCESS.INI, (this file is located in

   the same directory that you installed Windows).

4. Scroll to the bottom of the text, add a new line, and type the

   following:

   [Menu Add-Ins]

You are now ready to add the menu items that you want to appear in the

Help menu. You can do this by adding lines to the [Menu Add-Ins]

section that follow this convention...

<menu label>=<menu action>

menu label  -  String that appears in the menu.

Menu action -  Can be one of the following:

1. Macro name

2. User-defined function

3. Access Basic function

For example, if you wanted to add a menu item called 'Customers Form'

that runs a macro called 'OpenCustForm', you would add the following

line to the [Menu Add-Ins] section:

   Customers Form=OpenCustForm

If you wanted to add an item called 'Run Daily Update' which runs an

Access Basic function you wrote called 'RunUpdate()', you would add

the following line to the [Menu Add-Ins] section:

   Run Daily Update==RunUpdate()

The second '=' in this example is required for running user-defined

functions or other Access Basic functions.

You can also include an underlined character accessible with the ALT

key in the menu item label by placing an ampersand (&) in front of the

character that should be underlined.  For example, suppose you wanted

a menu item in the Help menu called 'Show Message' with the 'M'

underlined.  This menu item would call Access Basic's MsgBox()

function to display a message:

   Show &Message==MsgBox("This is a message")

An example of the [Menu Add-Ins] section as it should appear in

MSACCESS.INI given the example menu items above follows:

   [Menu Add-Ins]

   Customers Form=OpenCustForm

   Run Daily Update==RunUpdate()

   Show &Message==MsgBox("This is a message")

Once you have made these modifications to MSACCESS.INI and restart

Microsoft Access, you can pull down the Help menu from the main menu

to see the resulting added menu items.

References


INF: Opening Databases Read Only Causes Information Message

 Article Number: Q88649

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

When you open a database under the following conditions:

 - As read-only, whether its file attribute is set to read-only

 - The directory it resides in is read-only

 - You use the "/Ro" command line parameter

you will receive the following error message:

   Database '<Database_Name>' is read-only.  You won't be able to save

   changes made to data or object definitions in this database.

Note also that when a database is opened in read-only mode an .LDB

file will never be created.

More Information:

The only current workaround, if somebody does not want to be prompted

with the above message, is to implement security. Here you would not

physically open the file as read-only but would open all the objects

in the database as read-only.  The process for implementing security is

outlined in chapter 25 of the "Microsoft Access User's Guide."

References


INF: How to Create a Password Textbox

 Article Number: Q88650

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

Some applications require password protection and should provide a

dialog to the user at startup which prompts for a password.  For

security purposes, this prompt should not show the characters that the

user is typing, but should give the user some idea of how many

characters have been typed so that the user does not lose track of

what part of the passowrd is being typed.

More Information:

To modify the password textbox on your form to behave like this,

follow these instructions:

1. Open your form in design mode.

2. Click once on the textbox on the form which you are using to

   receive the password so that it has focus.

3. In the toolbar, drop down the list of fonts located directly to the

   right of the Paint Pallette toolbar button.

4. From the list, choose 'Courier'.

5. In the toolbar, drop down the list of font sizes located directly

   to the right of the list of fonts from which you just made a

   selection.

6. From the list, choose the value 10.

7. From the palette window, click on the color White for both the

   Fill row and Text row of colors.

8. Save and close your form.

After making these modifications, you will notice that characters

typed in the password textbox do not appear, but the cursor is

present.  The Courier font assigned to the textbox makes cursor

movement and position clearly definable so that the user has an idea

of how many characters have already been typed.

References


INF: Practice Using Object Analyzer Commands

 Article Number: Q88651

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article provides an example for using the Object Analyzer

commands discussed in the article, "Programming with the Object

Analyzer Engine and Utilities" (Q88620). For more information on the

commands themselves, search on the following words in the Microsoft

Knowledge Base:

   DumpTableInfo or DumpQueryInfo or DumpFormOrReport or

   DumpMacroInfo or DumpModuleInfo

This article assumes that you have some experience with developing

applications in Microsoft Access using macros and Access Basic.

More Information:

As discussed in the article titled "Programming with the Object

Analyzer Engine and Utilities," you can take advantage of the Object

Analyzer engine by using the commands in the Object Analyzer module.

To gain some practice using these commands, follow the steps below to

create your own Database Analyzer in NWIND:

 1. Create a new form called "Little Analyzer".

 2. Create a text box control on the form and change the Control Name

    property to "Name".

 3. Place an option group control called "Options" on this form.

 4. Add six toggle buttons to the "Options" option group and modify

    the properties of the toggle buttons as described below:

    Control         Option Value   Caption

    --------------------------------------

    First Button          1        Table

    Second Button         2        Query

    Third Button          3        Form

    Fourth Button         4        Report

    Fifth Button          5        Macro

    Sixth Button          6        Module

 5. For the AfterUpdate property of the "Options" option group,

    specify the following:

       =AnalyzeIt(Name, Options)

 6. Save and close the report.

 7. Create a new module and add the following function:

Function AnalyzeIt (InName As String, InType As Integer)

   ' This function accepts the name of a Microsoft Access object

   ' and a number representing what type of object it is, then uses

   ' the Object Analyzer Dump commands to analyze the object

   DoCmd Hourglass True

   Select Case InType

      Case 1

         DumpTableInfo "NWIND.MDB","@Table",InName,False

      Case 2

         DumpQueryInfo "NWIND.MDB","@QuerySQL","@Query",InName

      Case 3

         DumpFormOrReport "NWIND.MDB","@Form","@FCtrls",InName,True

      Case 4

         DumpFormOrReport "NWIND.MDB","@Report","@RCtrls",InName,False

      Case 5

         DumpMacroInfo "NWIND.MDB","@Macro",InName

      Case 6

         DumpModuleInfo "NWIND.MDB","@Procs","@Vars",InName

   End Select

   DoCmd Hourglass False

End Function

 8. Save and close the module.

 9. Open the "Little Analyzer" form.

10. In the Text Box, type "Categories" (without quotation marks).

11. Choose the Tables button.

At this point, the Object Analyzer will analyze the Categories table

and create a table called "@Table", which will contain the information

on the structure of the Categories table.

You might also want to experiment with analyzing a form or other

object in the same way.

If you have the Database Analyzer library loaded, you can use these

commands to build your own object-analysis tool, or you may want to

incorporate these commands into your application to make it self-

documenting.

References


INF: Creating a Proper Function for Data Entry

 Article Number: Q88652

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

There is no built-in format (or Access Basic) function that capitalizes

the first character of a word (similar to Excel's Proper function).

However, this can be done with a one line function attached to the

AfterUpdate property of a form control.

Note: You can call this function from forms, reports and queries, but

not from tables.

More Information:

To create an example, create a form based on some desired table.

Change the following property of the form:

   AfterUpdate: =Proper(<control name>)

Where <control name> is the name of the control on the form. This will

call the function Proper() whenever the value on the form is changed.

Now create a module and enter the following function:

   Function Proper(Ctl as Control)

      Ctl = UCase(Left(Ctl, 1)) & LCase(Right(Ctl, Len(Ctl) - 1))

   End Function

Whenever you edit the field in the form the first letter will be

capitalized.  What you have done is pass program control by reference

to the function, which parses the string and capitalizes the first

character.  You may use this function from any number of controls.

References


INF: How to List the Related Tables in a Database

 Article Number: Q88653

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

Although Access allows you to create relationships among tables in

your database, there is no inherent command to list these

relationships. Sometimes this information can be of use, particularly

when trying to find the source table of a referential integrity

violation or other such example.

This article discusses how you can use a series of queries to display

a list of tables that are related in a database.

More Information:

Information on the relationships among the tables in a database can

sometimes be very helpful, particularly when trying to find the source

table of a referential integrity violation or other such example. This

information is also good for documenting your database.

Although Access allows you to create relationships among tables in

your database, there is no inherent command that will gather this

information and present it in a meaningful way. All of this

information can be made available by gathering and relating

information from the system tables MSysObjects, MSysColumns, and

MSysIndexes. This article discusses how you can create a query

containing two columns. The first column, called "Primary.Name," will

contain a table name. The second column, called "Foreign.Name," will

represent the table that the Primary.Name table is related to.

Because the information will be coming from the system tables

mentioned above, you must make sure you have access rights to these

tables. MSysObjects has these rights by default, so the instructions

below indicate how you can give yourself access rights to MSysIndexes

and MSysColumns.

1. In the Database Window menu, select the View menu, then choose

   Options.

2. Change the Show System Objects setting to Yes, then choose OK.

3. From the Database Window menu, choose the Permissions command from

   the Security menu.

4. In the following dialog box, choose Table for the Object Type

   prompt, then choose MSysIndexes for the Object Name prompt.

5. In the Permissions box at the bottom of the dialog, select the

   Full Permissions box.

6. Click Assign and then choose the Close button. Repeat steps 4 and

   5 for MSysColumns.

7. From the View menu at the top of the screen, choose Options.

8. Change Show System Objects to No, then choose the OK button.

At this point, you can begin building the queries that will retrieve

the relationship information. To do this, follow the instructions

below:

 1. In the database window, choose the Query button, then choose New.

    A query design screen appears, along with a dialog asking for a

    Table/Query to add to the query. Choose Close so that the query

    design grid is blank.

 2. From the View menu, choose SQL.

 3. Delete any contents that appear in the SQL dialog box.

 4. Enter the following into the SQL window:

       SELECT DISTINCTROW

          MSysObjects.Name, MSysObjects.Id

       FROM MSysObjects

       WHERE ((MSysObjects.Type=1)

       AND (MSysObjects.Flags Is Null Or MSysObjects.Flags<>2))

       ORDER BY MSysObjects.Name;

 5. Choose the OK button. Close and save the query as "psi User

    Tables."

 6. Repeat steps 1 through 4, substituting the SQL statement in step 4

    with the following SQL statement:

       SELECT DISTINCTROW [Tables].Name AS Table,

          MSysColumns.Name AS Field,

          [Tables].Id AS [Primary Id]

       FROM [psi User Tables] AS Tables, MSysColumns, Tables

       INNER JOIN MSysColumns ON [Tables].Id = MSysColumns.ObjectId

       ORDER BY [Tables].Name, MSysColumns.PresentationOrder;

 7. Choose the OK button, then close and save the query as "psi User

    Tables Field List."

 8. Repeat steps 1 through 4, substituting the SQL statement in step 4

    with the following SQL statement:

       SELECT DISTINCTROW Primary.Name, Foreign.Name

       FROM [psi User Tables] AS Primary, MSysIndexes, [psi User Tables]

          AS Foreign, MSysIndexes AS LKeyName, LKeyName

       INNER JOIN MSysIndexes ON LKeyName.Idxid = MSysIndexes.Idxid,

          LKeyName

       INNER JOIN MSysIndexes ON LKeyName.ObjectId = MSysIndexes.ObjectId,

          Primary

       INNER JOIN MSysIndexes ON Primary.Id = MSysIndexes.ObjectId,

          Foreign INNER JOIN MSysIndexes ON Foreign.Id =

          MSysIndexes.ObjectIdReference

       WHERE ((MSysIndexes.ObjectIdReference<>0)

          AND (MSysIndexes.Operation=2)

          AND (LKeyName.Operation=0))

       ORDER BY Primary.Name, Foreign.Name;

 9. Choose the OK button. Close and save the query as "psi

    Relationships."

10. To view the Relationships table, highlight the query called "psi

    Relationships" in the database window and choose the Open button.

With this query, you can create reports or use the query in any other

way that you would normally use an Access query to make use of the

information.

References


INF: Performing an SQL Bulk Action Query from Access Basic

 Article Number: Q88654

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

Access Basic does not support SQL statements to access your data

outside of having to define a virtual table (VT) object to execute

such a statement.

For example, you cannot execute the following SQL command on a line by

itself even though it would be valid in an Access query:

   UPDATE Cust SET Cust.[Phone] = "(206) " & [Phone];

This article discusses how to perform these kinds of bulk action

queries, and also includes a subprocedure you can add to your program

called PerformSQLAction. This subprocedure allows you to simply pass a

bulk action SQL statement to the procedure and have it executed.

This article assumes that you have some experience with writing

procedures in Access Basic.

More Information:

Access Basic does not support SQL statements in the sense that you

cannot simply expect a SQL command to execute on a line by itself. For

example, the following SQL command, although valid in an Access query,

will generate a syntax error in an Access Basic program:

   UPDATE Cust SET Cust.[Phone] = "(206) " & [Phone];

Instead of including the SQL command on a line by itself, you have to

follow these steps in order to execute the SQL command:

1. Dim a Database and QueryDef variable as shown below:

      Dim MyDB As Database

      Dim MyQuery As QueryDef

2. SET the database variable to the current user database as shown

   below:

      Set MyDB = CurrentDB()

3. SET the QueryDef variable to using the CreateQueryDef method,

   assigning an arbitrary query name such as "TempQuery," and

   including the desired SQL statement. The query you create using

   this step is only for the purpose of executing the bulk action

   query, and will be deleted later. An example of how to use

   CreateQueryDef for this purpose is shown below:

   Set MyQuery = MyDB.CreateQueryDef("TempQuery" ,UPDATE

                 Cust SET Cust.[Phone] = "(206) " & [Phone];

   (Make sure the entire command shown above appears on one line.)

4. Execute the TempQuery query you created in the previous step by

   using the Execute method:

      MyQuery.Execute

5. Delete TempQuery by using the DeleteQueryDef method as shown below:

      MyDB.DeleteQueryDef("TempQuery")

All of these steps, along with some error trapping, have been combined

in the subprocedure PerformSQLAction listed at the bottom of this

article. By creating a generic procedure such as PerformSQLAction, you

can make use of SQL commands to perform bulk action queries in your

Access Basic program.

PerformSQLAction requires only the SQL command you want to execute as

a string value. For example:

   PerformSQLAction "UPDATE Cust SET Cust.[Phone] = '(206) ' & [Phone];"

Note that the SQL command is always followed by a semicolon (;).

The following is a listing of PerformSQLAction:

Sub PerformSQLAction (SQLStmt As String)

   Dim LocalDB As Database, LocalQry As QueryDef

   On Error Resume Next

   Set LocalDB = CurrentDB()

   LocalDB.DeleteQueryDef("TempQuery")

   On Error GoTo 0

   Set LocalQry = LocalDB.CreateQueryDef("TempQuery", SQLStmt)

   LocalQry.Execute

   LocalQry.Close

   LocalDB.DeleteQueryDef("TempQuery")

End Sub

References


INF: How Access Uses SQL Server Connections

 Article Number: Q88655

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes how Access uses connections to SQL Server and

how application developers can minimize use of these connections.

This article assumes the reader is highly knowledgeable about the low

level interaction between applications and SQL Server.

More Information:

The conventional application that accesses a server does it in a

simple single-tasking manner, requiring a single connection to the

server. Access, however, is not the typical conventional server

front-end. Many of its features, including updatable views (dynasets),

joins between local and server data, execution of complex expressions

that the server may not be able to handle, and seamless transition

from one server to another, require Access to obtain more connections

than the conventional front-end needs.

Although some servers, such as Microsoft SQL Server, are not too

stingy on giving out connections, there are servers that place strict

limits on the number of connections an application can open. (In some

installations, SQL Server also places absolute restrictions on

connections.) When designing applications for the more restrictive

servers, it is important to understand how Access uses connections.

Connections are opened by Access when it needs to execute a query on

the server (which it must do to build dynasets or static views),

obtain the data in a dynaset, or update data on the server. These

connections can be categorized into two types: connections needed to

build the working set, and connections needed to service dynasets.

Both types of views available in Access (static views and dynasets)

are built by executing a query (called a "local" query to

differentiate it from other types of queries discussed below). This

local query processes Access and foreign ISAM data (both locally and

file server based) and remote server data, and pulls it into a

temporary table that represents the view. To build static views, the

actual data is stored in the temporary table, whereas to build

dynasets, pointers to the actual data are stored.

When server data is included in the local query, execution of the

query involves asking the server (or servers) for data, which is done

by opening connections and sending queries to the server. Each query

sent to the server requires that a connection be opened.  If more than

one query is to be sent to the server, a single connection could be

used and the queries executed serially. However, this would typically

require the user to wait for all of the server queries to complete

before any data would appear. Therefore, Access executes the server

queries in parallel, requiring a connection for each.

The number of queries sent to a server may not be entirely obvious.

Much of the time, access to all of the remote base tables will be

combined into a single query, if all of the base tables reside on the

same server. In the worst case, each server base table referenced by

the local query will require a connection. There are several factors

that could compel Access to split a local query into several server

queries:

 - If server data is joined to data from other sources (that is,

   local, foreign ISAM, and other servers), the Access optimizer may

   decide that it is more efficient not to combine references to two

   tables on the same server into a single query. For example, if the

   Customers and Order Items tables are on a server and the Orders

   table is in a local Microsoft Access database, then it is likely

   that the optimizer will decide to ask for the Customers and Order

   Items tables separately, rather than asking for the cross-product

   of the two, to join to the Orders table. As you can tell from this

   example, this is unlikely to happen in a real scenario.

 - If an expression involved in the query cannot be executed on the

   server (either because the server doesn't support it or because the

   semantics provided by the server differ greatly with those provided

   by Access), the expression will be executed locally. An extreme

   example of this is a local query with a restriction that calls a

   user-defined function. Although this may not require separating

   remote tables into separate server queries, it will if the

   expression that isn't executable on the server is somehow involved

   with the join between the two tables. Note that in Access,

   expressions containing a conjunction that can be executed on the

   server will be executed locally in their entirety. These

   expressions are not split to execute part locally and part on the

   server.

 - The parameters used to attach tables on the same server to an

   Access database differ. For example, if two tables are in different

   databases, or if they are being accessed using different user names

   and passwords, then separate connections will be required to

   execute a local query referencing both of them.

   Connections opened in the execution of a local query will be kept

   open until the working set containing the queries is closed.

   Connections are also opened in support of dynasets. But, unlike the

   server queries sent during the execution of a local query, the

   queries sent to the server in support of a dynaset are executed

   entirely and very quickly.  This is because they are used to fill

   portions of the dynaset with data (given the pointers to the data

   provided by the local query), and to do updates to the server.

   Therefore, Access opens only one connection per attached server,

   provided that the link attachment information is the same for each

   server tables.

As a result of the above rules, when an Access query is executed, it

typically requires only one (for a static view or two (for a dynaset)

connection. This doesn't represent an extravagant use of server

connections, but good applications could involve the execution of many

Access queries that could occupy many server connections very quickly.

There are some steps the designer can take to minimize the use of

connections:

 - Reduce the number of queries required by the application. Each

   form, subform, data sheet, report, and list box requires a query,

   and each of these queries that accesses server data will require at

   least one or two connections. Close forms, data sheets, and reports

   as soon as they are no longer needed. Also, bring server data to a

   local database where practical, especially for filling list boxes.

 - Avoid queries that join server data to local data to server data,

   as described above. These type of queries will most likely be

   executed using a connection for each server table.

 - Avoid expressions that must be executed locally when joining server

   data together. Each of the tables involved with such a join

   expression, or that is restricted by a WHERE clause containing such

   an expression, will need to be executed locally. It should be noted

   that separating expressions into separate query objects will not

   help alleviate this problem, because the optimizer combines all

   query objects in a single query before execution for efficiency.

 - Use static working sets when seeing other users' changes, or when

   making changes yourself is not required. This will avoid the

   connections needed to support dynasets.

With an understanding of how Access uses connections, and with prudent

application design, you should not run out of server connections.

References


PRB: Scrollbar Thumbs Don't Move Scrolling Thru a Combo Box

 Article Number: Q88656

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you are using a combo box on a form, the scrollbar thumb

   does not always move when you scroll toward the bottom of the list by

   using the down-arrow button in the scrollbar.  When you reach the

   bottom of the combo box, the scrollbar thumb jumps immediately to the

   bottom of the scrollbar.  Once you have reached the bottom of the

   list, the scrollbar thumb works properly and moves as you scroll

   upward and downward through the combo box.

CAUSE

   The reason why this happens has to do with the fact that the combo box

   control does not always know how many records are in its ControlSource

   table or query when you drop the list down.

   At the point of dropping the list, Microsoft Access begins to access

   the data in the table or query. This occurs even as you are scrolling

   through the rows in the list. In order for the thumb in the scrollbar

   to move, the combo box must know how many items are in the list so

   that a calculation can be made as to where the thumb visually belongs.

   For example, if you have 100 records in your table and you are viewing

   the 50th record in the drop down list, then the thumb should appear

   halfway down the scrollbar.

   Once you have scrolled to the bottom of the list, the combo box knows

   the number of items that were included in the list. With this number,

   the thumb in the scrollbar can now adjust itself relative to the row

   position of the list.

RESOLUTION

   This behavior is by design.

References


INF: Using Date/Time Data Type and Calculating Elapsed Time

 Article Number: Q88657

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes how Microsoft Access stores the date/time data

type, gives an example of calculating elapsed time, and lists some

important considerations about the date/time data type.

More Information:

Microsoft Access uses double-precision, floating-point numbers (up to

15 decimal places) to store date/time values. Using this double-precision

number system, you can add, subtract, and compare date/time values as you

would other numeric values. The integer portion of the double-precision

number represents the date, and the decimal portion represents the time.

The acceptable range for date information is January 1, 100 A.D. (-657,434)

through December 31, 9999 A.D. (2,958,465), where January 1, 1900, is 2.

Negative numbers represent dates prior to December 30, 1899.

The acceptable range for time information is between 0:00:00 and 23:59:59,

or 12:00:00 A.M. and 11:59:59 P.M., inclusive. Time values representing 24

hours are stored internally as double-precision fractional numbers between

0.0 and 0.99999. Below are some examples of what is stored internally for

date/time values:

   2.0 represents 1/1/1900 12:00:00 AM

   0.25 represents 6:00:00 AM (0.25 * 24 hours = 6 hours)

   33914.125 represents 11/6/1992 3:00:00 AM (0.125 * 24 hours = 3 hours)

   24794.84375 represents 11/18/67 8:15:00 PM (0.84375 * 24 hours = 20 25

      or 20 hours and 15 minutes (.25 * 60 minutes = 15 minutes)

Using Null Values

-----------------

Microsoft Access recognizes when a portion of a date/time field has not

been entered. For example, if you enter only a time value, Microsoft Access

will not display the 0 date value of 12/30/1899. Calculations that include

a null date/time field will return a null.

Formatting and Storing Date/Time Values

---------------------------------------

Date/time fields can show the date, the time, or both depending on how you

choose to display or format the date/time field. Microsoft Access always

stores both the date and the time.

For the available formatting options, search for "Format Property Date/Time

Values" using the Help menu.

Comparing Dates Using Functions

-------------------------------

Microsoft Access uses double-precision, floating-point numbers when

calculating functions that contain date or time arguments. This can

occasionally cause unexpected results.

For example, if you test the following expression in the Immediate window

in Modules, the result will be 0 (FALSE), even if today's date is 1/31/92:

   ?Now()=DateValue("1/31/92")

This function returns -1 (TRUE) only when the current date and time are

1/31/92 12:00:00 AM. This is because the Now() function returns the

double-precision number of the current date and time, which may not be

equal to the integer number of only the date, which is returned by the

DateValue() function.

To avoid this problem, use either of the following statements to compare

today's date with another date:

   ?Date()=DateValue("1/31/92")

   ?Int(Now())=DateValue("1/31/92")

The Int() function strips the fractional portion of the double-precision

number from the Now() function, returning only the number representing

the date.

Computing and Displaying Elapsed Time

-------------------------------------

Below are two example functions -- HoursTest() and ElapsedTest(). They

return the amount of elapsed time between two given date/time values using

different display formats.

The first example, HoursTest(), displays the elapsed time in hours,

minutes, and seconds:

Note: In the following code, an underscore (_) is used as a line

continuation character. Remove the underscore when re-creating this

code in Access.

   Function HoursTest()

   ' This function displays the total hours elapsed in this format:

   ' 48:57:04

      Time1 = CVDate("1/3/92 4:05:06")

      Time2 = CVDate("2/2/92 5:02:10")

      HoursTest = Format(Int(Abs(Time1 - Time2) * 24), "###:") + _

         Format(Abs(Time1 - Time2), "nn:ss")

   End Function

The HoursTest() function uses the CVDate() function to convert the string

expression into a date value. Then it takes the absolute value of the

difference between the two date/time values and multiplies this by 24 to

account for the rollover into a new day:

   Abs(Time1 - Time2) * 24

HoursTest() uses the Int() function to return just the integer portion. The

resulting integer is the total number of hours elapsed:

   Int(Abs(Time1 - Time2) * 24)

Finally, HoursTest() concatenates the results of two Format() functions

together. The first Format() function returns the elapsed hours. The second

Format() function takes the absolute value of the difference between the

two time values and uses the "nn:ss" argument to capture just the minutes

and seconds.

   Format(Int(Abs(Time1 - Time2) * 24), "###:") + Format(Abs(Time1 -

      Time2), "nn:ss")

The second example, ElapsedTest(), displays adds the number of elapsed days

to the result:

   Function ElapsedTest()

   ' This function displays the elapsed time as the total number of

   ' days, hours, minutes, and seconds. For example: 4 Days 01:04:05 Hours.

      Time1 = CVDate("1/31/92 4:01:05")

      Time2 = CVDate("2/4/92 5:05:10")

      ElapsedTime = Abs(Time1 - Time2)

      ElapsedDays = Int(ElapsedTime)

      ElapsedPartialDay = (ElapsedTime - ElapsedDays)

      ElapsedTest = ElapsedDays & " Days " & Format(ElapsedPartialDay,

         "HH:NN:SS") & " Hours"

   End Function

The ElapsedTest() function uses a process similar to that used by

HoursTest() but displays the result in a different format.

Microsoft Excel Dates Versus Microsoft Access Dates

---------------------------------------------------

Microsoft Excel also uses double-precision numbers to store date/time

values, but Microsoft Excel values are limited to this range: 1/1/1900

through 12/31/2078. The Microsoft Excel date and time system begins with

the double-precision number 1.0, which represents 1/1/1900 00:00:00

(12:00:00 AM).

Originally, Microsoft Access supported the same date range as Microsoft

Excel (1900-2078). But when Microsoft extended the date range in Microsoft

Access to 100-9999, the 1900 leap year anomaly was corrected. This means

that between 1/1/1900 and 2/29/1900, the internal integer portion of the

date values for Microsoft Access and Microsoft Excel differ by one.

References


INF: Using TransferDatabase Macro to Attach to SQL Server Data

 Article Number: Q88658

 CREATED: 30-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes how to use the TransferDatabase macro action to

attach to data in SQL Server tables and what information is necessary

to execute this process.

This article assumes the reader is fluent with Microsoft Access Macro

code and its operation.

More Information:

The macro action TransferDatabase can be used to import from, export

to, or attach to external data sources. This article specifically

describes how to attach to data in a SQL Server table.

When you create a macro with the TransferDatabase action, you will

need to supply the macro-specific arguments:

Transfer Type:  For this type of transfer, choose ATTACH.

Database Type:  This is the type of the external database source that

                is being attached. In this case, select <SQL DATABASE>.

Database Name:  With SQL Server, a connect string supplies the

                necessary information.

Object Type:    The type of object being attached in this case is a

                TABLE.

Source:         The name of the table in the SQL Server table goes

                here.

Destination:    This is the name of the table as it is seen in the

                Microsoft Access database.

Structure Only: Depends on whether the data should be attached, also.

                In most cases (as well as this case) this should be

                NO.

The connect string (Database Name) is basically a string of items or

parameters that define the remote data source and the user's

identification.

The following are items within the connect string:

  DATA SOURCE NAME (DSN):   The name of the SQL Server machine.

  DATABASE QUALIFIER (DBQ): The name of the SQL Server database.

  WORKSTATION ID (WSID):    The name of the workstation that is making

                            the connection (optional).

  USER ID (UID):            The login id*.

  PASSWORD (PWD):           The user password*.

* This item is optional within the connect string. If it is not

present, the system will prompt the user with a dialog box to enter

this information at the time the macro is executed.

Note: SQL Server is case sensitive when dealing with password

information.

The following is a sample connect string to SQL Server. Note that it

starts with "ODBC", which tells the system that it will use the ODBC

driver (as opposed to an installable ISAM driver).

  ODBC;DSN=ServerX;DBQ=Pubs;WSID=wrkstn1;USID=JohnDoe;PWD=MARCH

This string would be placed in the Database Name argument of the

TransferDatabase action.

References


INF: Creating a Duplicate Function for Repetitive Data Entry

 Article Number: Q88670

 CREATED: 30-AUG-1992

 MODIFIED: 23-APR-1993

Summary:

In a data entry environment, everything is based on how quickly the

information can be entered with a high degree of accuracy. Some

information is repetitive for the data entry people to enter. That

information will change occasionally, and the data entry person needs

to be able to modify the data. The following two methods duplicate the

previous value entered, but once the value is changed, the function

duplicates the new value.

This article assumes you have a working knowledge of Access Basic.

More Information:

By pressing the CTRL and apostrophe (') keys at once (CTRL+'), you can

duplicate the last value entered in a field. This applies only to the

same instance of the form. For example, if you use the form to enter a

record and, without leaving the form, you enter another record, you

can press CTRL+' to duplicate the values from the last record.

However, if you exit the form, pressing CTRL+' duplicates the last

stored record, which might not be the last record entered (depending

on the primary key and the order in which records are stored).

1. Create a new module and define a global variable:

    Option Compare Database   'Database order for string comparisons

    Global Dupe_Val As Variant

2. Create a function that places the value from the previous record

   into the field:

     Function Stick_Val (Ctrl as Variant)

        Ctrl = Dupe_Val

     End Function

3. The next function checks the value to see if it has been changed

   from the previous value. If it is different, then it changes

   Dupe_Val to reflect the change.

     Function New_Val (Ctrl as Variant)

        Dim Check_Val As Variant

        Let Check_Val = Ctrl

        If (Check_Val <> Dupe_Val) Then

           Let Dupe_Val = Check_Val

        End If

     End Function

4. Set the following form properties:

      OnCurrent:      =Stick_Val([Field1])

      DefaultEditing: =Data Entry

5. The function New_Val() needs to be called on the Control property

   of the field you want this to occur on. Use something like the

   following

      BeforeUpdate:  =New_Val([Field1])

   where Field1 is the name of the control.

This process only has one save variable in it and can only work for

one control per active form.

When you use this method for the first time in a form (in the same

instance of Access), the Save variable is null. Therefore the CTRL+'

key combination will retrieve a value from the last record stored in

the data source.

References


INF: Using the LIKE Operator with Parameter Queries

 Article Number: Q88671

 CREATED: 30-AUG-1992

 MODIFIED: 13-MAY-1993

Summary:

This article describes a method you can use to search for all company

names beginning with a certain letter(s).

More Information:

One way to prompt users for a search character is to create a

parameter query. A parameter query is a query in which the user enters

a parameter, in this case the first letter of the company name, to

complete the query. In the following example, the LIKE operator is

used with the asterisk wildcard (*) to match all names beginning with

the letter entered.

1. Start Microsoft Access and load the Northwind Traders sample

   database (NWIND.MDB).

2. Create a new query and add the Customer List table.

3. Drag the Customer Name field down to the query grid.

4. Type the following in the Criteria cell for the field:

      Like "|[Enter the first char to search by: ]|*"

5. Run the query.

6. Type "G" (without the quotation marks) to the query parameter

   "Enter the first char to search by." Notice that all customer names

   beginning with the letter G display in the query dynaset.

You can also type "Gr," for example, to generate a list of all company

names beginning with "Gr."

To perform the same query as above on an unbound form:

1. Start Microsoft Access and load the Northwind Traders sample

   database (NWIND.MDB).

2. Create a new unbound, blank form and put a text box control on it.

3. Create a new query and add the Customer List table.

4. Drag the Customer Name field down to the query grid.

5. Type the following in the Criteria cell for the field:

      Like "|[forms]![form2]![junk] & "*"|"

6. Browse the form and type a letter to search for, such as "G"

   (without the quotation marks), in the text box.

7. Run the query.

You should see a dynaset of all company names that start with the

letter G. If you want to further refine the search, type "Gr" (without

the quotation marks), for example, then press SHIFT+F9 on the query

grid to initiate a requery.

Reference(s):

For more information, search for "parameter query," then "Creating a

Parameter Query" using the Help menu.

References


INF: OnCurrent Is Not Triggered on Unbound Forms

 Article Number: Q88687

 CREATED: 30-AUG-1992

 MODIFIED: 15-NOV-1992

Summary:

If a form is unbound, macros or modules bound to the OnCurrent

property will not be executed. In order to modify properties that can

be changed at run time, the macro or module must be bound to either

the OnOpen property of the form or the OnEnter property of the first

control in the tab order of the form.

More Information:

You can use the OnOpen property to trigger a macro or module each time

a form is opened. Changes made to properties, such as Visible, will

occur BEFORE the form is displayed. This allows you to make changes

that the user does not see.

If, however, you want the user to see the changes taking place, the

macro must be run after the OnOpen property.

Example

-------

This example creates a simple form with a text box attach to the form.

The macro that is triggered automatically sets the Visible property of

the text box to On and Off alternately so that it appears to the user

that the text box flashes several times when the form is opened.

Note: You cannot change the Visible property of a control that has the

focus, so there must be at least one other object on your form that

can get the focus.

1. From the File menu, choose New, and select Form.

2. Leave the Select A Table/Query box blank and choose the Blank

   Form button.

3. Select the Text Box tool from the Toolbox and click on the form

   to add a new unbound text box. Set the following properties:

      Control Name: Text0

      Control Source: ="Hello World"

4. Add a second text box with the following property:

      Control Name: = Text2

5. Save the form as "Flash" by choosing Save from the File menu.

6. Open a new macro and choose Macro Names from the View menu. Add the

   following macro names and actions:

   Macro Name        Action

   -------------------------------

   Repeat It         GoToControl

                     RunMacro

   Flash             SetValue

                     RepaintObject

                     SetValue

                     RepaintObject

   Repeat It Actions

   -----------------

   GoToControl

      Control Name: Text2

   RunMacro

      MacroName: Flashing Macros.Flash

      Repeat Count: 2

   Flash Actions

   -------------

   SetValue

      Item: Forms![Flash]![Text0].Visible

      Expression: No

   RepaintObject

      Object Type: Form

      Object Name: Flash

   SetValue

      Item: Forms![Flash]![Text0].Visible

      Expression: Yes

   RepaintObject

      Object Type: Form

      Object Name: Flash

7. Close and save the macro group as "Flashing Macros".

8. Return to the form Flash. Display the property sheet, select the

   control Text0, and set the following properties:

      OnEnter:  Flashing Macros.Repeat.

References


INF: Importing Several dBASE Databases at Once

 Article Number: Q88764

 CREATED: 31-AUG-1992

 MODIFIED: 21-APR-1993

Summary:

This article discusses how to import dBASE databases in a batch

process using Microsoft Access Basic.

One of the first things that many new Microsoft Access users do when

they begin using the product is import data from the system they are

currently using. The Import Dialog in Microsoft Access allows you to

import one table at a time. This is usually enough to do the job.

However, some users may have numerous tables to import. Furthermore,

importing a number of tables might be a common task for some.

This article assumes that you have some experience working with the

Microsoft Access Basic programming environment and that you can create

and use Microsoft Access tables for data entry.

More Information:

Importing tables through a batch process can be done fairly easily

using a Microsoft Access Basic procedure and a table. This procedure

is designed for importing dBASE databases only, but it can be easily

modified to accommodate other file formats.

A "batch" table will be used as a list of which tables you want to

import. The Microsoft Access Basic procedure will read the table and

import each foreign table listed in the batch table.

The table must be called "Batch Import" and have the following

structure:

   Field Name         Type   Length

   --------------------------------

   Source Directory   Text     50

   Source Database    Text     50

   Imported Name      Text     50

   Type of Table      Text     50

Once you have created the table, fill it with information on what

tables you want to import. The list below shows what information you

should add to each field in the Batch Import table:

Source Directory - This is the full path reference of the location of

                   the database file; for example, C:\DBASE.

Source Database -  This is the name and extension of the dBASE

                   database you want to import; for example,

                   CUSTOMER.DBF.

Imported Name -    This is the name you want the table to have once it

                   is imported into Microsoft Access; for example,

                   "Customer Table".

Type of Table -    This can be either dBASE III or dBASE IV. Specify

                   "dBASE III" for both dBASE III and dBASE III PLUS

                   databases.

As an example of the data you would add to this table, suppose you

want to import a dBASE IV database called C:\DBASE4\EMPLOYEE.DBF and a

dBASE III database called D:\DBASE3\DATA\ORDERS.DBF. You would add the

following two records to the table:

Source Directory     Source Database   Imported Name     Type of Table

----------------------------------------------------------------------

C:\DBASE4            EMPLOYEE.DBF      Employee Table    dBASE IV

D:\DBASE3\DATA       ORDERS.DBF        Orders Table      dBASE III

In addition to creating and filling the table above as instructed, you

must create a new module and add the procedure listed below. Note that

the line that starts with "DoCmd" is broken into three lines to fit in

this article. Make sure that the entire instruction is only on one

line when you type or copy this procedure into your module.

Sub BatchImport ()

   Dim B_DB As Database, B_TBL As Table

   Set B_DB = CurrentDB()

   Set B_TBL = B_DB.OpenTable("Batch Import")

   DoCmd Hourglass True

   B_TBL.MoveFirst

   Do Until B_TBL.EOF

      DoCmd TransferDatabase A_IMPORT, B_TBL![Type of Table],

       B_TBL![Source Directory], A_TABLE, B_TBL![Source Database],

       B_TBL![Imported Name], False

      B_TBL.MoveNext

   Loop

   DoCmd Hourglass False

End Sub

Once you have added and saved this procedure, you can invoke the

process of importing the databases named in the Batch Import table by

following these instructions:

1. Open a module window if none are already open.

2. Bring up the Immediate window by choosing View, Immediate Window.

3. In the Immediate window, enter the following command:

      BatchImport

After you enter the command, the mouse pointer will become an

hourglass and remain that way until all the databases are imported.

This process may take several minutes, depending on the size of the

databases you are importing.

References


INF: How to Modify the Toolbar in Microsoft Access

 Article Number: Q88907

 CREATED: 03-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

Although Microsoft Access does not include any end-user features for

modifying the toolbar at the top of the screen, you can modify the

toolbar if you know how to design a form and write Access Basic code.

This article discusses where toolbars are stored, how they work, and

how you can modify them.

NOTE: Modification of the toolbar was not intentionally designed into

Microsoft Access, so you may run into situations where your

modifications do not work. Test your modifications on noncritical

databases, since making these modifications is not guaranteed to work

correctly in every instance.

This article assumes that you have some experience with designing

forms and writing procedures in Access Basic.

More Information:

The various toolbars that appear when you are using Microsoft Access

are nothing more than forms stored in a database--the same kind of

forms that you create in Microsoft Access. These forms are stored in

UTILITY.MDA, a system database file that is loaded into memory when

you start Microsoft Access.

You cannot simply start Microsoft Access and open UTILITY.MDA to

modify these forms, however. This is because UTILITY.MDA is loaded as

a library database when you are using Microsoft Access, and Microsoft

Access does not allow you to open a library database while it is

active. To work around this, do the following:

1. Quit Microsoft Access if you have it open and make sure that no

   instances of Microsoft Access are active.

2. Choose the MS-DOS Prompt icon in Program Manager and type the

   following commands at the MS-DOS command prompt (the example below

   assumes that your Microsoft Access system files are stored in a

   directory called C:\ACCESS):

      C:>CD \ACCESS

      C:\ACCESS>COPY UTILITY.MDA UTILITY.NEW

3. Start Microsoft Access.

At this point, you can begin modifying the toolbars in UTILITY.NEW.

Open UTILITY.NEW as a database (a couple alerts will appear about

loading duplicate procedure names; ignore these alerts by choosing the

OK button). In the Database window, switch to Form view and note the

names of the forms. The forms in the Database window that end with the

characters "TB" are toolbar forms. At this point, you can open a

toolbar form and make a modification. After the modification is made,

you can change a setting in your MSACCESS.INI file that will force

Microsoft Access to use UTILITY.NEW instead of UTILITY.MDA as its

utility database.

It is important to point out that any functionality you add to new

controls on the toolbars must be supported by Access Basic--do not use

macros, as they will not work for this purpose.

The example below illustrates how you can add a toolbar button to your

form design toolbar that will toggle the toolbox on and off:

 1. Open the form called FDTB in design mode. This is the toolbar that

    appears when you bring up a form in design mode as you are doing

    at this point.

 2. Add a small command button next to right of the "paint palette"

    toolbar button on the form. Make sure your button does not overlap

    any other controls and that it does not alter the height of the

    form.

 3. For the button's OnPush property, specify:

       =ToggleToolBox()

 4. Save and close the form.

 5. Create a new module called NewToolBarFunctions and add the

    following function:

    Function ToggleToolBox ()

        DoCmd DoMenuItem 3, 2, 8

        ' The DoCmd command above invokes the forms design menu item

        ' View->Toolbox

    End Function

 6. Save and close the module and close the database.

 7. Quit Microsoft Access.

 8. From Program Manager, open Notepad.

 9. In NotePad, open the file MSACCESS.INI from your Windows program

    directory.

10. In MSACCESS.INI, locate the [Options] section and modify the

    UtilityDB= line to read:

       UtilityDB=C:\ACCESS\UTILITY.NEW

11. Save and close MSACCESS.INI and start Microsoft Access.

12. Open any database, and open any form in design mode. Note that the

    button you added appears in the toolbar. Click the button to turn

    the toolbox on and off.

In the same way you modified your form design toolbar using the steps

above, you can make other modifications to add functionality to your

Microsoft Access toolbars.

References


INF: Running MS-DOS SHARE with Windows for Workgroups

 Article Number: Q88914

 CREATED: 03-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

During the installation of Microsoft Access, Setup automatically

inserts the following MS-DOS command in the AUTOEXEC.BAT file:

   <MS-DOS directory>\SHARE.EXE /L:500

If you are running the Microsoft Windows for Workgroups operating

system, it is recommended that this SHARE command be removed.

More Information:

Windows for Workgroups has its own sharing mechanism (VSHARE.386),

which is loaded with Windows (there is an entry for it in the

SYSTEM.INI file). VSHARE.386 is intended as a drop-in replacement for

SHARE.EXE.

SHARE.EXE is dependent on the number of locks specified with the /L:

parameter (with a default of 20). VSHARE.386, on the other hand,

dynamically allocates the number of locks.

Because VSHARE.386 is an enhanced mode virtual device driver (VxD), it has

features which improve file sharing when running in enhanced mode. Because

it was designed to work with Windows for Workgroups, VSHARE.386 has

features that make it "friendlier" than SHARE.EXE, especially in access

control. If SHARE.EXE is loaded and you start Windows for Workgroups in

enhanced mode, VSHARE.386 takes over as the file sharer until you exit

Windows. If you usually run Windows for Workgroups in enhanced mode, you

might not need to run SHARE.EXE at all, saving you 5K or more of

conventional memory. The number of available locks is very important if you

are using your Windows for Workgroups machine as a network server.

References


INF: Using the GetSystemMetrics API Call in Access Basic

 Article Number: Q88922

 CREATED: 03-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

In the Windows environment, various display resolutions may cause

screens to appear out of proportion. As a developer, you can obtain

the width and height of various elements of the window display using

the Windows API function GetSystemMetrics. Incorporating this function

into an Access application gives the developer more information in

designing the user interface.

This article describes the GetSystemMetrics API function and discusses

a sample application that uses the function to display various object

sizes in a message box.

More Information:

The Windows GetSystemMetrics API function retrieves information about

the system metrics (the width and height of various display elements

of a particular window). The GetSystemMetrics function can also return

flags that indicate whether a mouse is present or if the meaning of

the left and right mouse buttons have been reversed. System metrics

are dependent upon the system display, and may vary from display to

display.

To use the GetSystemMetrics functions, do the following:

1. Place the following Declare statement in the global section of the

   Access Basic Code window:

      Declare Function GetSystemMetrics% Lib "user" (ByVal nIndex%)

2. Depending on what Window property you want to determine, you must

   define the correct constant to pass to the GetSystemMetrics

   function. Below are example declarations of the constants and their

   appropriate meaning:

     Const SM_CXSCREEN = 0        ' Width of screen

     Const SM_CYSCREEN = 1        ' Height of screen

     Const SM_CXFULLSCREEN = 16   ' Width of window client area

     Const SM_CYFULLSCREEN = 17   ' Height of window client area

     Const SM_CYMENU = 15         ' Height of menu

     Const SM_CYCAPTION = 4       ' Height of caption or title

     Const SM_CXFRAME = 32        ' Width of window frame

     Const SM_CYFRAME = 33        ' Height of window frame

     Const SM_CXHSCROLL = 21      ' Width of arrow bitmap on

                                  '  horizontal scroll bar

     Const SM_CYHSCROLL = 3       ' Height of arrow bitmap on

                                  '  horizontal scroll bar

     Const SM_CXVSCROLL = 2       ' Width of arrow bitmap on

                                  '  vertical scroll bar

     Const SM_CYVSCROLL = 20      ' Height of arrow bitmap on

                                  '  vertical scroll bar

     Const SM_CXSIZE = 30         ' Width of bitmaps in title bar

     Const SM_CYSIZE = 31         ' Height of bitmaps in title bar

     Const SM_CXCURSOR = 13       ' Width of cursor

     Const SM_CYCURSOR = 14       ' Height of cursor

     Const SM_CXBORDER = 5        ' Width of window frame that can't

                                  '  be sized

     Const SM_CYBORDER = 6        ' Height of window frame that can't

                                  '  be sized

     Const SM_CXDOUBLECLICK = 36  ' Width of rectangle around the

                                  '  location of the first click. The

                                  '  second click must occur in the

                                  '  same rectangular location.

     Const SM_CYDOUBLECLICK = 37  ' Height of rectangle around the

                                  '  location of the first click. The

                                  '  second click must occur in the

                                  '  same rectangular location.

     Const SM_CXDLGFRAME = 7      ' Width of dialog frame window

     Const SM_CYDLGFRAME = 8      ' Height of dialog frame window

     Const SM_CXICON = 11         ' Width of icon

     Const SM_CYICON = 12         ' Height of icon

     Const SM_CXICONSPACING = 38  ' Width of rectangles the system

                                  ' uses to position tiled icons

     Const SM_CYICONSPACING = 39  ' Height of rectangles the system

                                  ' uses to position tiled icons

     Const SM_CXMIN = 28          ' Minimum width of window

     Const SM_CYMIN = 29          ' Minimum height of window

     Const SM_CXMINTRACK = 34     ' Minimum tracking width of window

     Const SM_CYMINTRACK = 35     ' Minimum tracking height of window

     Const SM_CXHTHUMB = 10       ' Width of scroll box (thumb) on

                                  '  horizontal scroll bar

     Const SM_CYVTHUMB = 9        ' Width of scroll box (thumb) on

                                  '  vertical scroll bar

     Const SM_DBCSENABLED = 42    ' Returns a non-zero if the current

                                  '  Windows version uses double-byte

                                  '  characters, otherwise returns

                                  '  zero

     Const SM_DEBUG = 22          ' Returns non-zero if the Windows

                                  '  version is a debugging version

     Const SM_MENUDROPALIGNMENT = 40

                                  ' Alignment of popup menus. If zero,

                                  '  left side is aligned with

                                  '  corresponding left side of menu-

                                  '  bar item. If non-zero, left side

                                  '  is aligned with right side of

                                  '  corresponding menu bar item

     Const SM_MOUSEPRESENT = 19   ' Non-zero if mouse hardware is

                                  '  installed

     Const SM_PENWINDOWS = 41     ' Handle of Pen Windows dynamic link

                                  '  library if Pen Windows is

                                  '  installed

     Const SM_SWAPBUTTON = 23     ' Non-zero if the left and right

                                  ' mouse buttons are swapped

The following example call will return the height of the caption bar

of a form:

   HeightY% = GetSystemMetrics(SM_CYCAPTION)

References


INF: The Immediate Window for More than Access Basic

 Article Number: Q88925

 CREATED: 03-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

The Immediate window is helpful for debugging Access Basic code in

that you can type out an expression to see if it returns the expected

value or any value. The Immediate window can also be helpful for

debugging macros, learning how to use expressions, and more. Even

though the Immediate window has many uses, it is only available when

focus is on a module window. This article discusses how you can make

the Immediate window available at all times.

More Information:

The Immediate window allows you to type an expression and see the

results of that expression without having to write and run an Access

Basic procedure. For example, you can use the Access Basic '?' command

in the Immediate window as shown below:

   ? 2 + 2

When you type this statement in the Immediate window and press Enter,

Microsoft Access displays the number 4 just below the expression.

Another example of using the Immediate window is to set the value of a

variable or to test for the value of a variable. For example:

   MyVar = 2

   ? MyVar

The '?' statement returns the number 2 since that is the value you

gave to the variable 'MyVar'.

The Immediate window is helpful for debugging Access Basic code. One

reason is because you can suspend execution of the procedure and set

values of variables in the procedure to see what kind of result you

would get depending on different values. Another way an Immediate

window can be helpful is to suspend a procedure and check for the

value of a given variable or expression to see if it is calculating as

expected.

In the same way that an Immediate window can be helpful for debugging

code, it can also be helpful for more common tasks, such as:

 - Trying out a form expression such as Forms!MyForm!MyControl to see

   if it returns a value.

 - Trying out a query expression such as a DSum().

 - Trying out a macro action in the Immediate window using DoCmd to see

   if a certain macro action produces the desired results.

The Immediate window is not always accessible via the menu at the top

of the screen.  In fact, it is only visible and accessible when focus

is on a module window.  In order to have the Immediate window

available at all times, follow these steps:

1.  In the database window, choose the 'Macro' button.

2.  If you already have a macro called AutoKeys, open it up in design

    mode.  Otherwise, choose the 'New' button.

3.  If the 'Macro Name' column does not appear in the macro sheet,

    choose macro command from the View menu.

4.  If the 'Condition' column does not appear in the macro sheet,

    choose the Conditions command from the View menu.

5.  Add the following action and it's corresponding property:

    Macro Name    Condition                                 Action

    -----------------------------------------------------------------

    ^I                                                      SendKeys

                                                            DoMenuItem

                                                            SendKeys

                  MsgBox ("IW already on the screen?")=7    DoMenuItem

    SendKeys Action Parameters

    --------------------------

    KeyStrokes: {F11}

    Wait:       Yes

    DoMenuItem Action Parameters

    --------------------------

    Menu Bar:  Database

    Menu Name: View

    Command:   Modules

    SendKeys Action Parameters

    --------------------------

    KeyStrokes: %N

    Wait:       Yes

    DoMenuItem Action Parameters

    --------------------------

    Menu Bar:  Module

    Menu Name: View

    Command:   Immediate Window

6. Close and save the macro.  If the macro is not already called

   AutoKeys, save it with that name.

From this point on, you can press Ctrl-I to activate the Immediate

window. Follow these steps for an example of how this works:

1. Open any form in design mode

2. Press Ctrl-I

   After some screen activity, a prompt appears asking if the

   Immediate window is already on the screen. If you do not see the

   Immediate window on the screen, choose 'No'. Doing so causes

   the macro to execute one extra step that would otherwise not be

   necessary.

   Notice that a module window, sized to only a portion of the caption

   bar, appears at the upper right-hand side of the screen.

   The Immediate window is now available to use.

3. Click once on the form design window or on the database window.

   The Immediate window disappears.

4. Click once on the module window mentioned in step 2.

   The Immediate window reappears.

You should only need to use Ctrl-I once to make the Immediate window

and shrunken module window appear. Every subsequent request for the

Immediate window can be made by clicking once on the module window. If

the module window is closed, press Ctrl-I to bring up the Immediate

window again.

References


INF: Cannot Group on Memo or OLE Object in Query

 Article Number: Q88926

 CREATED: 03-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

If you attempt to create a Select, Update, or Append query that groups

on a Memo or OLE object, you will receive the following error message:

   Can't group on Memo or OLE object (<clause>).

Access cannot group by a Memo or OLE object in a query. Also, the

GROUP BY clause of a SQL statement cannot include Memo or OLE Object

fields. To include a Memo or OLE Object field in a totals query, drag

the field to the QBE grid and select the aggregate function First or

Last in the Total row for that field.

More Information:

You can group by the first n characters in a memo field by using an

expression. For example, you can enter the following expression to

Group By the Left 25 bytes of a Memo field called Description:

   Expr:Left([Description],25)

Choose the Totals button on the tool bar, and in the Total row select

Group By as the option for the expression. Expr is the name of the

column header in Datasheet view.

Reference(s):

Online Help topic titled "Calculating Totals in a Query"

References


INF: Sorting/Grouping a Query Using a Portion of a Field Value

 Article Number: Q88927

 CREATED: 03-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

You can sort or group a query using a portion of a field's value. For

example, in the NorthWind sample database, you can create a query

based on the Employees table that sorts by six characters starting

with the fourth character position in the Last Name field using this

expression:

   Sort String:Mid([Last Name],4,6)

Click the Sort cell in the QBE grid for the Last Name field. Click the

down arrow and select an option. (In order to group by the expression,

choose the Totals button on the tool bar and select Group By in the

Totals row as the option for the expression.)

Sort String is the name of the column header in Datasheet view. You

can name the column any way you like.

Use the Left and Right functions to return the leftmost and rightmost

characters of a string argument.

More Information:

This technique is useful in a situation where a field contains values

that have a set number of leading or trailing characters that are

insignificant to your sort. An example of this might be a part number

field called PartNo that contains values such as the following:

   PartNo

   ------

   A-453-34567

   A-123-45675

   B-234-75658

   B-645-65758

and so on.

In order to sort using only the third through the fifth characters,

use an expression like this:

   Expr:MID([PartNo]),3,3)

See online Help in Access for more information on String functions

and related functions such as Left, Right, and Len.

References


INF: Generating a Random Temp File Name

 Article Number: Q88929

 CREATED: 03-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

This article discusses a function that can generate a random file name

usable as a temp file.

This article assumes that you have some experience with writing

procedures in Access Basic.

More Information:

Sometimes it is necessary for an application to create a file that is

used temporarily, then deleted. The name of temporary files are

important because you do not want your application to inadvertently

overwrite an existing file.

In such cases, you can create and use the user-defined function

discussed below called MakeTempFileName(). This function accepts a

file extension and returns a string representing a  non-existent

random filename with the file extension you specified. The filename

includes a path to your Windows TEMP  directory so that the actual

temp file is placed in the same directory Windows uses to write its

temp files. This is handy  for those who perform periodic maintenance

on their hard drive partially by deleting any leftover temp files in

the Windows directory.

In the following example, which you can type in the Immediate window,

MakeTempFileName() returns a name that is used as a text file.  The

text file is filled with some text, then deleted:

   TempFileName$ = MakeTempFileName("TMP")

   Open TempFileName$ For Output As #1

   Print #1, "This is a line of text"

   Close #1

   Kill TempFileName$

The MakeTempFileName() function is listed below:

   Function MakeTempFileName (Extension As String) As String

      On Error Resume Next

      IsFile% = False

      FHandle% = FreeFile

      Do

         WinTemp$ = Environ("TEMP") & "\"

         For Cntr% = 1 To 8

         WinTemp$ = WinTemp$ & Mid(LTrim(Str(CInt(Rnd * 10))), 1, 1)

         Next

         TF$ = Trim(WinTemp$) & "." & Extension

         Open TF$ For Input As #FHandle%

      Loop While Err > 0

      Close #FHandle%

      MakeTempFileName = TF$

   End Function

References


INF: How to Dim (Gray) Menu Items with Access Basic

 Article Number: Q88940

 CREATED: 03-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

Access Basic does not have a command that allows you to dim (make

unavailable) a menu item. There are also no properties associated with

a form that enable you to set this menu characteristic.

To change such characteristics of a menu item, you can use Windows API

functions.

For more information about the structure of the Access menu system,

query on the following words in the Microsoft Knowledge Base:

   MENU and SYSTEM and FINDWINDOW and GETMENU and GETSUBMENU

More Information:

The following API function is used to dim a menu item:

EnableMenuItem% (hMenu%, wIDEnableItem%, wEnable%)

--------------------------------------------------

This function enables, disables, or grays a menu item.

   hMenu%         Specifies the menu.

   wIDEnableItem% Specifies the menu item to be checked. The

                  wIDEnableItem% parameter can specify pop-up menu

                  items as well as menu items.

   wEnable%       Specifies the action to take. It can be a

                  combination of MF_DISABLED, MF_ENABLED, and

                  MF_GRAYED. These values can be combined by using

                  the bitwise 'OR' operator.

   Return Value   The return value specifies the previous state of the

                  menu item. The return value is -1 if the menu item

                  does not exist.

Example

-------

The following example designs a menu that dims a menu item:

1. Create a new macro. After adding the following actions and their

   associated properties, save the macro and name it "Menu

   Manipulation Macro." To display the "Macro Name" column, choose the

   Macro Name command from the View menu.

    Macro Name             Action        Function Name

    ----------------------------------------------------------

    GrayItem               RunCode       Gray_Menu_Item(0,0)

    UnGray                 RunCode       UnGray_Menu_Item(0,0)

2. Create a new macro. After adding the action below and its

   associated property, save the macro as "Custom Demo Menu."

   Macro Name             Action        Function Name

   ----------------------------------------------------------

   Top Level Menu         AddMenu

   [Top Level Menu].AddMenu Action Arguments

   -----------------------------------------

   Menu Name          &Gray

   Menu Macro Name    Menu Manipulation Macro

3. Create a new blank form and display the Properties window of the

   form by choosing the Properties command from the View menu.

4. Set the OnMenu property to "Custom Demo Menu."

5. From the File menu, choose Close to close the form. Save the form

   as "Menu Manipulation Form."

6. Create a new module from the Database window. Within the new

   module, enter the Access Basic code listed further below. Save the

   module as "Menu Manipulation Code."

7. From the Database window, select the Menu Manipulation Form and

   then choose the Open button to display the form in Form view. The

   normal Access menu disappears and is replaced by the custom

   menu you created in the previous steps.

8. There are two options on the menu. Choose the GrayItem command and

   the command is dimmed (grayed). Choosing the UnGray command

   makes the GrayItem menu command available.

'********************************************************************

'Declarations section of the module.

'********************************************************************

Option Explicit

'Note: Each Declaration must be placed on a single line.

Declare Function FindWindow% Lib "user" (ByVal lpClassName_

                    As Any, ByVal lpCaption As Any)

Declare Function GetMenu% Lib "user" (ByVal hWnd%)

Declare Function GetSubMenu% Lib "user" (ByVal hSubMenu%,_

                    ByVal nPos%)

Declare Function EnableMenuItem% Lib "user" (ByVal hMenu%,_

                    ByVal wItem%, ByVal wEnable%)

Declare Function IsZoomed% Lib "User" (ByVal hWnd%)

Const MF_BYPOSITION = &H400

Const MF_GRAYED = &H1

Const MyNull = 0&

Const ClassName = "OMain"

Dim ChWnd%       'handle to the Microsoft Access window.

Dim hMenuTop%    'handle to the Microsoft Access menu.

Dim hSubMenu%    'handle to the pop-up menu

Dim ItemID%      'command ID associated with menu item.

Dim ReturnVal%

'===========================================================

'This function initializes:

'

' - The window handles associated with the Access form.

' - The handle to the menu of the specified window.

' - The menu handle of the specified pop-up menu of the window menu.

'

'The variables here are global to the database.

'===========================================================

Sub Get_Menu_Handles (TopLevel%)

   ChWnd% = FindWindow(ClassName, MyNull)

   hMenuTop% = GetMenu(ChWnd%)

   hSubMenu% = GetSubMenu(hMenuTop%, TopLevel%)

End Sub

'===========================================================

'This function dims a menu item. The text of a dimmed

'menu item appears in light gray text on the menu,

'but does not allow the user to select the item either by

'mouse or keypad. The macro action associated with the

'menu item does not execute when the user tries to select

'the menu item.

'===========================================================

Function Gray_Menu_Item (TopLevel%, SubLevel%)

   'If the form is maximized, the system menu is added to the forms

   'menu bar, so increment the actual TopLevel%

   If (IsZoomed(Screen.ActiveForm.hWnd)) Then

      TopLevel% = TopLevel% + 1

   End If

   Call Get_Menu_Handles(TopLevel%)

   Gray_Menu_Item = EnableMenuItem(hSubMenu, SubLevel%,_

                        MF_GRAYED Or MF_BYPOSITION)

End Function

'===========================================================

'This function does not ungray a menu item that also enables

'the menu item so the user can select the item and run the

'macro associated with the menu.

'===========================================================

Function UnGray_Menu_Item% (TopLevel%, SubLevel%)

   Call Get_Menu_Handles(TopLevel%)

   UnGray_Menu_Item = EnableMenuItem(hSubMenu, SubLevel%,_

                          Not MF_GRAYED And MF_BYPOSITION)

End Function

References


INF: Deciding When to Use Macros and When to use Access Basic

 Article Number: Q88999

 CREATED: 06-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

Because Access provides two forms of programming, macros and Access

Basic, there is the potential for confusion as to when you should use

one form of programming rather than the other. This article discusses

some tips on how to choose between macro programming and Access Basic

programming.

More Information:

Access has a very effective user interface that is powerful enough to

accommodate most needs. However, like many other database products,

Access provides the user with the ability to develop his or her own

way to manipulate the power of the product.

One distinct advantage of Access over other products is that the user

has a choice of two levels of programming: macros and Access Basic.

These two programming languages are designed to complement each other.

As a rule, you should write your applications using macros and then

supplement the application with SUB and FUNCTION procedures when you

encounter a programming situation that a macro cannot easily

accommodate.

Wizards are an example of a program you can write that is beyond the

capability of a macro. Wizards require functionality that cannot be

duplicated by a series of macro actions. Having to resort to Access

Basic should not be a common occurrence for most mainstream database

applications, however.

Knowing when to use modules instead of macros is easier when you

understand how Access works. If you understand and are familiar with

Access, you will find that it is easier to determine when modules are

required to accomplish a specific task.

New users of Access will likely be surprised at the ease, power, and

versatility that Access macros can provide.

References


PRB: Arrange Icons Doesn't Work on More Than 40 Windows.

 Article Number: Q89546

 CREATED: 24-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 10

SYMPTOMS

   When Microsoft Access has more than 40 Windows open, selecting

   Window, Tile or Cascade does not work.

CAUSE:

   This is functionality totally provided by windows. Windows

   allocates memory to do the arrange function of icons. If you have

   enough windows open the system sometimes fails to do the

   allocation.

RESOLUTION

   Successive tries sometimes makes it work. Close the number of

   windows open.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open and minimize 40 document windows

2. Move the icons around a bit

3. Windows Arrange Icons

4. Result: No change

References


PRB: Floating Objects in Access Cause Unusual Effects

 Article Number: Q89548

 CREATED: 24-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Floating objects such as the Toolbox, the Properties window, and the

   Immediate window cause unrecognizable effects in Microsoft Access.

   Objects can obscure underlying data from view, and an underlying

   object can be obscured from view even if it has the focus or is

   selected, and the drop down menu for the object's corresponding option

   on the menu bar can appear separated from the object.

CAUSE

   These effects are caused by the different Windows style properties

   of the windows.

RESOLUTION

   To minimize the impact of this behavior, keep the floating objects

   from overlaying your work area by moving or closing them when

   not needed.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce:

-------------------

Menu not Connected to the Option on the Menu Bar

1. Bring up a form in design mode.

2. Display the color palette by choosing the palette button or

   choosing Palette from the View menu.

3. Position the palette so it partially obscures a choice on the menu

   bar.

4. Choose the menu by clicking on it with the mouse or using the

   appropriate keystroke combination.

5. The drop down menu related to that menu bar choice should then be

   displayed. At this time, top level menu item will not overlap the

   palette, but the popup menu will overlap, giving a disjoint look.

Immediate Window Obscures Code During Replace Operation.

1. Bring up a module in design mode.

2. Display the immediate window by choosing Immediate Window from the

   View menu.

3. Position the immediate window so it obscures a section of code in

   the module window.

4. Start a replace operation that would attempt to replace a piece of

   code in the section of code which is obscured by the immediate window.

   To do this choose Replace from the Edit menu, enter the information to

   find and replace, and choose Verify.

5. When Access finds the information which is obscured by the

   immediate window, the dialog box which asks you to verify that you

   want to change that information is displayed but you can't see the

   code.

Reference(s):

"Microsoft Access User's Guide" version 1.0, page 195.

"Microsoft Access Basic: Introduction to Programming" version 1.0,

Chapter 1 pages 2-3, Chapter 4, pages 9-10.

References


PRB: Table Design Doesn't Check Validity of Default Value

 Article Number: Q89549

 CREATED: 24-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 3466

SYMPTOMS

   The default value is not checked according to the validation of a

   the field. For example, if the default value for a numeric field is

   100 and the validation rule says that the field must be greater

   than 1000, table design will not check the validity of what is

   contained in the default value. If you add a new record and simply

   tab/move over the field that has the default value in it without

   changing it, the validation rule will not flag the value as an

   error. Once you change the default value, the validation rule will

   be in effect.

RESOLUTION

   This behavior is by design.

References


PRB: Reserved Words won't Format (Capitalize) in Module Window

 Article Number: Q89576

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOM

   When you type reserved words into a module window, the words

   usually format themselves once you move to another line so that

   they are easier to read. For example, if you type the following

   into a module window,

      dim q as querydef

   the line will reformat to look like this:

       Dim q As QueryDef

   However, not all reserved words are formatted automatically.

CAUSE

   This is by design. Microsoft Access capitalizes methods, such as

   Close and FindNext. However, properties, such as SQL, Format,

   RecordCount, and LastUpdated are not capitalized.

References


INF: Commenting a Macro Line to Temporarily Disable the Action

 Article Number: Q89577

 CREATED: 27-SEP-1992

 MODIFIED:  6-DEC-1992

Summary:

Programming languages such as Access Basic typically provide a way to

temporarily disable any syntax on a line of code. For example, in

Access Basic, you can place a REM command at the front of a line of

code so that it is not executed. This is useful when you  want to

determine which line of code is causing an error by disabling one line

at a time until the error is no longer reproduced.

This method is also useful for debugging macros. This article

describes how you can temporarily disable a macro line so that it is

ignored.

More Information:

You can disable a macro action line without deleting it by doing the

following:

1. Open the macro sheet containing the line you want to disable.

2. If there is no Conditions column, choose Conditions from the View

   menu to open the Conditions column.

3. In the Conditions column on the line you want to disable, enter

   "False" if there is nothing in the column for that line, or "False

   And" if there is already a Condition entered in the column.

Now when you run the macro, the Condition for the macro action will

be evaluated as False, and the line will be ignored.

References


INF: Topics Supported by Access as a DDE Server

 Article Number: Q89586

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

Access supports dynamic data exchange (DDE) both as a client and as a

server. This article lists the five topics that Access supports as a

DDE server and the items that are valid on each of those topics.

This article does not explain what DDE is or how to implement it. For

more information on DDE, query on the following words in the Microsoft

Knowledge Base:

   DDE and <the name of application you want to use as a DDE client>

For information on using Access as DDE client, refer to Chapter 13 of

the "Microsoft Access User's Guide." For information on using Access

Basic code to exchange data with other applications, see to Chapter 9

of "Microsoft Access: An Introduction to Programming."

More Information:

The five topics supported by Microsoft Access are "System",

<Database>, <Table Name>, <Query Name>, and "SQL <statement>". Below

are descriptions of the five topics and the items that are supported

in each.

System

------

System is a standard topic for all DDE server applications. It returns

a list of the topics supported by Access. Valid items with the

System topic are as follows:

  SysItems - Returns a list of items supported by the topic "System"

  Formats  - A list of the formats Microsoft Access can post to the

             clipboard.

  Status   - Busy or Ready.

  Topics   - A list of all open databases.

In addition to requesting the four items above, you may send the name

of a macro to Access over a DDE channel initiated on the topic

System. If the macro is contained in the currently open database it

will be executed. A macro name is a valid item on each of the five

topics supported by Access.

<Database>

----------

<Database> is the filename of an existing database. This can be a

fully qualified pathname to the file and may include the .MDB

extension. You cannot query the SYSTEM.MDB via DDE. After you have

initiated a DDE link with a database, you may request a listing of the

objects in that database.

   TableList   - List of table*

   QueryList   - List of queries

   MacroList   - List of scripts

   ReportList  - List of reports

   FormList    - List of forms

   ModuleList  - List of modules

   MacroName - You may also send the name if a macro to be executed.

<Table Name> and <Query Name>

-----------------------------

These topics support the same items. When requesting the contents of a

table or the results of a query, you must specify the database the

object is in, followed by a semicolon (;), the keyword TABLE (or

QUERY), and then the name of an existing table or query:

   [db Name];TABLE <tbl/qry name>  or   [db Name];QUERY <tbl/qry name>

Examples: NWIND;Table Categories

         c:\Access\NWIND.MDB;Query Category List

Note: Do not place brackets ([ or ]) around table or query names.

You may specify the following items:

    All         - All the data in the table including the column

                  names.

    Data        - Returns all rows of data without the column names.

    FieldNames  - A list of Columns.

    NextRow     - Returns only the next row in the table/query. When

                  the conversation is first started NextRow returns

                  the first row. If the current row is the last record

                  and NextRow is executed the request will fail.

    PrevRow     - Returns only the previous row. If PrevRow is the

                  first request ever a new channel the last row of the

                  table/query is returned. If the current row is the

                  first record the request for PrevRow will fail.

    FirstRow    - Returns data in the first row of the table/query.

    LastRow     - Returns data in the last row of the table/query.

    FieldCount  - Count of columns in the table/query.

    MacroName   - You may also send the name if a macro to be

                  executed.

"SQL <expression>"

------------------

This topic will return the results of the specified SQL expression.

The syntax for SQL is [db Name];SQL <expression>.

Examples: NWIND;SQL Select * from Employees;

          c:\ACCESS\NWIND.MDB;SQL Select [First Name] from Employees;

Note: All SQL statements must end with a semicolon (;).

The Items supported on the Topic SQL are the same as those for <Table

Name> or <Query Name>.

References


INF: DoCmd and Transaction Processing

 Article Number: Q89587

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

In Microsoft Access, the DoCmd command will not be affected by a

Rollback command if the DoCmd is within a transaction.

More Information:

Transaction processing in Microsoft Access is only valid on virtual

table (VT) objects, such as dynasets. The DoCmd action will start

another session of Jet to process the arguments of the DoCmd. Since

Jet manages transaction processing, a new session of Jet will have its

own transaction management. The two are mutually exclusive, meaning

transactions in one are not managed or affected by the other.

Therefore, any action done by DoCmd within a transaction will not be

affected by a Rollback command.

The simplest workaround for this is to use a QueryDef.Execute action,

which uses a dynaset. NOTE: The QueryDef.Execute property works only

when a QueryDef is based on an action query (update, insert, delete)

that does not return a record set.

References


INF: Making ENTER Add Lines in a Text Box

 Article Number: Q89590

 CREATED: 27-SEP-1992

 MODIFIED: 22-JUN-1993

Summary:

Text boxes in Microsoft Access do not support using the ENTER key to

add lines within a field. When ENTER is pressed in a text box, the

focus is placed on the next field or control. This article explains

how to change the functionality of pressing ENTER in text boxes so

that it adds lines instead of changing the focus.

More Information:

The following function changes the behavior of the ENTER key in text

boxes to allow adding lines instead of changing the focus to a

different field or control. This code should be attached to the

BeforeUpdate event of the text box.

NOTE: There must be some change to the text box before this code will

work because Microsoft Access evaluates controls only after they have

been changed (dirtied).

In the Declarations section of a Module, type the following:

   Declare Function GetKeyState% Lib "user.exe" (ByVal nKey%)

   Const VK_RETURN = &HD

The following is the actual code:

   Function MakeEnterWork()

      If GetKeyState(VK_RETURN) < 0 Then

         DoCmd CancelEvent

         SendKeys "^{ENTER}"

      End If

   End Function

References


INF: Error() Function Does Not Return Detailed Information

 Article Number: Q89591

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

When errors are trapped in Microsoft Access Basic, the Error()

function returns a minimal message to the user. To receive full

extended error messages, use Error or Error$. For example, Error() or

Error$() might return "Table not found," whereas Error or Error$ will

return "Table MyTable not found."

More Information:

The following is an example of a common format for error handling in

Microsoft Access Basic using MsgBox to display the error text.

   MsgBox "Error #" & Err & ": " & Error(Err)

This line would say something like "Error #15: File | Not found" if

Err had trapped a "file not found" error.

To get the extended error message information, use:

   MsgBox "Error #" & Err & ": " & Error

Note the calling of Error and not Error(Err).

References


INF: DoEvents, SendKeys May Not Be Supported in UDFs

 Article Number: Q89592

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

Under certain circumstances, DoEvents and SendKeys are not supported

when they are called from user-defined functions (UDFs) with Microsoft

Access Basic.

More Information:

DoEvents and SendKeys are not supported in UDFs in the following

situations:

   - When calculating a field in a query

   - When calculating a control on a form or report

   - From an Embedded Basic Fill function for a list box, combo box, or

     OLE object

The DoEvents statement will not allow messages to be processed in

these circumstances; instead, it will immediately return. Thus, any

keys sent through SendKeys statements or functions will not be

processed until all the computations listed above have been completed

and responses have been returned to the user.

References


PRB: Autokeys Macros with the Same Name Are Still Executed

 Article Number: Q89593

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

You will receive an error if you save two Autokeys macros with the

same name; however, the duplicate macros will still be executed.

More Information:

Steps to Reproduce Problem

--------------------------

1. Create a new macro and add two macro names with the same name; for

   example:

      Macro Name        Action

      ------------------------

      ^z                MsgBox

      ^z                MsgBox

2. Save the macro as "Autokeys".

   The following error message appears:

      The key combination "Z" in 'Autokeys' is also assigned to

      another macro; only the first one will be used.

3. Choose the OK button, then press CTRL+Z (^Z).

   Both macros are executed, and two message boxes appear. However, if

   you put another macro between the two MsgBox macros, as follows

      Macro Name   Action

      -------------------

      ^z           MsgBox

      ^a           Beep

      ^z           MsgBox

   only the first MsgBox macro will be executed.

References


INF: How to Display Immediate Window Without Module Window

 Article Number: Q89594

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

Access version 1.0 does not display the Immediate window unless the

Module window is visible. This can be a problem if the user wants to

print to the Immediate window while in browse mode of a form. By

calling two Windows API functions from Access Basic, the Immediate

window can be displayed at any time, even without the Module window

visible.

More Information:

To display the Immediate window at any time, you will need to call the

FindWindow API function to get the handle to the Immediate window, and

then call the ShowWindow API function to make the actual window

visible. You can attach the Access Basic function that includes these

API functions to a command button, a SendKeys action in the Autokeys

macro, or add it to your Toolbar.

To display the Immediate window, do the following:

1. Create a new module, or open an existing module.

2. Add the following declarations to the Global section of the module:

   (You must include each declaration on a separate line, and each

   declaration must be entered on one line.)

   Option Explicit

   Declare Function ShowWindow% Lib "user" (ByVal hWnd%, ByVal nCmd%)

   Declare Function FindWindow% Lib "user" (ByVal lpClassName As Any,

                                           ByVal lpWindowName As Any)

3. Add the following ShowImmediateWindow function:

   Function ShowImmediateWindow ()

      Dim IhWnd%                ' Handle to the Immediate Window.

      Dim ApiResults%           ' Returns the previous state of IW.

      Const MyNull = 0&

      Const SW_SHOW = 5         ' Internal constant to show window.

      Const ClassName = "OImmediate"    ' Internal ClassName of IW.

      IhWnd% = FindWindow(ClassName, MyNull)

      ' Note that the MsgBox function must be on one line.

      If IhWnd% = 0 Then MsgBox _

                  ("You need to open the IW once for this to work.")

      ApiResults% = ShowWindow(IhWnd%, SW_SHOW)

   End Function

4. Attach the code to a command button of a form.

5. When you first start Access, the Immediate window is not displayed.

   When you open a module and display the Immediate window then close

   it, Access sets the window's Visible property to False. Calling

   ShowWindow will reset the Visible property to True. If you call

   this function without first displaying the Immediate window at

   least once, you will receive the error message, because Access has

   not created the Immediate window yet, and thus cannot return a

   window handle.

   For more information on how to display the Immediate window

   automatically from a module, query on the following words in the

   Microsoft Knowledge Base:

      immediate and window and macro

   With the information in the article referenced above, you can open

   the Immediate window with macros once, then use the code from this

   article to display the Immediate window at any time.

6. If you have registered the Immediate window with Windows by opening

   it at least once, pressing the command button of the form while in

   browse mode will display the Immediate window. Any Debug.Print

   statements will now be visible.

Note: This is unsupported code, and there may be instances when this

example will not work.

References


INF: Using Scroll Bars Doesn't Change Record Pointer

 Article Number: Q89595

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

In Datasheet view, the record pointer does not change if you scroll

using the scroll bars; likewise, the record number in the VCR control

does not change. However, keyboard actions, such as pressing PAGE

DOWN, do change the record pointer and record number.

To change the record pointer after scrolling, use the mouse to select

the record that you want to make the current record. This also updates

the record number in the VCR control.

More Information:

By using the scroll bars, you can view large amounts of information

without changing the record pointer. You can view other records by

either clicking one of the scroll bar arrows or by moving the thumb on

the scroll bar.

In contrast, keyboard actions always remain relative to the record

pointer regardless of what records are being viewed in Datasheet view.

References


INF: Using Microsoft Access Macro to Quit Windows

 Article Number: Q89596

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

It is possible to quit Microsoft Windows from within a Microsoft

Access program by making use of the Windows application programming

interface (API) function ExitWindows(). To do this, you must first

create a module that declares the ExitWindows() function. You can then

call the Microsoft Access function in a macro using the RunCode

action.

More Information:

The call to the Windows dynamic-link library (DLL) acts the same way

that using the Exit command on the File menu in Program Manager does.

Each application must agree to be closed (for example, if you choose

Cancel when an application asks you if you want to save a file, the

exit request is also canceled).

To create a Microsoft Access function for quitting Windows:

1. From the File menu, choose New, and select Module. In the

   Declaration section, type the following statements. Note that the

   Declarations statement is on one line.

      Option Explicit

      Declare Function ExitWindows% Lib "user" (ByVal dwReserved&,

                                                ByVal wReturnCode%)

2. Create a Microsoft Access function that calls the ExitWindows()

   function. Enter it in the following format:

      Function ExitNow ()

         RetVal% = ExitWindows(0, 0)

      End Function

   Save the module.

3. From the File menu, choose New, and select Macro. Add the following

   action and its properties:

      Action       Function Name

      --------------------------

      RunCode      ExitNow()

   Save the macro.

You can now add the macro to a form and use it like any other

Microsoft Access macro.

References:

"Microsoft Windows Software Development Kit," Microsoft Press, 1992

"Programming Windows: The Microsoft Guide to Writing Applications for

Windows 3," by Charles Petzold, Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference," Volumes 1-6, Microsoft Press, 1992

References


INF: Maximizing, Minimizing, and Restoring Access in Modules

 Article Number: Q89597

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

Use Windows' API calls in Microsoft Access modules to maximize,

minimize, and restore Microsoft Access. Microsoft Access does not

provide a function to perform these actions in a module or macro.

More Information:

Once these functions are defined in a module they can be used in a

macro as a RunCode action. Define the functions using the following

steps.

1. Choose New from the File menu. Then, choose Module. In the

   declarations section add both of the following declarations. Type

   each declaration statement on one line.

      Option Explicit

      Declare Function GetActiveWindow% Lib "User" ()

      Declare Function ShowWindow% Lib "User" (ByVal hWnd%,

                                               ByVal nCmdShow%)

2. Create the function MaximizeAccess().

      Function MaximizeAccess ()

         ActiveWnd% = GetActiveWindow()

         MaxIt% = ShowWindow(ActiveWnd%, 3)

      End Function

3. Create the function MinimizeAccess().

      Function MinimizeAccess ()

         ActiveWnd% = GetActiveWindow()

         MinIt% = ShowWindow(ActiveWnd%, 2)

      End Function

4. Create the function RestoreAccess().

      Function RestoreAccess ()

         ActiveWnd% = GetActiveWindow()

         RestoreIt% = ShowWindow(ActiveWnd%, 1)

      End Function

5. As an example of creating a macro that will minimize the Microsoft

   Access window, add the following action and it's properties to a

   macro.

      Action       FunctionName

      ------------------------------------

      RunCode      MinimizeAccess()

Reference(s):

"Microsoft Access Basic: An Introduction to Programming", Chapters 1-5

"Microsoft Access Language Reference", Part 1

"Microsoft Windows Software Development Kit", Microsoft Press, 1992

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3", Charles Petzold. Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference" Volumes 1 - 6, Microsoft Press, 1992

References


INF: ENTER in Text Box Does Not Move to Next Line

 Article Number: Q89598

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

The cursor in a multiline text box does not move to the next line in a

text box when you press the ENTER key; instead it moves to the next

control in the tab order on the form.

To move the cursor to the next line of a multiline text box, press

CTRL+ENTER.

This behavior is by design.

References


INF: END Key Behavior in Edit Boxes

 Article Number: Q89599

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

Pressing the END key in a form or table sometimes places the focus on

the last control in the tab order, while at other times it places the

cursor at the end of a string of characters in an edit box (for

example, a text box, list box, or combo box in a form, or a field in a

table.)

This behavior is by design.

More Information:

Once text is typed into an edit box (or table field), the Microsoft

Access text editor goes from "enter" mode to "edit" mode. "Enter" mode

means that the arrow (direction) and cursor-movement keys (such as

END, HOME, and so on) will move the focus from control to control.

"Edit" mode means the arrow and cursor-movement keys affect cursor

control within that control only.

Therefore, if no characters have been typed in the box, the END key

moves the focus to the last control in the tab order. If a character

has been typed in the box, the END key will move the cursor to the end

of the character string in the edit control.

Once the "edit" mode has been invoked, (pressing the function key F2)

pressing the TAB key moves the cursor to the next control and exits

"edit" mode.

References


INF: AutoExec Macro Invoked Only When Database Is Opened

 Article Number: Q89602

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

The AutoExec macro will not execute when a previously hidden database

is unhidden or when a minimized database window is maximized again.

The AutoExec macro will execute only when a database that has an

AutoExec macro is opened. It will not execute at any other time unless

it is called from Microsoft Access Basic or another macro.

References


PRB: Close Action from AB Does Not Trigger OnClose Errors

 Article Number: Q89603

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If a form refers to a nonexistent Microsoft Access Basic function

   in its OnClose property, no error message is generated when

   exiting the form through a Close action called from a Microsoft

   Access Basic function.

RESOLUTION

   To work around this problem, call a macro that issues the Close

   action, rather than calling a function that issues the Close

   action. (An example of how to do this is shown below.)

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here as it becomes available.

More Information:

Steps to Reproduce Problem

--------------------------

1. Create a module with the function "CloseMe()":

      Function CloseMe()

        DoCmd Close

      End Function

2. Save the module with the default name, "Module1".

3. Create a new form.

4. Set the following property of the new form:

      Form Property

      --------------

      OnClose:  =Bogus()

5. Place a command button on the form.

6. Set the following property of the command button:

      Command Button

      --------------

      OnPush:  =CloseMe()

7. Click the Form Browse button on the toolbar.

8. From the File menu, choose Close.

   The error message, "Unknown function name in 'OnClose' expression,"

   appears. However, if you browse the form again, and click the

   button again, you will exit the form without an error message, even

   though the same offending call to a nonexistent function is still

   in the form.

Instead of using an Access Basic function to exit the form, use a

macro to issue the Close action:

1. Create a new macro called "Closer" and add the following action and

   property:

      Action    Object Type    Object Name

      ------------------------------------

      Close     Form           Form1

2. Set the following properties of the command button:

      Command Button

      --------------

      OnPush:  Closer

Note that the correct error message is now generated when the button

is clicked.

References


PRB: New Label Controls Inherit FormWizards' Label Text Align

 Article Number: Q89604

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   After creating a form with certain FormWizards (Single-Column and

   Main/Subform), TextAlign properties of new Label controls placed

   on the new form will have different defaults than they do when

   using the Tabular and Graph FormWizards, or when creating a new

   form without using FormWizards. (Tabular and Graph FormWizard

   labels, as well as labels on forms created without FormWizards,

   default to "General" text alignment.)

CAUSE

   It is a feature of Microsoft Access that controls placed on a form

   created with FormWizards default to the same properties as the

   Wizard-created controls.

   For example, when you create a blank form (not using a FormWizard),

   a Label control's TextAlign property normally defaults to

   "General". With the Single-column and Main/Subform FormWizards,

   however, label controls placed on the new form by the FormWizard

   default to "Right" alignment. As a result, all subsequent new

   labels placed on that form will also default to "Right" alignment.

   Please bear in mind that this is only a default value, and can be

   changed.

STATUS

   This behavior is by design.

References


INF: OLE: New Graph Object Frames are Blank

 Article Number: Q89607

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

When you create a graph on a form or report it will appear as a blank

object frame until you switch to browse mode of a form or either print

or print-preview a report for the first time.

More Information:

All graphs are bound objects. The Row Source may be a table, query,

or a list of values. A graph may not be based only on the values in

other controls. For this reason the query which retrieves the data for

the graph is not run when the graph is created; it is executed at the

time the form or report is browsed. This is consistent will all bound

objects in Microsoft Access.

Steps To Reproduce Behavior

---------------------------

1. Start Microsoft Access and open the sample database NWIND.MDB.

2. Click on the New Form button on the Toolbar.

3. Select Category Sales for 1991 and click on the FormWizards button.

4. Choose Graph and press OK.

5. Choose Next> to accept the default graph.

6. Click on the double right arrows (>>) to add both fields and

   then choose Next.

7. Click on Design.

You now have a form with a blank Object Frame. To view the graph

switch to Browse mode. Once the query has been executed for the

first time the graph will display data from the most recent

recalculation

References


INF: Tips on How to Debug Microsoft Access Macros

 Article Number: Q89610

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

This article presents five methods of troubleshooting a Microsoft

Access macro. When a macro fails to perform correctly, there are

several tools that can be used to help isolate where the problem is:

1. Single Stepping - This feature steps through a macro one action at

   a time with a pause between each action. To activate single step

   mode, choose the Single Step button on the toolbar, or choose

   Single Step from the Macro menu. When any macro is run, it will

   execute in single step mode until you turn this feature off or

   choose the Continue button in the Macro Single Step dialog box.

   This feature make it easy to determine if the action items are

   listed in the correct sequence. During single step mode, Microsoft

   Access displays the Macro Single Step dialog box, which displays

   the macro name, the name of the first action in the macro, and the

   arguments for this action. To continue macro execution, you can

   choose the Step, Halt, or Continue button.

2. Action Failed Dialog Box - This feature displays an error message

   caused by an invalid action. The same information displayed by the

   Single Step dialog box is displayed in this dialog box. To return

   to the Macro window and correct the problem, choose the Halt

   button.

3. MsgBox Action - Insert the MsgBox action in your macro wherever you

   want to display the value of a control. The action argument for the

   message will be the name of the control you want to check. For

   example, to display the value of an unbound control named Field1 in

   Form1, enter the expression "=Forms!Form1!Field1" (without

   quotation marks) for the message.

4. StopMacro Action - This macro action takes no arguments and will

   stop the macro. Use this action to check the results that have been

   calculated so far. Use this feature together with the Immediate

   window to display calculated values.

5. Immediate Window - This tool can be used to display any values that

   have been declared. The Immediate window is associated with module

   objects. To display the Immediate window, open an existing module,

   or create a new module, then choose Immediate window from the View

   menu. To display a value, type a question mark, then the variable

   name, and then press the ENTER key.

For information on displaying the Immediate window without displaying

the Module window, search on the following words in the Microsoft

Knowledge Base:

   immediate and findwindow and showwindow

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 523-524

References


INF: Delete Command on Form Open if Counter has Focus

 Article Number: Q89617

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

When a form is open in browse mode and the first control to have the

focus is a counter, the delete command will be enabled on the Edit

menu, even though you cannot execute this command.

More Information:

This may cause the following error message if you run a macro that

executes the DoMenuItem action and then select Delete:

   "Command not Available: Delete"

The Delete command in the Edit menu will be disabled after this error

message is posted. One work around would be to create a macro that

uses the DoMenuItem command and a Select Record from the Edit menu

prior to running the macro that calls Delete from the Edit menu.

References


INF: Import/Export Accepts Only 24-Hour Time Format

 Article Number: Q89618

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

When importing or exporting time values, Microsoft Access works only

with 24-hour time values. This behavior is by design.

More Information:

If you try to import a time value such as 1:00 P.M. into an existing

time column, the record will not be loaded, and you will get a Import

Errors table that has a "Type Conversion Failure" on the value. To

import a time value such as 1:00 P.M., the value must be in the

24-hour format (in this case, 13:00).

To work around this behavior, import your time values into an existing

text column and use Microsoft Access Basic code to manipulate the

values into the correct data type format.

If you try to export a value such as 1:00 P.M. to an ASCII text file,

the value will be exported in the 24-hour format (13:00).

References


PRB: Avery Labels 4143, 4160, and 5096 Don't Work on Laser Ptr

 Article Number: Q89621

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When using Microsoft Access ReportWizards for mailing labels, Avery

   label numbers 4143, 4160, and 5096 print incorrectly when printed by

   a laser printer.

CAUSE

   These labels are meant for dot-matrix printers.

RESOLUTION

   This behavior is by design.

References


INF: How to Use a Toggle Button to Hide and Display a Subform

 Article Number: Q89622

 CREATED: 27-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

In Microsoft Access you can use a Toggle Button to hide and display a

subform. This article shows how to use the Toggle Button to hide

and display the Quarterly Orders subform in the Quarterly Orders form

located in NWIND.MDB.

More Information:

The following steps can be used to add a toggle button:

 1. Open the NWIND.MDB sample database.

 2. Choose Macros from the Database window.

 3. Choose New to create a new macro.

 4. Choose Conditions from the View menu.

 5. The items below are required for the macro.

       MacroName         Condition                Action

       ---------------------------------------------------

       Toggle It         [Toggle Button] <> 0     SetValue

                         [Toggle Button] = 0      SetValue

       Toggle It Actions

       ---------------------------------------------------

       SetValue

          Item           [Quarterly Orders Subform].Visible

          Expression     No

       SetValue

       Item              [Quarterly Orders Subform].Visible

       Expression        Yes

 6. Save the macro as TOGGLE.

 7. Press the F11 function key on the keyboard to return to the Database

    window.

 8. Choose Forms from the Database window.

 9. Open the Quarterly Orders form in Design mode.

10. Choose Properties from the View menu. On the form property sheet, under

    Default Editing, change the setting to Allow Edits.

11. Display the Toolbox.

12. From the Toolbox, choose the Toggle button.

13. Place the mouse somewhere on the Quarterly Orders form in an open

    area to position the Toggle button.

14. Display the Object Properties box for the Toggle button.

15. The items below are required for the Object Properties of the

    Toggle button.

       Toggle Button

       ---------------------------------------------------

       Control Name:      Toggle Button

       Caption:           Toggle Subform

       After Update:      Toggle.Toggle It

When the Quarterly Orders form is shown in browse mode the Toggle

Subform toggle button hides and displays the Quarterly Orders

subform.

Reference(s):

"Microsoft Access User's Guide" Chapter 22, "Using Macros with Forms" and

Chapter 9, "Designing Forms;" Appendix C

References


INF: Cut/Paste for Immediate Window and SQL Window

 Article Number: Q89680

 CREATED: 28-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

In the Immediate window and in the SQL View window, you do not have

access to the Cut, Copy, or Paste menu items from the Edit menu.

More Information:

Use the following keystrokes for cutting, copying, and pasting:

   Cut     Shift-Delete

   Copy    Ctrl-Insert

   Paste   Shift-Insert

This will work for Windows 3.0 and 3.1. You could also use the

following keystrokes for Windows 3.1:

   Cut     Ctrl-X

   Copy    Ctrl-C

   Paste   Ctrl-V

References


INF: Selecting Text in a Text Box from the Left or Middle

 Article Number: Q89683

 CREATED: 28-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

This article discusses the editing characteristic of Microsoft Access

that disallows selecting text without selecting all text on the

right.

This is usually perceived as an editing bug.

More information:

You are unable to highlight a specific area in a text box, or any area

in Microsoft Access where you can select several columns or characters

by highlighting one, then dragging either way to select others.

Instead, anytime you place the mouse in a text box or other such

area, a highlight selection appears from the point of the mouse all

the way to the right of the text box or other such area - preventing

you from highlighting anything specifically in the middle or left side.

Editing in Microsoft Access is currently set to EXT mode as indicated

on the status bar as a result of pressing F8 at some point.

Press Escape to turn EXT mode off. This is standard with Microsoft

Excel and Microsoft Word.

For more information, search Help for 'Extend'.

References


PRB: 'Compile All' is Enabled After Saving a Module

 Article Number: Q89684

 CREATED: 28-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

This article explains why the Compile All menu item is re-enabled

after saving a module.

More Information:

After you compile a module by choosing Compile All from the Run menu,

the Compile All menu item is grayed out. This is expected since you

do not need to recompile a module until you make a change to it.

However, if you save the module by choosing Save from the File menu,

the Compile All menu item is no longer grayed out even though you have

not made any changes to the module.

Modules are always saved in an uncompiled state. When you save the

module, some of the program code in memory actually is "de-compiled"

for internal requirements for saving the module. Since there may be

uncompiled code in memory, the Menu item is enabled again.

Note that this does not affect Access startup performance. For more

information on compiling a module in Microsoft Access, search the

Knowledge Base for

   COMPILE ALL and PARSER.

References


INF: Flexible Formatting of Phone Numbers

 Article Number: Q89685

 CREATED: 28-SEP-1992

 MODIFIED: 21-APR-1993

Summary:

The format capabilities in forms are sufficient for normal usage, but

a developer may not be sure of the format in which data will be

entered.  Because input masks are not available in Access, a developer

cannot rely on that to guide the user's input. This article uses

functions to determine what format is best suited for a particular

situation.

This article assumes you have a working knowledge of Access Basic code

and functions.

More Information:

The objective of this example is to take the phone number value

entered by the user and determine if an area code was included. If

not, it will not display the parentheses. Of course, this example does

not take into account phone extensions or international numbers.

By creating two functions, this and other types of intelligent

formatting are possible. The Format_Phone function massages the phone

number into a common string (void of parentheses, spaces, and dashes)

and then determines the most appropriate format. It returns the phone

number back to the form in that format. The SStrip function is a very

important concept. It continues to operate until it eliminates a

specified character (StripStr) from the string (InWord). This is used

to eliminate extra characters (dashes, spaces, and so on) from the

phone number.

Create the following two functions:

Function Format_Phone (PhoneNumber$)

   '* Exit the function if there is no information passed

   If IsNull(PhoneNumber$) Then

      Exit Function

   End If

   '* Need to strip out unwanted characters leaving only numbers

   PhoneNumber$ = SStrip(PhoneNumber$, "-")

   PhoneNumber$ = SStrip(PhoneNumber$, " ")

   PhoneNumber$ = SStrip(PhoneNumber$, ")")

   PhoneNumber$ = SStrip(PhoneNumber$, "(")

   '* Reformat the character string

   Select Case Len(PhoneNumber$)

      Case 7

         Screen.ActiveControl = Format(PhoneNumber$, "@@@-@@@@")

      Case 10

         Screen.ActiveControl = Format(PhoneNumber$, "(@@@) @@@-@@@@")

      Case 11

         'Note that this should be on one line.

         Screen.ActiveControl = Format(PhoneNumber$, "@ (@@@) @@@-  _

                                                          @@@@")

      Case Else

        MsgBox "This is not a valid phone number."

        Screen.ActiveControl = PhoneNumber$

    End Select

End Function

Function SStrip (InWord, StripStr)

   Do While InStr(InWord, StripStr)

      'Note that this should be on one line

      InWord = Mid(InWord, 1, InStr(InWord, StripStr) - 1) &  _

               Mid(InWord, InStr(InWord, StripStr) + 1)

   Loop

   SStrip = InWord

End Function

Along with the two above functions, bind the control (Text Box) to the

function by setting the following property:

   AfterUpdate:    =Format_Phone([<control name>])

Example for a field with the control name [Text1]:

   AfterUpdate:    =Format_Phone([Text1])

References


PRB: 'Field0' Appears in a Query But Not in the Source Table

 Article Number: Q89686

 CREATED: 28-SEP-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOM

   The resulting datasheet view of a query reveals that a field called

   "Fieldn" (where n is a number, for example, "Field0") exists, but

   you do not have a field by that name in the source table. The

   SELECT statement of this query includes an asterisk (*) to indicate

   that all fields should be displayed.

CAUSE

   The resulting data set of a query cannot contain two columns with

   the same name. When you create a SQL statement with an asterisk as

   the result of dragging the asterisk from the fields list to a

   column in the query grid, then you include another field from the

   same table, there are in effect two fields with the same name. The

   first field is from the group of fields represented by the

   asterisk, and the second field is the one that was explicitly

   included in the query grid. (Note that this could also occur if you

   try to add a field to the grid that is already there explicitly.)

   Rather than present an error message indicating that there are two

   columns with the same name in the view, Access substitutes the name

   of the second and subsequent duplicate fields with "Fieldn".

RESOLUTION

   If you want to have the datasheet display a more meaningful name

   than "Fieldn," do the following (the steps below assume that you

   have included an asterisk in the query grid and that you are ready

   to add the duplicate field):

   1. In the column of the query grid where the duplicate field is to

      appear, type the name of the heading you want to see in the

      datasheet followed by a colon (:). For example:

         EmployeeName2:

   2. Following the colon, type the name of the field value you want

      to appear in this column.

   When you display the query in datasheet mode, the field will

   display with the alias name given in step 1.

References


INF: Allowing an Ampersand to Appear in a Caption

 Article Number: Q90090

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

A caption containing an ampersand (&) will result in a value that

replaces the ampersand with an underscore character (_). For example,

entering the caption

   Jack & Jill

in the Property Sheet will result in the following caption on the

form or control:

   Jack _Jill

More Information:

Microsoft Access allows you to underline a character in a caption,

giving it ALT key access, by specifying an ampersand before the

character that is to be underlined. Because the ampersand appears

before the space in the following caption

   Jack & Jill

Microsoft Access assumes that the intention is to underline the space

following the ampersand.

If an ampersand is to appear literally in a caption, you must specify

two ampersand characters in a row. For example, entering the following

caption in the Property Sheet

   Jack && Jill

will result in the following caption in the resulting form or control:

   Jack & Jill

Reference(s):

"Microsoft Access User's Guide," version 1.0, page 598.

References


PRB: Arrange Icons do Not Locate Icons in Correct Place

 Article Number: Q90091

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Icons do not always stay where you expect them to. See "More

   Information" below for more details.

CAUSE

   Icons and their placement are handled entirely by Windows. The same

   behavior can be reproduced in Program manager.

RESOLUTION

   This behavior is by design.

More Information:

1. In the Data Base window, create several objects, maybe five,

   such as forms, queries, and macros.

2. Minimize all the objects to icons.

3. Randomly place the icons around the screen. Make sure that a

   couple of the icons are place off the Microsoft Access client

   area. You can do this by dragging the icon as far right as

   possible. When the icon is touching the window's border, a

   horizontal scroll bar will appear. Move the scroll bar's thumb

   as far to the right. Repeat this process until you can move the

   scroll bar's thumb back to the left and no longer see the moved

   icon.

4. Select Windows, Arrange Icons.

5. Double click on one of the icons.

6. The document from step 5 should be open. Now minimize it.

Result: The icon is not in the same place as before step 5. If you

do this with each icon they all end up moving. If you do a second

Arrange Icons after step 6 they move to the correct location.

Arrange Icons with icons on Microsoft Access windows with

horizontal or vertical scroll bars displays this problem.

Reference(s):

"Microsoft Access Getting Started," version 1.0, pages 154, 158.

References


INF: Close Action has Blank Line in Object Type Argument

 Article Number: Q90092

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The Close Action has a blank line as the first choice in the drop down

   list for the Object Type argument in a macro. To reproduce this do the

   following:

      1. Create a macro.

      2. Add the action Close.

      3. Select the drop down menu for the Object Type argument.

RESOLUTION

   This behavior is by design to allow the Close Action to execute on the

   current window.

Reference(s):

"Microsoft Access User's Guide." Version 1.0, Chapter 21 "Macro

Basics"

References


PRB: ESC While Creating Control Doesn't Deselect Control

 Article Number: Q90094

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   Pressing ESC while creating a control on a form doesn't deselect

   the control in the toolbox.

CAUSE

   The toolbox is not reset until the mouse button is released. This

   behavior allows you to press ESC so that you can realign a control

   on the form.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open a new form.

2. From the View menu, choose Toolbox.

3. Using the left mouse button, select the text box control in the

   toolbox and drag the control to the new form, but DO NOT release

   the left mouse button.

4. Press ESC.

   The text box is canceled but the text box control remains selected

   in the toolbox.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 214-230

References


PRB: Margins Do Not Relate to Printable Area

 Article Number: Q90095

 CREATED: 08-OCT-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   When you print or print preview a report with the margins set to

   fall outside the printable area defined by your printer driver, the

   information in the report falling outside of the printable area

   will not be printed correctly.

   Depending on the printer and driver being used, the output may be

   truncated, shifted so it falls within the printable area, or flow

   onto another page. Also, output from the second page to the end of

   the report may vary from that of the first page. For example, the

   printer may shift the output on those pages so the top and left

   sides of the report correspond to the top and left sides of the

   printable area.

CAUSE

   Access sets margins based on the page size selected, not on the

   printable area of that page. Therefore, if you set your margins to

   to have output go beyond the printable area, the information that

   would be placed in that area will not print correctly.

RESOLUTION

   Print preview any output from Access to make sure that no

   information is truncated. If information is truncated, increase the

   margins by choosing the Setup button and changing the margin

   settings.

   For example, if your top margin is set to 0 and the information on

   the tops of the pages appear to be truncated in print preview,

   increase the top margin (for example, .5) and print preview the

   information again. Continue increasing the margins until the

   information is no longer truncated in print preview.

STATUS

   Microsoft has confirmed this to be a problem in Access version 1.0.

   We are researching this problem and will post new information here

   as it becomes available.

References


PRB: Update Queries Do Not Check Validation Rules

 Article Number: Q90096

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   During update queries, validation rules are not checked, and no

   error log is generated for the invalid records during an update

   query.

RESOLUTION

   To validate the data, a macro will need to be executed to check

   validity.

STATUS

   This behavior is by design.

More Information:

Update queries are queries that change existing data in a table.

Validation rules are rules placed on a field when it is defined to

prevent that field from accepting data that does not meet the

specified rules.

When an update query is executed, as long as the data that is being

changed is the correct data type for the field, it will be changed

even if it violates the validation rules for field.

Reference(s):

"User's Guide," version 1.0, pages 174-178

References


INF: AccessWizards Button Grayed Out

 Article Number: Q90097

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

When creating forms or reports in Microsoft Access version 1.0, the

FormWizards or ReportWizards button is grayed out. This occurs because

in the MSACCESS.INI file, the section [Libraries] must contain the

entry wizard.mda = ro. If this entry is missing, the FormWizards or

ReportWizards button will be grayed out. The entry in the MSACCESS.INI

file should look like the following:

   [Libraries]

   wizard.mda = ro

References


INF: Creating a Snapshot Is Slower Than Creating a Dynaset

 Article Number: Q90098

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

A dynaset is a dynamic set of records that results from running a

query or applying a filter. A snapshot is a static image of a set of

data, such as the records displayed as the result of a query.

Snapshots are not updateable, whereas dynasets are updateable.

Creating a snapshot takes longer than creating a dynaset because the

snapshot table is populated with data, and the dynaset is populated

with bookmarks, which are significantly smaller than data.

More Information:

On a machine in Microsoft Product Support, the query "Order Review" in

the NWIND.MDB took 13 seconds to create a dynaset, whereas it took 160

seconds to create a snapshot. Both virtual tables (VTs) are populated.

References


INF: Hiding Rows and Columns in Tables

 Article Number: Q90099

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

To decrease the width of a column, drag the right side of the column

to the left. When you want to "hide" the column, or make it not

visible, drag the right side beyond the left side.

To decrease the height of a row, drag the bottom of the row toward the

top. Note: If you drag the bottom of the row above the top of the row,

the sizing does not take effect and the row is not hidden because row

sizing in script design (or table/menu design or tabular forms)

resizes all rows, which would leave the client window with no rows.

This behavior is by product design.

Reference(s):

"Microsoft User's Guide," version 1.0, chapter 14, pages 355-357.

References


PRB: SQL Tables Are Read Only Without a Unique Index

 Article Number: Q90100

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you try to edit an attached SQL table that does not have a

   unique index defined for it, Microsoft Access will beep and the

   status bar will display "Form is read only." This will happen

   whether you are trying to edit the table in datasheet view or a

   form.

CAUSE

   Microsoft Access requires that a unique index be defined for each

   table in order to reference the records in the table for editing

   purposes.

RESOLUTION

   Define a unique index for each table by using the SQL command

   CREATE UNIQUE INDEX. The basic syntax of that command is:

      CREATE UNIQUE INDEX <index_name>

        ON [[<database.>]<owner.>]<table_name.> (<column_name>

          [, <column_name>]...)

   This procedure cannot be done from inside Microsoft Access; it must

   be done in the System Administration Facility (SAF) on the SQL

   server machine or by using a program such as Q+E (which comes with

   Microsoft Excel) that can execute SQL commands directly on the SQL

   server machine.

   After creating the unique index, detach from SQL Server, then

   re-attach in order to implement the change.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 66-68.

References


PRB: QBE Grid Disappears When Selected and Deleted

 Article Number: Q90101

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   The Query By Example (QBE) grid, which appears when you enter

   design mode for a query in Microsoft Access, disappears if you

   highlight the grid (by clicking the query grid's column header),

   drag to the end of the query grid, and choose Delete from the Edit

   menu.

CAUSE

   When you highlight an entire column or grid and choose Delete from

   the Edit menu, Microsoft Access deletes the grid columns instead of

   clearing the contents of the columns.

RESOLUTION

   To display a blank query grid column after the QBE grid has

   disappeared, choose Insert Column from the Edit menu.

   To display a column that is already filled in with field

   information, click a field name in one of the field lists that is

   displayed in the top portion of the query design window, and drag

   the field to the query grid portion of the query design window.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide" version 1.0, pages 92-100.

References


INF: How to Get SQL Pass-Through Functionality Using Q+E

 Article Number: Q90102

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

Microsoft Access version 1.0 does not directly support the use of

pass-through SQL (the ability to pass SQL commands directly to a

server). However, you can use the Microsoft Access Basic programming

language to perform dynamic data exchange (DDE) with Q+E, which does

support pass-though SQL. This allows you to use pass though SQL

commands in Microsoft Access to execute stored procedures and other

SQL commands.

More Information:

To use Q+E's pass-through SQL capabilities in Microsoft Access, create

the following function in a Microsoft Access Basic module.

NOTE: The second DDEExecute command, which contains the OPEN and USE

commands, should be entered on one line similar to the first

DDEExecute command.

   Function SQLPassThru (SQLCommandText, SQLDatabaseText)

      On Error Resume Next

      Err = 0

      chan = DDEInitiate("QE", "System")

      If Err Then

         Err = 0

         Result = Shell("QE", 2)

         If Err Then

             ' Note the following statement should be on one line.

             MsgBox "ERROR: Unable to start Q+E.  Q+E must be in your_

                    PATH statement", 16, "SQL PassThru"

             Exit Function

         End If

         chan = DDEInitiate("QE", "System")

      End If

      DDEExecute chan, "[LOGON(SQLServer)]"

      DDEExecute chan, "[OPEN('USE " & SQLDatabaseText & "; " &

         SQLCommandText & "','SQLSERVER')]"

      DDEExecute chan, "[EXIT()]"

      DDETerminate chan

   End Function

The SQLPassThru function attempts to initiate a DDE channel with Q+E.

If Q+E is not available, SQLPassThru attempts to start Q+E. If Q+E

cannot be started, SQLPassThru displays an error and ends the

function. If Q+E can be started, a DDE channel is initiated.

SQLPassThru then tells Q+E to display its Logon dialog box to enable

you to log on to SQL server. The SQL USE command is executed to ensure

that SQLPassThru is in the database you specify, and SQLPassThru

executes the SQL command. After the command is executed, SQLPassThru

exits the Q+E application and terminates the DDE channel the function

established.

A call to this function would resemble the following:

   SQLPassThru("sp_addlogin ted, ted","master")

In this example, the function will start Q+E and initiate a DDE

channel, if possible, and prompt you to log on a SQL server. After you

have logged on, it will use the master database on the SQL server and

execute the stored procedure sp_addlogin, which will add a login for

ted with a password of "ted". After the command is executed, the function

will exit the Q+E application and terminate the DDE channel it

established.

NOTE: You must include quotation marks around both the parameters to

ensure that they are used properly. You may also have to include

additional quotation marks in the SQL command you are sending to the

SQL server to ensure that the command is being processed correctly.

For examples of the types of adjustments that you may need to make to

the SQL command string, see the "Q+E for Microsoft Excel User's Guide"

or the application note "A Practical Guide to Using Q+E," which can

be obtained by calling Microsoft Product Support at (206) 454-2030.

You can modify and use this function in many different ways, such as:

 - To accept additional parameters and have additional corresponding

   DDEExecute commands, thereby allowing the execution of multiple SQL

   commands with one function call

 - To use as a Sub in which you can hard-code the parameters for the

   command and SQL database in the Basic code

 - To retrieve information from the SQL server, or send information to

   the SQL server by using the DDERequest and DDEPoke commands

 - To use in conjunction with a form to allow on-line SQL command

   execution

 - To break into multiple functions with different capabilities, such as

   one function to initiate the channel, another function to execute

   the commands, and another function to terminate the channel

 - To access database types that Microsoft Access does not yet support

   but that Q+E does, such as Oracle and Rdb

For additional information on using Q+E to access Oracle and Rdb, see

the "Q+E for Microsoft Excel User's Guide."

Reference(s):

"Microsoft Access Language Reference," version 1.0, pages 115-126

"Microsoft Access Basic: An Introduction to Programming," version 1.0,

Chapter 2, pages 1-8

"Q+E for Microsoft Excel User's Guide," version 4.0, pages 101-102

References


INF: How to Abort Creating a Field in Table Design

 Article Number: Q90103

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

When designing a new table, a valid data type name from the data type combo

box must be associated with each field, otherwise, you get the error

message:

   The text you enter must match an entry in the list.

This is by design, due to field validation performed on exiting the field.

More information:

Steps to Reproduce Behavior

---------------------------

1. Open a new table.

2. Select any data type for the first row from the data type drop-down

   combo box.

3. Remove the data type selected using either the delete or the backspace

   key.

4. Try to move to the next row. You get the error message:

      The text you enter must match an entry in the list.

The only way to move to another row is to do one of the following:

1. Fill in the Data Type field by selecting (or typing in) a data type from

   the data type drop-down combo box.

2. Cancel the entry by pressing the ESC key (which fills in the Data

   Type field with a default entry of "Text").

3. Select "Delete Row" from the Edit menu.

Reference(s):

"Microsoft Access User's Guide." Version 1.0, page 27

References


INF: OpenTable Action Ignores Data Mode If Table Open

 Article Number: Q90104

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   In a macro, the OpenTable action ignores the Data Mode parameter if

   the table being opened is already active. If table A is opened in

   Read Only mode and then it is opened a second time in Edit Mode

   without being closed first, the table will still be in Read Only

   mode.

CAUSE

   If OpenForm, OpenTable, or OpenQuery is called, and the window is

   already opened, you will switch to the new view, but the data mode

   cannot be switched.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a macro, as follows:

      MacroName      Action

      ----------------------------

      Test1          OpenTable

      OpenTable Actions

      ----------------------------

      Table Name:       (Give an existing table name here)

      View:             Datasheet

      Data Mode:        Read Only

2. Save and run the macro.

3. Leave the table open and return to the Macro window.

4. Make the following change to the OpenTable action of MacroName

   Test1.

      OpenTable Actions

      ----------------------------

      Table Name:       (Give an existing table name here)

      View:             Datasheet

      Data Mode:        Edit

5. Save the macro and run it again.

When the macro is run a second time (step 5) with a different data

mode, the Table window is activated but it is still in Read Only mode.

Again, this behavior only occurs if the table is already open when

executing the OpenTable action.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 22, "Using

Macros with Forms"

References


INF: Couldn't Find SYSTEM.MDA or UTILITY.MDA File

 Article Number: Q90105

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

When Microsoft Access is started, one or both of the following error

messages may be displayed:

   Couldn't find file 'SYSTEM.MDA'

   Couldn't find file 'UTILITY.MDA'

These errors occur if the SystemDB and UtilityDB settings in the

[Options] section of the MSACCESS.INI file point to a directory that

does not contain the SYSTEM.MDA or UTILITY.MDA file. These errors also

occur if the directory points to a share in which there is no

connection.

If the directory does not exist, the following error message is

displayed:

   Invalid Path 'pathname'

More Information:

A good way to manage the MSACCESS.INI file is to keep backup copies

that pertain to particular setups. Have one setup for starting in a

workgroup on a network and have another that allows for starting on a

local machine. To change setups, copy the appropriate backup .INI file

over the MSACCESS.INI file.

For more information, search for "MSACCESS.INI" using the Help menu.

References


PRB: Criteria Sections Combined into Same Column in QBE Grid

 Article Number: Q90106

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   Microsoft Access combines multiple columns of the Criteria section

   in the Query By Example (QBE) grid if two or more columns have the

   same field name. You will see this combination after saving the

   query and opening it a second time.

   This behavior will typically not present a problem, unless you

   need to have more than 255 characters in one cell of the QBE grid.

   As stated above, the problem occurs when the query is saved and

   opened a second time. Microsoft Access combines the two Criteria

   sections into one, making the expression longer than 255

   characters. This then causes the following error message to be

   displayed:

      Expression is too long for the QBE grid and has been truncated:

      '<Expression>'

CAUSE

   In Microsoft Access, each cell of the QBE grid is limited to 255

   characters. The QBE grid combines expressions when possible so that

   there are no repetitive columns.

RESOLUTION

   To work around the 255-character limit, break the large statement

   into two smaller statements with the same field name. Make sure

   that the two smaller statements are on the same Criteria grid line.

   The query will execute correctly and the two statements will be in

   their correct places.

   To break the statement into two smaller statements, choose one of

   the two columns that have the same field name and put parentheses

   around the field name. The following is a sample query:

      Query1

      --------------------------

      FieldName: UserID

      Criteria: Like "DON*"

      FieldName: UserID

      Criteria: Like "DONFU*"

   When you save and reopen the query, the criteria will be set as:

      Query1

      --------------------------

      FieldName: UserID

      Criteria: Like "DON*" And Like "DONFU*"

      FieldName: UserID

   If you save the query as follows, the two-column design will be

   retained:

      Query1

      --------------------------

      FieldName: UserID

      Criteria: Like "DON*"

      FieldName: (UserID)

      Criteria: Like "DONFU*"

   Note that when you save the query and then reopen it in design

   mode, the second field name will read as follows:

      Query1

      --------------------------

      FieldName: UserID

      Criteria: Like "DON*"

      FieldName: Expr: ([UserID])

      Criteria: Like "DONFU*"

   Note: If the field name is more than one word, place brackets

   around the field name before putting the field name in parentheses.

   Putting parentheses around the field name turns it into an

   expression. This will differentiate the columns and prevent

   Microsoft Access from combining the two expressions.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 5, "Query

Basics."

References


PRB: Minimizing, Maximizing the Desktop Flashes Slightly

 Article Number: Q90107

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   If you are using a bitmap for the Windows desktop, the desktop

   flashes slightly when you minimize or maximize Microsoft Access.

CAUSE

   Microsoft Access is setting the system palette to its own, which

   changes the colors of all the bits on the screen. You will observe

   the same behavior if you run Paintbrush, load a 256-color bitmap,

   and do the same steps as above.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Minimize all extra applications running.

2. Set your desktop to a bitmap (for most noticeable flash, use the

   256-color bitmap that comes with Windows 3.1).

3. Open Microsoft Access.

4. Maximize Microsoft Access.

5. Minimize Microsoft Access.

   Note the flash as the desktop is repainted.

6. Click the Microsoft Access icon.

   Note: If you click another minimized application after you click

   the Microsoft Access icon, the screen again repaints inversely,

   then repaints correctly.

References


INF: Links to Formatted DDE Items Result in Text

 Article Number: Q90108

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

Dynamic data exchange (DDE) links to numeric items that have been

formatted will result in text. To perform calculations on the results

of these links, you must convert the results to a numeric data type,

as described below.

More Information:

This article will first demonstrate the problem with an example and

then list the Microsoft Access functions that can be used to convert

the text value to a numeric value.

Example

-------

Create the formatted value as follows:

1. Start Microsoft Excel.

2. In cell A1 of Sheet1, type "80" (without the quotation marks).

3. Select cell A1, and choose Number from the Format menu.

4. From the Format Codes list, select a currency format, such as

   $#,##0_);($#,##0), and choose the OK button.

5. Select cell A1, and choose Copy from the Edit menu.

Create the DDE link as follows:

1. Start Microsoft Access and open a database.

2. Create a new form.

3. From the Edit menu, choose Paste Special.

4. From the Data Type list, select Text.

5. Choose the Paste Link button. This creates a text box with the

   following formula:

      =DDE("Excel","Sheet1","R1C1")

6. If the Properties box is not showing, choose Properties from the

   View menu.

7. Select the text box created in step 5 and verify that "Field0"

   appears in the Control Name property.

8. Create a new text box and enter the formula:

      =Field0+100

9. Switch to browse mode.

   Note that the first text box, Field0, displays "$80". The second

   displays "#Error".

Convert the text value to a numeric value as follows:

1. Switch back to design mode.

2. Change Field0 to read:

      =CCur(DDE("Excel","Sheet1","R1C1"))

3. Switch back to browse mode to verify that the second text box now

   contains 180.

Conversion Functions

--------------------

Part 1 of the "Microsoft Access Language Reference" contains several

tables. Table 1 lists functions and statements by programming task.

Under the task "Conversion" you will find the following references:

   Convert string to number: Val

   Convert one numeric data type to another: CCur, CDbl, CInt,

                                             CLng, Csng, Fix, Int

For more information on using these formulas, see the "Microsoft

Access Language Reference."

References


PRB: Pressing SHIFT While Dragging Not Working on New Control

 Article Number: Q90109

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Pressing SHIFT while dragging a control is used to restrict

   movement horizontally or vertically. However, this procedure works

   only if the item is not selected beforehand.

RESOLUTION

   A better method, if the control is already selected, is to click

   anywhere in the form, then reselect the control and move it by

   pressing SHIFT while dragging the control.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new form.

2. Place a text box on the form.

3. Hold the SHIFT key down.

4. Click the border of the text box and move it around.

If the text box was not selected before you performed the above steps,

you will notice the restricted movement (either horizontal or

vertical, depending on which text box border you clicked).

References


PRB: Database Window Loses its Focus

 Article Number: Q90110

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If no documents are open and you have the Database window minimized,

   pressing ENTER opens the document highlighted in the Database window.

   If there is another document opened and minimized, nothing happens

   when you press ENTER on the minimized Database window icon.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open NWIND.

2. Minimize the DataBase Container.

3. Press ENTER.

At this point a table will open.

If you close the table and minimize the object, then press ENTER again,

nothing happens. But if you restore and minimize the Database

window, the same results occur.

References


PRB: 'Couldn't Find Installable ISAM' Error

 Article Number: Q90111

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   Importing, exporting, or attaching to a file using an indexed

   sequential access method (ISAM) driver returns an error if

   Microsoft Access cannot find the ISAM driver.

CAUSE

   An ISAM driver is used by Microsoft Access to update file formats

   other than its own. If the path to the ISAM driver in the

   MSACCESS.INI file is invalid or the ISAM driver does not exist, you

   will receive the following error:

      Couldn't find installable ISAM.

RESOLUTION

   Edit the MSACCESS.INI file to specify the correct path, or reinstall

   Microsoft Access using the Custom option.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide" version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 60-69.

References


PRB: Make-Table Query Causes Existing Table to Be Deleted

 Article Number: Q90112

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   Running a make-table query that creates a table with the same name

   as the table the query is based on deleted the table that the query

   was based on.

CAUSE

   Microsoft Access deletes a table before creating a new table with

   the same name.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Save an existing table as "Author".

2. Create a make-table query based on Author and type "Author"

   (without the quotation marks) for the name of the table to be

   created.

3. Run the make-table query. A dialog box with the following warning

   appears:

      Existing Table 'Author' will be deleted before running the

      query. Continue anyway?

   If you choose the Yes button, a dialog box with the following error

   message will appear:

      Couldn't find input table or query 'Author'.

   At this point, the table "Author" will no longer exist and the

   query will fail. You will not be able to retrieve the table, even

   by choosing the Undo command from the Edit menu.

Reference(s):

"Microsoft Access User's Guide" version 1.0, Chapter 7, "Designing

Action Queries and Parameter Queries," page 164

References


PRB: Nulls Not Concatenated with '+' Operator

 Article Number: Q90114

 CREATED: 08-OCT-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   When the "&" operator is used, text can be concatenated to either

   side of a null. However, when this is done with the "+" operator,

   a null is returned.

CAUSE

   The & operator treats nulls as empty strings. The + operator

   propagates nulls.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a form called Form1.

2. Place a text box field called Field0 on this form.

3. Switch Form1 to Browse mode.

4. Add the function:

      Function Demonstrate ()

         Forms!Form1!Field0 = Null + "This is a string"

         Debug.Print Forms!Form1!Field0

         Forms!Form1!Field0 = Null & "This is a string"

         Debug.Print Forms!Form1!Field0

      End Function

5. In the Immediate window, type the following and press ENTER:

      ?Demonstrate()

   The Immediate window will now show the following results:

      ?Demonstrate()

      #NULL#

      This is a string

Reference(s):

"Microsoft Access User's Guide," version 1.0, Appendix C

References


PRB: OnDblClick Macro Requires CancelEvent to Change Focus

 Article Number: Q90115

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   The macro action GotoControl does not successfully change the focus

   to another control if the macro is attached to the OnDblClick

   property of a text box, list box, or combo box.

CAUSE

   This behavior occurs because the second click of a double-click is

   not processed until after the event is completed. The second click

   on the same field forces Microsoft Access to return the focus to

   that field.

RESOLUTION

   To prevent the second click in the double-click from being

   processed, add a CancelEvent action to the macro after the

   GotoControl action.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 21, page 541.

References


PRB: LimitToList Combo Box Won't Let You Leave After Delete

 Article Number: Q90116

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   When you delete an entry in a combo box, the following error

   message is displayed when you attempt to leave the control:

      Entry must match value in list

CAUSE

   This behavior is by design in order to prevent Access from adding

   nulls to the list just as it would any other new value. Undoing the

   record will cause the record to revert to the original stored

   value.

RESOLUTION

   To add a blank entry to a combo box list, include a blank value in

   the combo box's source table. You can then select the blank value

   from the list rather than deleting the entry in the field.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create an unbound form with a combo box row source attached to any

   table. Set the LimitToList property to True.

2. Browse the form. Choose a value from the combo box and press ENTER.

   Note that the field is committed.

3. Choose the combo box again. Delete the value and attempt to leave

   the control. The error mentioned above will appear.

Reference(s):

"Microsoft Access Getting Started," pages 83-87

"Microsoft Access User's Guide," pages 233-245

References


PRB: List Box Not Dimmed When Disabled

 Article Number: Q90117

 CREATED: 08-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   The contents of a disabled list box are not dimmed (grayed) as they

   are in other disabled controls.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open the Northwind database (NWIND.MDB).

2. Create a new form.

3. Place a list box control on the form and set its RowSource property

   to "Customers".

4. Set the Enabled property to "No".

5. Choose the Form View button.

Note that the list box's label is dimmed, but the contents of the list

box are not dimmed, as you would expect from a disabled control.

The problem, however, is only visual; the list box control is truly

disabled and you cannot alter its contents.

References


PRB: Report Prints with Blank Page Between Every Printed Page

 Article Number: Q90118

 CREATED: 08-OCT-1992

 MODIFIED: 05-FEB-1993

Summary:

SYMPTOMS

   A report printed in Microsoft Access produces a blank page between

   every printed page.

CAUSE

   The form width added to the widths of the left and right margins,

   exceeds the page width (usually 8.5 inches).

RESOLUTION

   Reduce the width of the form, the width of the left or right margin, or

   all three so that the total width of the form and margins does not

   exceed the width of the page. In other words:

      (FormWidth) + (LeftMargin) + (RightMargin) <= (PageWidth)

STATUS

   This behavior is by design.

References


PRB: Cannot Undo Property Settings in Table Design Mode

 Article Number: Q90119

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Choosing Undo from the Edit menu while in Table Design mode will

   not completely undo adding a field.

RESOLUTION

   To completely Undo the operation, choose Delete Row from the Edit

   menu.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Choose New-Table from the File Menu.

2. Enter a field name then Tab twice.

3. Choose Undo from the Edit Menu.

The field name will be removed, but the data type will remain.

Reference(s):

"Microsoft Access Getting Started," version 1.0, chapter 3, "Creating

a Table," pages 36 - 45

References


PRB: CTRL+BREAK Makes Mouse Disappear With a Module Active

 Article Number: Q90120

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Pressing CTRL+BREAK causes the mouse to disappear when a module

   is active.

   The following steps can be used to reproduce this behavior

   1. Start Microsoft Access.

   2. Open a database.

   3. Open a module.

   4. Press CTRL+BREAK.

   At this point the mouse will disappear until the mouse pointer is

   moved.

RESOLUTION

   This behavior is by design.

More Information:

The module window makes the mouse disappear when you type so that the

mouse will not obscure what you are typing. The use of CTRL+BREAK

triggers this behavior.

References


PRB: Microsoft Access GP Fault with ATI Ultra Video Card

 Article Number: Q90121

 CREATED: 08-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

If you are using an ATI Graphics Ultra video driver and select 1024 x

768 resolution, you will get a general protection GP-fault when

you create a new form and choose Align from the Layout menu unless

first selecting a control or field on the form. This error cannot be

reproduced using an ATI Graphics Ultra video driver at a lower

resolution or with any of the video drivers packaged with Microsoft

Windows version 3.1.

To work around this problem, select a control on the form before

choosing Align from the Layout menu.

More Information:

Microsoft has only been able to reproduce this problem on the ATI

Graphics Ultra video card running in 8514 mode (that is, 1024 x 768).

Steps to Reproduce Behavior

---------------------------

1. Create a new form.

2. From the Layout menu, choose Align.

   The following error message appears:

      MSACCESS caused a General Protection Fault in module

      <unknown>022F:D7C8@|MSACCESS will close.

References


INF: How Access Deletes Objects from a Database

 Article Number: Q90129

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

The following is a description of what happens internally when an

object (table, form, query, and so on) is deleted from a database in

Microsoft Access.

More Information:

When you delete an object from the Database window, it isn't

physically deleted from the database at that moment. Internally, it is

renamed to a temporary name (for example, ~TMPCLP1) and hidden, so

that it disappears from the Database container. (The renaming operation

occurs very quickly, regardless of the database's size.) The object is

physically deleted from the database once you take any action other

than Undo Deletion.

Objects are deleted this way in order to allow you to undo an

accidental deletion, unless some other action has been taken that then

makes "undoing" an object deletion impossible. (Access can undo

commands only one level back; it cannot queue up multiple commands to

undo actions.)

Since the physical object deletion occurs on the next action taken,

instead of when Delete is chosen, the machine may appear to be hung

while it is performing the delete because the next action taken might

be one that shouldn't take a long time to perform, such as creating a

new table, pasting, browsing a form, and so on. If the object is large

enough, the deletion can take some time, making the machine appear to

be hung.

Note: If the machine is rebooted before the deletion is completed, the

hidden temporary object remains in the database, wasting space. To

remove hidden objects, compact the database.

Speed of Deletion

-----------------

The time it takes to delete an object depends on how large it is and

how fast the computer is that you are using. Smaller objects are

deleted faster than larger ones. If the database that contains the

object to be deleted is on a network file server, the deletion will

take longer.

How long an object deletion will take cannot be accurately predicted,

since the speed of deleting the object is also affected by the nature

of the data contained in it. (For example, with tables, number columns

are deleted more quickly than memo and OLE columns.)

Internally, Microsoft Access does not provide a status callback for

object deletion, so a progress indicator in the status bar is not

possible. Since there is no progress indicator, Microsoft Access will

not yield to the system until the object deletion procedure is

complete. Therefore, you cannot abort the operation or switch to

another application during object deletion.

References


PRACC9210: Transaction Limit Can Cause 'Out of Memory' Error

 Article Number: Q90130

 CREATED: 11-OCT-1992

 MODIFIED: 29-APR-1993

Summary:

PROBLEM ID: 14274

SYMPTOMS

   When you attempt to make a change to a database, an "Insuffient

   Disk Space or Memory" error message occurs, even if there are ample

   system resources and/or disk space.

CAUSE

   Microsoft Access has a 4-MB-transaction limit. All table design

   changes are embedded within a transaction to ensure database

   integrity. As a result, you will get the "Out of memory" error if you

   attempt to update the contents of a table this large or larger.

RESOLUTION

   If, for example, a table contains a field of type "double" that

   you want to change to "integer," there are two ways to do this:

   Method 1

   --------

   1. Select and copy the desired table to the Clipboard.

   2. From the Edit menu, choose Paste (paste only the table structure

      to a new table name).

   3. Change the data type of the desired column in this new table.

   4. From the Edit menu, choose Paste (paste append the data to this

      new table).

   Method 2

   --------

   1. Add a new column to the table with the data type you wanted.

   2. Execute an update query, where the new column is assigned the

      value of the column you wanted to change.

   3. Delete the old column from the table.

   Note: You may get similar "out of memory" alerts when using both of

   these methods, but the message boxes should give you the option of

   continuing or canceling.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here as it becomes available.

References


PRB: Grid Disappears When Measurement Changed to Metric

 Article Number: Q90131

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The grid disappears, after changing the measurement option under

   Control Panel/International from "English" to "Metric".

CAUSE

   The grid is only invisible; it is still active and functioning

   correctly. (This behavior only occurs if the Grid option of the

   View menu is activated.)

   The grid is not visible because it becomes too dense to display when

   the GridX/GridY properties are set to over 6 divisions per centimeter.

   Since the default value for GridX is 10, and 12 for GridY, the values

   make the grid too dense when measurement is switched to metric. The

   largest number of divisions per centimeter the grid can be set to

   and still be visible, is 6, (using the form's GridX/GridY properties)

   regardless of the video card or monitor resolution.

RESOLUTION

   Either set the number of divisions in the form properties to less

   than 7, or switch the measurement value (in

   Control Panel/International) to "English". However, be aware that

   even when using the "English" measurement option, setting the

   GridX/GridY values to anything over 16 divisions per inch will also

   make the grid disappear.

   Microsoft has confirmed that this behavior is by design.

References


PRB: Combo Boxes Open When Window Sized to Vertical Minimum

 Article Number: Q90132

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   Combo box drop-down list boxes still open even when the window is

   sized to a vertical minimum. Therefore, they appear as list boxes

   in the middle of the screen, apparently unattached to any object.

CAUSE

   Even though the combo box itself isn't visible, it still has the

   focus and still responds to key combinations that affect it, such

   as ALT+DOWN ARROW.

RESOLUTION

   To work around this behavior, make sure the Query window or Access

   window is not smaller than the query grid, or change the focus to

   another control prior to shrinking the window size.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce:

------------------

1. Create a new query based on some table, such as the Categories

   table in the Northwind database (NWIND.MDB.)

2. Place the cursor in the first cell of the query grid ("Field:").

   Note that when you press ALT+DOWN ARROW, the combo box list drops

   down.

3. Using its window size handle, shrink either the Query window or the

   Access window by pulling the bottom of the window up to its title

   bar.

4. Press ALT+DOWN ARROW.

   Note that the combo box list still drops down, yet appears not to

   be attached to any combo box.

References


INF: Access Databases Truncated w/ LAN Manager 2.1a & Earlier

 Article Number: Q90133

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

There is a known problem in Microsoft LAN Manager versions 2.1a and

earlier that causes file truncation when the workstation (client)

machine is faster than the server. This problem is not specific to

Microsoft Access, but can cause irreversible damage to a networked

database if Microsoft Access is used in conjunction with Microsoft LAN

Manager versions 2.1a and earlier.

More Information:

When a client workstation sends information to the server through LAN

Manager version 2.1a or earlier, LAN Manager performs a "lazy" write

(that is, the data is buffered in memory and then written to disk at a

later time). If the client machine sends information to the server too

quickly, the server sends a message to the client telling it to send

information slower or to wait. With LAN Manager versions 2.1a and

earlier, this "slow down" message is misinterpreted by the client

redirector and the client writes 0 bytes to the file, effectively

truncating it wherever the write was occurring.

This problem is specific to the lazy writing process. When the client

writes to the server, it sends the data in a burst. This burst

overloads the server and elicits the slow down message.

To work around this problem, disable the lazy write function of the

LAN Manager client. This can be done by adding the following line to

the [Workstation] section in the LANMAN.INI file:

   ;.............012345678901234567890123456789012

   wrkheuristics=X0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Note: The top line with the numbers is only a comment line for

spacing. The total number of x's and 0's (zeros) is 33 decimal.

This workaround should be used with Microsoft LAN Manager versions

2.1a and earlier. This problem was corrected in Microsoft Windows for

Workgroups.

Note: This information is also located in the README.TXT file.

References


PRACC9211: Cannot Cascade or Tile with 50 Windows in Access

 Article Number: Q90134

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

PROBLEM ID: PRACC9211001

SYMPTOMS

   If you have 50 Microsoft Access objects open and you choose Cascade

   or Tile from the Window menu, the screen does not change. No error

   message is displayed.

CAUSE

   There is not enough available memory for Windows to perform the

   operation.

RESOLUTION

   Close some of the open windows.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here as it becomes available.

More Information:

To duplicate this scenario, create 49 query windows. The Database

window counts as one window. Choose Cascade or Tile from the Window

menu. Nothing will change.

References


PRB: Form Displays Data from Deleted Field in Query

 Article Number: Q90135

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   If you have a form based on a query and you remove a field from the

   QBE grid, you may still see the data from the deleted field in Form

   browse mode.

   You will not see the data from the deleted field if you save and

   reopen the form. The field will have the "#Name?" error in the text

   box.

CAUSE

   A form is based on the compiled query. The query must be recompiled

   before the form recognizes the absence of the field. Microsoft

   Access does not recompile queries "on the fly."

RESOLUTION

   When the form is closed and reopened, the query is recompiled.

   There is another way to have the form recompile the query. While in

   Design view for the form, place your cursor in the text box for the

   newly deleted field. Press the ENTER key. From the View menu,

   choose Form and note there is an error in the TITLE text box.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Load the NWIND database.

2. Create a new query using the EMPLOYEES table.

3. Drag the LASTNAME and TITLE fields to the QBE grid.

4. Save the query as Query1.

5. Create a new form based on Query1.

6. Drag all the columns from the field list to the form.

7. View the form in Browse mode by choosing Form from the View menu.

8. Go back to the query and delete the TITLE column from the grid.

   Save the query.

9. Go back to the Form window. View the form in Browse mode again.

Reference(s):

"Microsoft Access User's Guide," version 1.0, page 100

References


PRB: Limited to 65535 Pages in Print Dialog Box

 Article Number: Q90136

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   In the Print dialog box the largest value allowed in the Pages To:

   control is 65535. If a number greater than 65535 is entered, the

   following message is displayed:

      The 'To' field contains non-numeric characters or a number greater

      than 65535

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide." Version 1.0, pages 31-32, 209, 410.

References


PRB: Report Can't Be Opened or Previewed

 Article Number: Q90137

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   If you open a report in Design mode and switch to Preview mode, the

   report is not previewed. In addition, if you select the report from

   the Database window and choose to open the report, nothing happens.

CAUSE

   The report's OnOpen event may have a macro attached to it that has

   the first action listed as StopAllMacros. This macro action acts

   like the CancelEvent action, which prevents the report from opening.

   The StopAllMacros action stops all macros that are currently

   running. In this case, the report's OnOpen event calls a macro that

   is immediately terminated, which aborts the preview of the report.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new macro and add the StopAllMacros action.

2. Save the macro as Macro1.

3. Open a report in design mode.

4. Set the Report Property OnOpen event to Macro1.

5. Preview the report. Note that nothing happens.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 522, 566.

References


PRB: Pressing CTRL+ALT+SPACEBAR Enters Control's Default Value

 Article Number: Q90138

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   When you create a form based on a table that has one or more fields

   defined with the field property DefaultValue, pressing

   CTRL+ALT+SPACEBAR inserts the control's default value defined in

   the form, not the table's default value. If no value has been

   specified, the underlying table's default value is entered in the

   field.

   When you are entering data in the table's datasheet mode, pressing

   CTRL+ALT+SPACEBAR enters the field's default value, as defined in

   the table.

CAUSE

   When you create a form based on a table with one or more fields

   defined with the field property DefaultValue, new controls bound to

   such a field will have the control's DefaultValue property filled

   in with the same default value. You may keep this value, change it,

   or delete it.

   When you enter new records using form Browse mode, any control that

   has a DefaultValue property will be displayed with the control's

   default value. If you decide that you want to have the default

   value that was defined in the table entered, you will have to type

   it in. In form Browse mode, when you press CTRL+ALT+SPACEBAR, the

   default value defined for the control is entered.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a table with a text field called City and a text field

   called State.

2. For the State field, enter "NC" for the DefaultValue property.

3. Create a form based on this table.

4. Add text boxes for the City and State fields.

5. Change the DefaultValue property for the control bound to the

   State field to "WA".

6. Browse the form.

   The first record has "WA" displayed in the State field.

7. Delete "WA" and enter "CA". Commit the record.

8. Delete "CA" and press CTRL+ALT+SPACEBAR. Note that "WA" is

   inserted.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 229-230

References


PRB: #Error Appears Using TRIM() in Forms or Reports

 Article Number: Q90139

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you have a form or report with the RecordSource property defined

   as a table that contains no records, "#Error" will be displayed

   when you preview the report or browse the form if a bound

   control(s) is defined using the TRIM() function.

CAUSE

   When an expression is used to define the ControlSource property for

   a form or report, Microsoft Access evaluates the expression and

   presents the result for the control. If a blank field is evaluated,

   "#Error" appears.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a table with two text fields named Field 1 and Field 2.

2. Create a report bound to this table.

3. Place the fields in the detail section of the report.

4. Modify the ControlSource property for Field 1. Enter the following:

     =Trim([Field One])

5. Preview the report.

   You will see "#Error" where data would appear for Field 1. Field 2

   will be blank.

6. Create a form bound to the table.

7. Place the fields in the detail section of the form.

8. Repeat step 4.

9. Browse the form.

   You will see the same results as for step 5.

Reference(s):

"Microsoft Access User's Guide," version 1.0, page 485-486

References


INF: Err Msg: Operation Not Supported on Paradox Table...

 Article Number: Q90140

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

When you create a Microsoft Access Report based on a nonkeyed Paradox

table, or when you attempt to run a Microsoft Access query with the

table added twice, you will receive the following error message:

   Operation not supported on Paradox table with no primary key.

More Information:

In Microsoft Access, if you attach to a Paradox version 3.0 or 3.5

table, it is best to have a key field defined in the table. Paradox

creates an index (.PX) file that should always be in the same

directory as the table (.DB) file. Important information is stored in

the .PX file. Attaching to nonkeyed Paradox tables limits the report

and query capabilities of Microsoft Access.

Query Limitation

----------------

You can create a nonupdatable query based on a nonkeyed Paradox table.

However, you can add the table only one time to the query. If you add

the table twice, you will receive the error mentioned above when you

attempt to run the query.

Report Limitation

-----------------

You cannot use or design a Microsoft Access report based on a query

using nonkeyed Paradox tables.

When you create a new report and select the query to base the report

on, the error above will appear. Choose the OK button to close the

error dialog box and view the report in Design mode. If you look at

the Field List for the report, you will not see any fields listed.

The above limitations occur because attached non-keyed Paradox tables

can only be opened once in Access. Use of the table in both of these

scenarios requires the table to be opened more than one time in order

to perform the specific Microsoft Access task.

For more information, search on "Paradox" using the Help menu.

Paradox is manufactured by Ansa Software (a Borland company), a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 62-63.

References


PRB: DoCmd OpenReport Opens Rpt in 3 Views or Prints to File

 Article Number: Q90141

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 12975

SYMPTOMS

   You can enter a Microsoft Access Basic command in the Immediate

   window to open a report in a view that is not one of the available

   views you see when you create a macro using the OpenReport action.

   The Output As dialog box appears when the following command is

   issued in the Immediate window:

      DoCmd OpenReport "My Report", 3

   The following error message will be displayed if you try to save

   the report using the displayed Output As dialog box:

      Action OpenReport was canceled.

STATUS

   This behavior is by design.

More Information:

You can create a macro that will open an existing report in one of

three views. The view arguments supported in macros are:

   0   Print

   1   Design

   2   Print Preview

The following Access Basic command does not cause an error message to

appear even though it calls an argument that is not supported from

within a macro:

   DoCmd OpenReport "My Report", 3

The Output As dialog box appears and waits for user input to specify

the name of the text file that output should be directed to.

Reference(s):

"Microsoft Access Language Reference," version 1.0, pages 355-356

"Microsoft Access User's Guide," version 1.0, page 562

References


PRB: Toggle Button with CancelEvent on BeforeUpdate Property

 Article Number: Q90142

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   If you have a form containing a toggle button with the BeforeUpdate

   property set for a macro that performs the CancelEvent action, the

   toggle button will behave differently than text boxes with the same

   BeforeUpdate property setting.

   Open a form that has an toggle button defined in this manner. Click

   the toggle button, then tab to the next control. You will see that

   the record is dirtied and the toggle button is not pressed down.

   Move to another record. If you click a text box, then tab to

   another control, the record is not dirtied.

CAUSE

   Text boxes have a state in which they hold a dirty value that

   cannot be saved or validated. This is why you can click a text box

   and, without making a change, move to another control.

   Toggle buttons do not have a static state holding a dirty value

   that cannot be validated. When the CancelEvent occurs, the button

   is left in its original, up state. The button code does not

   consider the button to be dirty after the save failed. It has the

   original clean value.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, page 529

References


PRB: Memory Block Not Freed If Cue Cards Not Installed Right

 Article Number: Q90143

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you do not install Cue Cards during a custom installation of

   Microsoft Access, and later you copy the CUECARDS.DLL file to the

   directory where you installed MSACCESS.EXE, you will receive an error

   stating that Cue Cards has not been installed correctly when you

   push one of the Cue card buttons. When you click the OK button to

   cancel out of Cue Cards the following error message is displayed:

      1 Global memory block is not freed.

RESOLUTION

   When you end the current session of Microsoft Access this block of

   memory will be released. To correctly install Cue Cards, re-run the

   Setup program and choose Custom Installation. Select only the

   Cue Card section to install.

STATUS

   This behavior is by design.

References


INF: Form OnOpen Event May Not Set Values of Unbound Controls

 Article Number: Q90146

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

If you have a form with unbound controls that should have values set

by a macro called from the form's OnOpen event, the macro should

include a GoToControl or GoToRecord action before the SetValue

action(s). The reason you cannot immediately refer to controls' values

in an OnOpen macro is that the OnOpen event occurs before the form is

opened.

If the first action defined in the OnOpen macro is SetValue, Microsoft

Access cannot refer to any controls on the object because it has not

yet been opened.

More Information:

The OnOpen event for forms and reports occur before the object is

opened. When a macro is designed for use as an OnOpen event, actions

such as GoToControl or GoToRecord, by default, refer to the object the

macro was called from. To force the focus to a specific control, insert

the GoToControl action before the SetValue action in the macro. Then

you can set the values of any control(s) on the form.

If the control's values should come from a record, insert the

GoToRecord action.

For more information, search Help for "OnOpen" and select the topic

"OnOpen, OnClose Properties."

Reference(s):

"Microsoft User's Guide," version 1.0, chapter 22, "Using Macros with

Forms," pages 528, 538-539

References


PRACC9110: Cannot Unhide Windows After Out of Memory Message

 Article Number: Q90147

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: PRACC9210002

SYMPTOMS

   If you receive an "Out Of Memory" error message after you have hidden

   many Access windows you may be unable to unhide, or Show, any of the

   hidden windows. You will still be able to continue to hide additional

   windows.

CAUSE

   In order for Access to show hidden windows, the Windows

   "Unhide Windows" dialog box must be brought up. This requires memory.

   If Windows has previously detected insufficient memory and generated

   an "Out of Memory" error message this dialog box cannot be called.

   Therefore, you will not be able to choose Show from the Access Window

   menu to unhide your windows.

STATUS

   Microsoft has confirmed this to be a problem in Access version 1.0.

   We are researching this problem and will post new information here as

   it becomes available.

References


INF: Access Not Prompting for Second Parameter in Query

 Article Number: Q90148

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

Microsoft Access allows the use of user-entered parameters in queries.

If you construct a query that requires more than one prompt, each

prompt must have different syntax.

More Information:

For example, a query prompts the user for the product ID and product

name from the Products table in the NorthWind Traders sample database

shipped with Microsoft Access. This query will find information based

on both values or either value. However, the prompt values placed in

the criteria fields of the query grid cannot be the same for both

fields. The following example is incorrect:

   Field:    Product ID        Product Name

   Sort:

   Show:         X                  X

   Criteria: [Enter Value:]

   or:                         [Enter Value:]

Microsoft Access considers the two parameter prompts, [Enter Value:],

to be one prompt. Once the first is filled with the user's search

criteria, Microsoft Access thinks the second is filled as well.

The following is an example of a multiple-parameter query that prompts

for both values:

   Field:    Product ID            Product Name

   Sort:

   Show:         X                       X

   Criteria: [Enter Product ID:]

   or:                             [Enter Name:]

If these prompts are used, Microsoft Access will prompt for both values.

References


INF: Exporting to SQL Server Does Not Create Indexes

 Article Number: Q90149

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

Microsoft Access can update an attached SQL Server table only if the

table has a unique index. However, Microsoft Access does not build

indexes on the SQL Server table when exporting information.

More Information:

Microsoft Access allows you to export data to SQL Server backends.

However, Microsoft Access does not build the index on export, thus

creating potential problems and confusion. For example, if you then

attach the table, updates are not allowed and the data is displayed as

read only in datasheet or form view.

To work around this export problem, manually create the SQL Server

table indexes. After the indexes are created, you can create forms

based on the attached SQL Server tables and the data will be

updateable.

For more information on creating indexes on SQL Server database

tables, see the SQL Server "System Administrator's Guide" or pages

67-72 in the SQL Server "Language Reference."

References


INF: Custom Menus Cannot Be Implemented with Pop-up Forms

 Article Number: Q90150

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

A form will not process the macro associated with the OnMenu property

if the form is designed with the PopUp property set to True. A form

that is designed as a pop-up window does not have any menus associated

with the form. If you want a custom menu when the pop-up window is

created, you must have a separate non pop-up window create and

maintain the custom menu.

According to "The Windows Interface - An Application Design Guide,"

dialogs (pop-up) do not generally have menu bars.

Reference(s):

"The Windows Interface - An Application Design Guide," page 57,

Microsoft Press, 1992.

References


INF: Windows for Workgroups, Novell, SQL Server, and Access

 Article Number: Q90151

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

If you are running SQL Server on a NetWare network and try to add

Access and Windows for Workgroups, you will not be able to talk to

SQL Server from Access version 1.0. Windows for Workgroups and SQL

Server have NetWare support, but the two are currently incompatible.

More Information:

Named pipes (the communication protocol used by SQL Server) are

serviced from NETAPI.DLL. The Windows for Workgroups NETAPI.DLL

overrides the Novell NETAPI.DLL, so communication with SQL Server is

broken.

You can work around this problem by using the Netware Integration Kit

(NIK) for Novell. The NIK enables Microsoft Access and Windows for

Workgroups to communicate with SQL Server on a Novell network.

You can order the NIK from Microsoft Consumer Sales at (800) 426-9400.

Microsoft Consumer Sales is open Monday through Friday, 6:30 A.M. to

5:30 P.M., Pacific time.

This

References


INF: Paradox Tables, Indexes, and Multiple Connections

 Article Number: Q90152

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

If a Paradox table does not have a primary key, then it cannot be

opened twice, even exclusively. This means it cannot be used in more

than one place in a query or code.

More Information:

If you try to attach to a Paradox table that has no primary key, you

will get an error stating that the operation is not supported on

Paradox tables without a primary key. This can be confusing, because

you can create the query that accesses the table twice, but if you try

to use it, you will get this error. In addition, if anyone tries to

get the output column list of the query, this error will occur.

References


INF: Bitmaps Hide the Caption of a Push or Option Button

 Article Number: Q90153

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

This article discusses the limitations of using Microsoft Access push

button or option button controls with bitmaps.

More Information:

Microsoft Access has a Picture Property setting on command buttons

that can be  used to import a bitmap that will be displayed on the

button. This setting will place the caption "behind" the picture and

the caption will no longer be visible.

Reference(s):

"Microsoft Access Users Guide," version 1.0, chapter 8, pages 188-211.

References


INF: Form Must Close for Modal & Popup Settings to Take Effect

 Article Number: Q90154

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

When you change a form's Modal or PopUp property while designing the

form, the changes will not take effect until after the form is closed

and re-opened. Simply switching to browse mode will not reflect the

changes, even after the properties are entered.

Reference(s):

"Microsoft Access Users Guide," version 1.0, chapter 9, pages 213-268

References


INF: Horizontal Sizing Controls Availability on Controls

 Article Number: Q90155

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

After placing a control on a form, the horizontal sizing controls will

only be enabled if the Height property of the control is greater than

or equal to .26 inches. The default size for many controls is less

than .26 inches, so horizontal sizing points will not appear.

This means it could be very difficult to alter the horizontal size of

a control if the snap to grip option is enabled, because the slightest

movement causes a snap to grid to occur.

One workaround is to temporarily set the size of a control to .26

inches, alter the horizontal size, then reset the Height property to

its original value. Alternatively, the Height property can be set as

the default for the control. To do this, select a control on the tool

bar, display the Properties list, and change the default Height

property.

Reference(s):

"Microsoft Access User's Guide," version 1.0, chapter 9, pages 213-

268.

References


INF: Border Widths Not Supported with Raised or Sunken Effects

 Article Number: Q90156

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

Border width properties are not applicable to controls with raised or

sunken properties set. You can effectively mimic these features of

Access by using the line control.

More Information:

When you are in Form Design mode, setting the BorderWidth property in

the palette screen will not have any affect on a control if the raised

or sunken effects are enabled.

To workaround this behavior, you can enable these properties for the

control(s) in question and then, using the line control, create your

own sunken or raised effect. You can set the width of the line to

whatever you desire. The sunken and/or raised effect is accomplished

by placing lines around a standard control.

Additional Reference(s):

"Microsoft Access User's Guide," version 1.0, chapter 9.

References


PRACC9210: Find Toolbar Button Not Grayed After Pressing

 Article Number: Q90158

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: PRACC9210003

SYMPTOMS

   After pressing the F7 key the Find Button on the Toolbar is not

   grayed out.

RESOLUTION

   Instead, if the Find command on the Edit menu is selected, or

   or the user presses the Find button, the Find button is grayed out.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here as it becomes available.

Additional Reference(s):

"Microsoft Access Getting Started Guide," version 1.0, page 117.

References


INF: Minimized Popup Forms Cannot be Easily Restored

 Article Number: Q90160

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

If you use the Minimize action in a macro to minimize a Popup form in

Access, it may be difficult to restore the Popup form.

More Information:

If the mouse double click is on the icon's caption, it will restore the

Popup form as any other icon restores the window state.

Windows does not allow the restore of a window unless it has the

Minimize Box on the window. Popup forms in Access do not have a

Minimize Box and therefore they work differently.

Reference(s):

"Microsoft Access User's Guide" version 1.0, Chapter 9, Designing

Forms.

References


PRB: Opening Screen Size Is Different from Earlier Session

 Article Number: Q90161

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

When starting Access, the window position and size may not be the same

as it was when Access was last closed. This behavior is by design.

Access does not currently have any support to maintain the window state

between sessions.

More Information:

Windows determines where an application appears. Some applications

remember if they were maximized, and some keep window state

information relative to the screen and size of a window. Access

remembers if it was closed while maximized, and will restart that way

if it was.

References


PRB: SCROLL LOCK Has No Effect in Form Browse

 Article Number: Q90162

 CREATED: 11-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   Pressing the SCROLL LOCK key in Microsoft Access has no effect in

   Form or Table Browse mode.

STATUS

   This behavior is by design.

More Information:

Microsoft Access does not use the SCROLL LOCK key in the same way as

Microsoft Excel. Pressing SCROLL LOCK in Excel locks the current

position of the cursor and moves the data around within this area.

This behavior was designed into Microsoft Excel, but not into Microsoft

Access.

References


INF: Temporarily Disabling a Macro Action

 Article Number: Q90167

 CREATED: 11-OCT-1992

 MODIFIED: 23-JUN-1993

Summary:

Programming languages, such as Access Basic, typically provide a way

to temporarily disable any syntax on a line of code. For example, in

Access Basic, you can place a REM command at the beginning of a line

of code so that it is not executed. This feature is useful when you

are debugging several lines of code because it allows you to determine

which line is causing an error by disabling one line at a time until

the error no longer occurs.

This method can also be useful for debugging macros. This article

describes how you can temporarily disable a macro line.

More Information:

To disable a macro action line without deleting it:

1. Open the macro sheet containing the line you want to disable.

2. If there is no Conditions column, choose Conditions from the

   View menu to open the Conditions column.

3. In the Conditions column, on the line you want to disable, type

   "False" (without quotation marks) if there is nothing in the column

   for that line, or "False And" (without quotation marks) if a

   condition is already entered in the column.

Now, when you run the macro, the Condition for the macro action will

be evaluated as false and the line will be ignored.

References


INF: How to Make Access Opening Screen Display

 Article Number: Q90170

 CREATED: 11-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

To have the initial Access opening screen appear when starting Access,

you can edit the MSACCESS.INI file. Open MSACCESS.INI in Windows

Notepad (or any other text editor), and search for "Tutorial=" under

the [Microsoft Access] section.

Change the entry from

   Tutorial=0

to

   Tutorial=1

For example:

   [Microsoft Access]

   Tutorial=1

This causes the selection in the option box on the opening screen to

be canceled, which means that the initial Access screen will display

every time it is started. If you select the box again, the initial

screen will not be displayed on startup.

References


PRB: Reason Val() Function Returns Invalid Use of Null Message

 Article Number: Q90722

 CREATED: 21-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you create a function that uses the Access Basic function Val() and

   evaluates a null field on a form, the following error message is

   generated:

         Invalid Use of Null

RESOLUTION

   The Val() function is giving an expression evaluation error when NULL

   fields are encountered.

   The Val() function returns the numeric value of a string of

   characters.

   Microsoft has confirmed that this behavior is by design.

Reference(s):

"Microsoft Access Language Reference," version 1.0, pg. 489.

References


PRB: Load From Query Dialog Title Does Not Match Menu

 Article Number: Q90723

 CREATED: 21-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The title of the 'Load From Query' dialog box does not match the

   menu name that opened the dialog box. Instead 'Applicable Filter'

   is displayed in the dialog box.

   Steps to Reproduce Behavior

   ---------------------------

   1. Open a form.

   2. Select the EditFilter command from the Records menu.

   3. Select LoadFromQuery command from the File menu.

RESOLUTION

   Microsoft has confirmed this behavior is by design.

References


PRB: Focus Doesn't Shift When Find Accelerators Are Depressed

 Article Number: Q90724

 CREATED: 21-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Using the Hot keys on the Find dialog box to select the Find First

   button does not change the focus from the Find Next button to the

   Find First button. However, clicking on the Find First button with

   the mouse does change the focus.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access & Open NWIND.

2. Open "Order Details" table.

3. Click on the FastFind Button (binoculars on the Toolbar.)

4. Set Search as formatted to TRUE.

5. Set Search Text for "10002".

6. The focus is on Find Next so press the accelerator combo for Find

   First (ALT+S).

Result: The Find First button is depressed as expected, but the focus

remains on the Find Next button which originally had the focus. If you

select the Find First button using the mouse, the Find First button

then receives the focus.

References


PRB: Giving Controls Duplicate Name Doesn't Generate Error

 Article Number: Q90725

 CREATED: 21-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   If you give a control the same name as another control, and you

   press TAB or ENTER, the following error message appears:

      You already have a Control name <control name>

   However, if you click outside the property sheet instead of

   pressing TAB or ENTER, the error message does not appear and the

   control returns to its original name.

CAUSE

   Because Microsoft Access cannot prevent you from clicking outside

   the property sheet, it was decided that clicking outside the

   property sheet would silently commit any changes and if the changes

   violated integrity, the changes would be canceled. If Microsoft

   Access hadn't been designed in this manner, the error message would

   appear when you were in the wrong window, which might be confusing.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Place two text boxes on a form.

2. Set the control name of one text box to Field0.

3. Set the control name of the second text box to Field0, but instead

   of pressing ENTER, click outside the property sheet.

   The error message does not occur, and the control reverts to its

   original name as if you had canceled the event.

References


INF: Control Names >40 Chars in Access Basic Require Brackets

 Article Number: Q90801

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

If controls greater than 40 characters are referenced in Microsoft

Access Basic, the following error message appears:

   Identifier too long

More Information:

There is a limit of 40 characters in a "standard" Access Basic

identifier. If you want to use an identifier longer than 40

characters, use the "nonconforming" identifier syntax by surrounding

it with square brackets ([]).

Steps to Reproduce Behavior

---------------------------

1. Create a form (Form1) with a text box (Field0).

2. Create a new module.

3. Open the Immediate window.

4. In the Immediate window, type:

      Forms!form1.field0.controlname = _

         "aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeee"

   The control is set correctly.

5. Try to reference this control by typing:

      ?Forms!form1.aaaaaaaaaabbbbbbbbbbcccccccccc_

                             ddddddddddeeeeeeeeee.TextColor

   The "Identifier too long" message appears.

Reference(s):

Microsoft Access online Help file, "Standard Naming Conventions" topic

References


PRB: Invalid Use of Null Alert Assigning Null Control

 Article Number: Q90802

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Default fields values are set to Null. If you use the Eval()

   function on a field without a value you will get the following

   error message:

      Invalid Use of Null Alert

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a form (Form1) with a textbox (Field0).

2. Switch to Browse view.

3. Open a module.

4. Type the following line in the immediate window:

      stForm$ = Eval("Forms!Form1!Field0").

   Results: Invalid Use of Null Alert.

References


PRB: Object Buttons in Database Window Do Not Change Colors

 Article Number: Q90803

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 12047

SYMPTOMS

   Changing the default button colors in Windows Control Panel does

   not affect the colors of the buttons in the Database window.

CAUSE

   These buttons are actually hard-coded bitmaps, and there is no way

   to dynamically change their face, shadow, and highlight colors.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Change one of the button color properties by choosing the Color

   icon in Control Panel.

2. Return to Microsoft Access and go to the Database window. All the

   object buttons (Table, Form, Query, and so on) still use the

   default colors.

References


INF: Can't Change Borders of Up or Pressed Down Controls

 Article Number: Q90804

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

Setting the border color or border width of an up or pressed down

control has no effect. The border color and size is determined by

Microsoft Access and cannot be altered by the developer. If you would

like to control the border width or the border color, the appearance

must be set to normal.

This behavior is by design.

References


PRB: GoToControl to Self in AfterUpdate Ignored

 Article Number: Q90806

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When a control has the focus, and the GoToControl action is

   executed with the same control name that has the focus, the focus

   will move to the next control in the tab order. The focus will not

   stay on the control that currently has the focus, as expected.

RESOLUTION

   To prevent the focus from leaving the field, you can use an OnExit

   macro that performs the CancelEvent action. Or, if you want to

   prevent the field from being saved (and also prevent the focus from

   leaving the control), you can use a validation rule or a

   BeforeUpdate macro.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. In NWIND.MDB, create the following macro:

      Condition                 Action           Control Name

      --------------------------------------------------------

      ([Category ID]="aaaa")    GoToControl      [Category ID]

2. Save the macro as Macro1.

3. Open the Categories form in design mode. Call the macro in the

   AfterUpdate property of the CategoryID control.

3. View the Categories form in Browse mode.

4. Type "aaaa" into the [Category ID] field and press TAB.

   The focus moves to the next field in the tab order. However, if you

   had moved to another control before pressing TAB, the focus would

   not have changed.

References


PRB: HelpContextID Does Not Validate Negative Values

 Article Number: Q90808

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Entering a value of less than 0 in the HelpContextID property of a

   form does not generate an error message.

STATUS

   This behavior is by design.

More Information:

The acceptable value range is 0 to 2,147,483,647. Numbers above

2,147,483,647 generate an error message, but numbers less than 0 do

not. The HelpContextID is just a number that Microsoft Access passes

to the Microsoft Windows application programming interface (API)

WinHelp() function, which takes an unsigned long. Microsoft Access

property sheets don't recognize unsigned longs, so large numbers show

up as negative numbers instead.

Steps to Reproduce Behavior

---------------------------

1. Create a new item on a form.

2. Open the property sheet.

3. Enter a negative number for the HelpContextID; for example, -1000.

   Microsoft Access will not generate an error.

References


INF: How to Use a Query to Filter Unique Data

 Article Number: Q90809

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

When you want to filter a table to eliminate duplicate data, you need

to use a query that uses one of the aggregate functions--First(),

Last(), Min(), or Max()--in the fields that DO NOT contain the

duplicate data. The fields that contain the duplicate data should

contain the Group By() function.

More Information:

For example, suppose you import an inventory table from an application

and discover that the data has duplicates in it. Your goal is to get

the data back down to a baseline, such as one record per product, so

you can then reinventory and have a correct and complete set of data.

You can use a query to filter the data.

Your table might look like this:

   ProdID   Description   Cost   MarkUp    Quantity

   ------------------------------------------------

   1        A Product     $1.50  0.5      10

   2        B Product     $2.50  0.7      100

   3        C Product     $1.59  0.9      25

   2        D Product     $4.59  0.8      30

   5        E Product     $1.99  0.7      40

   6        F Product     $2.69  0.4      60

   9        G Product     $4.95  0.8      20

   8        H Product     $6.79  0.9      32

   9        I Product     $6.89  0.7      0

   1        J Product     $2.99  0.5      11

If you want to filter the table down to the point where it has a

unique ProdID code and take the first entry from each of the other

fields, you can create a query to do this, as follows:

1. Create a new query based on the original table by selecting it from

   the table list and clicking the New Query button on the toolbar.

2. Drag all the fields from the Field list to the query grid.

3. From the View menu, choose Totals.

4. Set the Total line of the query grid to First() for every field

   except ProdID, which is set to Group By().

5. From the View menu, choose Datasheet.

The data you see should be a list of unique ProdID data with the first

value that is encountered for that product in each of the other

fields. If you use this procedure on the above data your result should

be:

   ProdID   Description   Cost   MarkUp   Quantity

   -----------------------------------------------

   1        A Product     $1.50  0.5      10

   2        B Product     $2.50  0.7      100

   3        C Product     $1.59  0.9      25

   5        E Product     $1.99  0.7      40

   6        F Product     $2.69  0.4      60

   8        H Product     $6.79  0.9      32

   9        G Product     $4.95  0.8      20

To obtain different results, you can use Max(), Min(), or Last()

instead of First().

To generate a unique table from this query, you could change the query

to a make-table query during the query design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 139-144

References


INF: How to Force a New Line in a MsgBox Statement

 Article Number: Q90810

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

To force a new line in a message box, enter the message as a string

formula and concatenate a carriage return/line feed, Chr$(13) +

Chr$(10), into the message anywhere you want the message to start a

new line.

More Information:

For example, if you had the message:

   Notice: This is an Important Message!

And instead of having it all display on one line, or letting Access

determine where to break the message onto a new line, you want to

force it to display as:

   Notice:

   This is an Important Message!

To force the message to display like this you need to enter the

message as a string formula. If you call the message box from a macro

the syntax would be:

   Action

   ------

   MsgBox

      Message: ="Notice:" & Chr(13) & Chr(10) & "This is an Important

               Message!"

If you call the message box from a macro the syntax would be:

   MsgBox "Notice:" & Chr(13) & Chr(10) & "This is an Important

          Message!"

Note: The formulas above should be entered on one line.

These formulas place "Notice:" on the first line and insert 1 carriage

return\line feed to force a hard carriage return between the 2 lines

of text.

Reference(s):

"Microsoft Access Language Reference," version 1.0, pages 19, 66, 316-

320.

References


INF: How to Check a Menu Item Using Access Basic

 Article Number: Q90811

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access does not have any built-in macro or Basic commands

that allow you to place a check mark beside or remove a check mark

from a menu command. To do this in Microsoft Access, you must use

Access Basic code to call Microsoft Windows application programming

interface (API) functions.

More Information:

The following API function is used to check and uncheck a menu item:

CheckMenuItem% (hMenu%, wIDCheckItem%, wCheck%)

----------------------------------------------------------------------

This function places check marks next to or removes check marks from

menu items in the pop-up menu specified by the hMenu% parameter.

   hMenu%         Identifies the menu.

   wIDCheckItem%  Specifies the menu item to be checked.

   wCheck%        Specifies how to check the menu item. The

                  wCheck% parameter can be a combination of the

                  MF_CHECKED or MF_UNCHECKED with MF_BYPOSITION or

                  MF_BYCOMMAND flags. These flags can be combined

                  by using the bitwise OR operator. The values are

                  described as follows:

                  Value          Meaning

                  -----          -------

                  MF_BYCOMMAND   Specifies that the idCheckItem

                                 parameter gives the menu-item

                                 identifier (MF_BYCOMMAND is the

                                 default).

                  MF_BYPOSITION  Specifies that the idCheckItem

                                 parameter gives the position of the

                                 menu item (the first item is at

                                 position zero).

                  MF_CHECKED     Selects the item (adds check mark).

                  MF_UNCHECKED   Clears the item (removes check mark).

   Return Value   The return value specifies the previous state of

                  the item. It is either MF_CHECKED or

                  MF_UNCHECKED. The return value is -1 if the menu

                  item does not exist.

   Note: Top-level menu items (items on the Microsoft Access menu bar)

         cannot have a check mark.

Example

-------

The example below creates a menu, associated with a form, that can be

used to check and uncheck a menu command.

1. Create a new macro. After adding the following actions and their

   associated properties, save the macro and name it "Menu Checking

   Macro." To display the "Macro Name" column, choose Macro Name from

   the View menu.

      Macro Name             Action        Function Name

      -----------------------------------------------------------

      &Check                 RunCode       Check_Menu_Item(0,0)

      &UnCheck               RunCode       UnCheck_Menu_Item(0,0)

   Note: The first parameter in the functions indicates which menu on

   the menu bar to use. All menus are zero based. For example, if your

   menu bar contains the File, Edit, Window, and Help menus, and you

   specify 2 as the first parameter for one of these functions, the

   function will work on the Window menu. A 2 indicates the Window

   menu instead of the Edit menu because the parameter uses base 0

   instead of base 1; therefore, 0 indicates the File menu, 1

   indicates the Edit menu, and so on.

   The second parameter in the functions indicates which menu command

   (on the menu indicated in the first parameter) to place the check

   mark beside. This parameter also uses base 0. To refer to the first

   command on the menu, use 0; to refer to the second, use 1; and so

   on.

2. Create a new macro. After adding the action below and its

   associated property, save the macro as "Custom Menu".

      Action

      ------------------------------------------

      AddMenu

         Menu Name:          &Check

         Menu Macro Name:    Menu Checking Macro

3. Create a new blank form and display the Properties window of the

   form by choosing Properties from the View menu.

4. Set the OnMenu property to "Custom Menu".

5. Close the form by choosing Close from the File menu. Save the form

   as "Menu Checking Form".

6. Create a new module from the Database window. In the new module,

   enter the Microsoft Access Basic code listed at the end of this

   document. Save the module as "Menu Checking Code".

7. From the Database window, select the "Menu Checking Form" form and

   then choose the Open button to display the form in Form view. The

   normal Microsoft Access menu will disappear and be replaced by the

   custom menu that was designed above.

8. There are two options on the Check menu. If you choose the Check

   command, and the command will be checked. If you choose the UnCheck

   command, the Check command will be unchecked.

'********************************************************************

'Declarations section of the module.

'********************************************************************

Option Explicit

' NOTE: EACH DECLARATION MUST BE ENTERED ON ONE SEPARATE LINE.

Declare Function GetMenu% Lib "user" (ByVal hWnd%)

Declare Function GetSubMenu% Lib "user" (ByVal hSubMenu%, ByVal nPos%)

Declare Function CheckMenuItem% Lib "user" (ByVal hSubMenu%,_

                  ByVal nPos%, ByVal Flag%)

Declare Function FindWindow% Lib "user" (ByVal lpClassName As Any,_

                  ByVal lpCaption As Any)

Declare Function IsZoomed% Lib "user" (ByVal hWnd%)

Const MF_BYPOSITION = &H400

Const MF_BYCOMMAND = &H0

Const MF_CHECK = &H8

Const MF_UNCHECKED = &H0

Const MyNull = 0&

Const ClassName = "OMain"

Dim ChWnd%       ' Handle to the Microsoft Access window.

Dim hMenuTop%    ' Handle to the Microsoft Access menu.

Dim hSubMenu%    ' Handle to the pop-up menu associated with hMenuTop%.

Dim ItemID%      ' Command ID associated with a specified menu item.

Dim ReturnVal%   ' Function return value may be used depending on

                 ' the function.

'=====================================================================

' This function displays a check mark next to the menu item.

'=====================================================================

Function Check_Menu_Item% (TopLevel%, SubLevel%)

   'If the form is maximized, the system menu is added to the forms

   'menu bar, so increment the actual TopLevel%

   If (IsZoomed(Screen.ActiveForm.hWnd)) Then

      TopLevel% = TopLevel% + 1

   End If

   Call Get_Menu_Handles(TopLevel%)

   ' The following statement must appear on one line.

   Check_Menu_Item = CheckMenuItem(hSubMenu%, SubLevel%,_

                      MF_BYPOSITION Or MF_CHECK)

End Function

'=====================================================================

' This function initializes:

'   - The window handles associated with the Microsoft Access form.

'   - The handle to the menu of the specified window.

'   - The menu handle of the specified pop-up menu of the Window menu.

' The variables here are global to the database.

'=====================================================================

Sub Get_Menu_Handles (TopLevel%)

   ChWnd% = FindWindow(ClassName, MyNull)

   hMenuTop% = GetMenu(ChWnd%)

   hSubMenu% = GetSubMenu(hMenuTop%, TopLevel%)

End Sub

'=====================================================================

' This function will uncheck a menu item.

'=====================================================================

Function UnCheck_Menu_Item% (TopLevel%, SubLevel%)

   Call Get_Menu_Handles(TopLevel%)

   ' The following statement must appear on one line.

   UnCheck_Menu_Item% = CheckMenuItem(hSubMenu%, SubLevel,_

                              MF_BYPOSITION Or MF_UNCHECKED)

End Function

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 596-602

References


PRB: Can't Refer to Record in Function Called by OnClose Event

 Article Number: Q90812

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you attempt to refer to the last record that was displayed by a

   form in a function or macro that was triggered by the OnClose event

   of the form, instead of receiving information about the last record

   that was displayed, you will receive information about the first

   record of the bound table or query.

CAUSE

   This behavior occurs because the OnClose event is the last action

   that occurs before the form is closed. By the time the OnClose

   event occurs, the form has released its pointer to the record in

   the bound query or table and can no longer refer to it. If you were

   stepping through the macro or code that was called by the OnClose

   event, you would still see the information in the form, but because

   the pointer to that data no longer exists, you would not be able to

   access that data.

RESOLUTION

   If you need to refer to the last record that was displayed by a

   form prior to closing, you will need to use a method that uses

   another form or Microsoft Access Basic code to maintain a duplicate

   copy of the current record that is displayed in the form. The macro

   or function that does this should be called by the form's OnCurrent

   event so that every time you change the record information, the

   macro makes a copy on the separate form or in Microsoft Access

   Basic variables. Then, when the OnClose event is triggered, your

   macro or function can use the data on the separate form or in the

   Microsoft Access Basic variables because they will still be

   available.

STATUS

   This behavior is by design.

References


INF: MoveSize Arguments in Wrong Order in Language Reference

 Article Number: Q90813

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

The documentation on the MoveSize action in the "Microsoft Access

Language Reference" on pages 315-316 incorrectly states the order of

the arguments for that action as right, down, height, and width. The

correct order of the arguments, as stated in the Microsoft Access Help

topic for the MoveSize action, is right, down, width, and height.

Reference(s):

"Microsoft Access Language Reference," version 1.0, pages 315-316

References


INF: How to Create Do While/Do Until Loops in an Access Macro

 Article Number: Q90814

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

To perform a Do While or Do Until loop in a Microsoft Access macro,

you need to use a combination of correct macro structure and the

RunMacro action with appropriate information supplied in the Repeat

Expression parameter. These requirements are described in more detail

below.

More Information:

There are several types of Do loops. Each type handles the looping

procedure and conditions differently. The different types of Do loops

are:

1. Do While <condition>... Loop

   This loop will execute while the condition is true. If the loop is

   encountered and the condition is already false, the loop will not

   be performed.

2. Do Until <condition>... Loop

   This loop will execute until the condition is true. If the loop is

   encountered and the condition is already true, the loop will not be

   performed.

3. Do... Loop While <condition>

   This loop will execute the first time unconditionally, then loop

   while the condition is true. If the loop is encountered and the

   condition is already false, the loop will be performed once.

4. Do... Loop Until <condition>

   This loop will execute the first time unconditionally, then loop

   until the condition is true. If the loop is encountered and the

   condition is already true, the loop will be performed once.

To perform a Do While or Do Until loop in a macro, you would use a

macro similar to the following examples. To create the following

examples, open a new macro and choose Macro Names from the View menu.

Add the following macro names and actions and save this macro group as

Do_Loops.

Do While <Condition>... Loop and Do Until <Condition>... Loop

=============================================================

   Macro Name       Action

   -------------------------

   Do_Loop1         RunMacro

   Loop1            MsgBox

   Do_Loop1 Actions

   ----------------

   RunMacro

      MacroName: Do_Loops.Loop1

      Repeat Expression: <your_condition>

   Loop1 Actions

   -------------

   MsgBox

      Message: ="Loop"

In this example, the Do_Loop1 macro calls the Loop1 macro while the

Repeat Expression parameter of the RunMacro action is true.

Do... Loop While <Condition> and Do... Loop Until <Condition>

=============================================================

   Macro Name       Action

   -------------------------

   Do_Loop1         RunMacro

                    RunMacro

   Loop1            MsgBox

   Do_Loop1 Actions

   ----------------

   RunMacro

      MacroName: Do_Loops.Loop1

   RunMacro

      MacroName: Do_Loops.Loop1

      Repeat Expression: <your_condition>

   Loop1 Actions

   -------------

   MsgBox

      Message: ="Loop"

In this example, the Do_Loop1 macro calls the Loop1 macro once

unconditionally, then continues to call the Loop1 macro while the

Repeat Expression parameter of the RunMacro action is True.

Conditions

==========

The condition used in the loop, which is supplied in the Repeat

Expression parameter of the RunMacro action, can be based on a value

in a field on a form, a property of a control on a form, or the value

returned from a Microsoft Access Basic function. If the condition is

based on a field in a form or a property of a control on a form, it

will have syntax similar to:

   Forms![CounterForm]![Counter]<=10

   -or-

   Forms![EntryForm]![InvoiceNo].Visible=True

If the condition is based on the value returned from a Microsoft

Access Basic function, it will have syntax similar to:

   Time()>=TimeEntry()

Do While Loops vs. Do Until Loops

=================================

Whether a loop is a Do While loop or a Do Until loop depends on the

condition. The RunMacro action runs the macro until the condition in

the Repeat Expression parameter is false. This behavior is exactly

what is needed for a Do While loop. It is, however, the opposite of

what is needed for a Do Until loop. Therefore, to make a condition for

a Do Until loop work correctly, precede the condition in the RunMacro

action with the Not operator.

Reference(s):

"Microsoft Access Language Reference," version 1.0, pages 316-317,

412-414

References


INF: How to Create For Next Loops in a Microsoft Access Macro

 Article Number: Q90815

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

To perform a For Next loop in a Microsoft Access macro, you need to

use a combination of correct macro structure and the RunMacro action

with appropriate information supplied in either the Repeat Count or

Repeat Expression parameters.

To enhance your macro, you can use a different macro structure and

include a call to a Microsoft Access Basic function that maintains a

counter, or use the SetValue macro action to maintain and update a

counter value in a text box on a hidden form. The benefit of

maintaining a counter is that you can use the value of the counter in

your macro processing just as in a Microsoft Access Basic For Next

loop.

More Information:

To perform a For Next loop in a macro, you would use a macro similar

to the following examples. To create the following sample macros, open

a new macro and choose Macro Names from the View menu. Add the

following macro names and actions, then save this macro group as

"For_Next_Loops".

For Next Loop Using Repeat Count

================================

   Macro Name       Action

   -------------------------

   For_Next_Loop1   RunMacro

   Loop1            MsgBox

   For_Next_Loop1 Actions

   ----------------------------------

   RunMacro

      MacroName: For_Next_Loops.Loop1

      Repeat Count: 10

   Loop1 Actions

   -------------------

   MsgBox

      Message: ="Loop"

In this example, the For_Next_Loop1 macro calls the Loop1 macro 10

times. The number of times the macro is called is specified in the

Repeat Count parameter of the RunMacro action.

The limitation of this example is that a counter value is not

available to indicate which instance of the loop is being executed. As

a result, there is no way to tell if this is the first, fifth, or

tenth time the loop is being executed.

For Next Loop That Maintains a Counter in a Text Box on a Form

==============================================================

   Macro Name       Action

   -------------------------

   For_Next_Loop2   SetValue

                    RunMacro

   Loop3            MsgBox

                    SetValue

   For_Next_Loop2 Actions

   ----------------------

   SetValue

      Item: Forms![CounterForm]![Counter]

      Expression: 1

   RunMacro

      MacroName: For_Next_Loops.Loop2

      Repeat Expression: Forms![CounterForm]![Counter]<=10

   Loop2 Actions

   -------------------

   MsgBox

      Message: ="Loop Count: " & Forms![CounterForm]![Counter]

   SetValue

      Item: Forms![CounterForm]![Counter]

      Expression: Forms![CounterForm]![Counter]+1

In this example, the For_Next_Loop2 macro uses the SetValue macro

action to initialize (set to a value of 1) a counter in a text box

called Counter on a form called CounterForm. It then runs the Loop2

macro until the Repeat Expression parameter evaluates to false. In

this example, the loop executes 10 times. The Loop2 macro displays a

message box that indicates which instance of the loop is being

executed by referring to the counter value in the Counter text box.

The Loop2 macro then increments the counter (adds 1 to the current

counter value) by using the SetValue macro action.

The benefit of this example is that a counter value is available to

indicate which instance of the loop is being executed. The drawback to

this example is that it depends on a form that must be created and

opened prior to the execution of the loop. The form can be hidden or

visible, but it must be open for this example to work.

For Next Loop Using Access Basic Function to Maintain a Counter

===============================================================

   Macro Name       Action

   -------------------------

   For_Next_Loop3   RunCode

                    RunMacro

   Loop3            MsgBox

                    RunCode

   For_Next_Loop3 Actions

   ----------------------

   RunCode

      Function Name: =LoopCount(1)

   RunMacro

      MacroName: For_Next_Loops.Loop3

      Repeat Expression: LoopCount(3)<=10

   Loop3 Actions

   -------------------

   MsgBox

      Message: ="Loop Count: " & LoopCount(3)

   RunCode

      Function Name: =LoopCount(2)

In this example, the For_Next_Loop3 macro runs the LoopCount(1)

function by using the RunCode macro action. This causes the function

to initialize the counter to a value of 1. It then runs the Loop2

macro using the RunMacro action until the Repeat Expression parameter

is false. LoopCount(3), which is used in the conditional expression,

returns the current value of the counter. Therefore, when the counter

reaches 11, the loop has executed 10 times, and when the RunMacro

action checks the condition, it evaluates to false and will not call

the Loop3 macro again. The Loop3 macro displays a message box that

indicates which instance of the loop is being executed by referring to

the counter value returned by the LoopCount(3) function call. The

Loop3 macro then increments the counter using the RunCode macro

action, which calls the function LoopCount(2).

The benefits of this example are that a counter is available that

indicates which instance of the loop is being executed and you do not

need to create and open a form with a control on it to contain the

counter value. The drawback to this example is that you need to create

the LoopCount() Microsoft Access Basic function prior to using this

example; however, after you create the function it is available

anywhere in Microsoft Access.

The Microsoft Access Basic function procedure LoopCount() returns the

current value of a counter that the function declares and maintains.

Depending on which parameter is passed (1, 2, or any other number),

LoopCount() will initialize, increment, or return the counter's

current value. Below is the Access Basic code for the LoopCount()

function procedure.

   Function LoopCount (Action)

      Static LoopCounter             ' Static variable to hold counter.

      If Action = 1 Then             ' Initialize counter.

         LoopCounter = 0

      ElseIf Action = 2 Then         ' Increment counter.

         LoopCounter = LoopCounter + 1

      End If

      LoopCount = LoopCounter        ' Return value.

   End Function

Reference(s):

"Microsoft Access Basic: Introduction to Programming," version 1.0,

chapter 3, pages 6-7, 10-11

"Microsoft Access Language Reference," version 1.0, pages 246-248,

316-317, 412-414, 437-438

References


INF: Freestanding Labels Do Not Appear in Datasheet View

 Article Number: Q90816

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

The final sentence on page 221 of the "Microsoft Access User's Guide"

is misleading. It should read as follows:

   Freestanding labels do not appear in Datasheet view. Freestanding

   (unbound) text boxes will appear in Datasheet view with their

   control names as column headings.

References


INF: Attached Table Must Be Opened as Dynaset from Modules

 Article Number: Q90817

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

In Microsoft Access Basic modules, a table can be opened as the Table

data type in the following manner:

   Dim MyDB as Database

   Dim MyTable as Table

   Set MyDB = OpenDatabase("NWIND.MDB")

   Set MyTable = MyDB.OpenTable("Categories")

However, if you have an attached table that is in the database, it

cannot be opened as the Table data type. An attached table must be

opened as the Dynaset data type in the following manner:

   DIM MyDB as Database

   DIM MyDyn as Dynaset

   Set MyDB = OpenDatabase("NWIND.MDB")

   Set MyDyn = MyDB.CreateDynaset("AttachedTable")

If you try to execute the OpenTable action on an attached table, you

will receive the following error message:

   Can't perform operation; it is illegal

More Information:

When you refer to a Table data type, the table must reside in the .MDB

file. This is why an attached database must be opened as a dynaset. An

attached table only has a pointer to where the table resides.

Reference(s):

"Microsoft Access Language Reference," version 1.0, Chapter 8

References


INF: Setting Form's Dynaset Property Puts Bookmark at EOF

 Article Number: Q90850

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

In Microsoft Access Basic, you can make a copy of the dynaset that a

form may currently be using for data manipulation.

The syntax for accomplishing this is:

   Dim MyDB as Database

   Dim MyDyn as Dynaset

   Set MyDB = OpenDatabase("NWIND.MDB")

   Set MyDyn = Forms!Categories.Dynaset

In this case, you may assume that the bookmark is at the beginning of

the Categories dynaset. However, the bookmark is at the end-of-file

(EOF) marker. In fact, after a variable is set to the dynaset of a

form, there is no current record because the bookmark is actually at

the EOF marker.

More Information:

Before doing any further actions, the two dynasets should either be

synchronized or the bookmark should be set to the first record. This

is done with the following statement:

   MyDyn.Bookmark = Forms!Categories.Bookmark  ' Synch dynasets.

   -or-

   MyDyn.MoveFirst   ' Move to first record.

After one of these statements has been issued, there will be a current

record and the bookmark will be pointing at this current record.

Reference(s):

"Microsoft Access Language Reference," version 1.0, Chapter 8,

References


INF: Network Users Can Open Their Own SYSTEM.MDA Exclusively

 Article Number: Q90851

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

Two users on the same network can open the same SYSTEM.MDA file

exclusively. Microsoft Access ignores the exclusive lock on a

SYSTEM.MDA file in a multiuser installation.

More Information:

Microsoft Access opens the system database nonexclusively on the

network. Subsequent requests to open the database ignore the read-only

and exclusive flags.

Since the SYSTEM.MDA file is opened whenever a user logs into the

database, opening the SYSTEM.MDA file exclusively would lock out all

other users on the network.

References


INF: ComboBox On Toolbar Do Not Use Window Background Color

 Article Number: Q90852

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

The Microsoft Access Combo Box on the toolbar does not use the window

background color, so changing the background color from the Color icon

within the Control Panel does not have any effect.

More information:

Microsoft Access toolbars are predefined forms. There is no way to

specify the windows background as a color on a form. If you would

like to change colors within Microsoft Access, you can open and edit

the forms within UTILITY.MDA. If you modify UTILITY.MDA, extreme care

must be taken by creating backups of UTILITY.MDA before making any

modifications.

Steps to Reproduce Behavior

---------------------------

1. Change the Window Background color in the Control Panel.

2. Start Access and open the NWIND.MDB database.

3. Select the Table command from the View menu.

4. Select the CUSTOMER table by double clicking on it with the mouse.

At this point the "Field:" dropdown combo box still has a white

background.

References


INF: Double-click Also Executes OnPush Twice

 Article Number: Q90853

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

On a form using the OnPush and OnDblClick events, the double-click

runs the OnPush event before and after the OnDblClick event.

More Information:

If you want the OnDblClick event to execute without the OnPush event,

you must put an explicit CancelEvent action at the end of the OnDblClick

macro. Otherwise, both clicks will execute the macro assigned to the

OnPush event.

Steps to Reproduce Behavior

---------------------------

1. Create a macro with a beep action. Save it as Macro1.

2. Create a second macro with a MsgBox action. Save it as Macro2.

3. Create a blank form and add a command button.

4. Set the OnPush property for the command button to Macro1 and the

   OnDblClick property to Macro2.

6. From the View menu, choose Form.

7. Double-click the command button.

   Note that the OnPush event is activated before and after the

   OnDblClick event.

References


INF: Shrinking Empty or Null OLE Object on Report

 Article Number: Q90855

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

If a report has object linking and embedding (OLE) objects that are

empty or null, you can set up the report so that empty or null OLE

objects will not appear.

More Information:

To illustrate how this is done, we will use the NWIND.MDB file that is

shipped with Microsoft Access:

 1. Start Access and open NWIND.MDB. You may want to make a copy of

    NWIND.MDB before proceeding.

 2. From the View menu, choose Table. Open the EMPLOYEES table and add

    a few records without pictures to the end of the table. Close the

    table.

 3. From the View menu, choose Macros. Create a new macro and enter

    the lines below. Save the macro as Macro99.

       Condition                                 Action

       -------------------------------------------------------------

       Reports![Report1]![photo] Is Null         SetValue

       Reports![Report1]![photo] Is Not Null     SetValue

       Macro99 Actions

       -------------------------------------------------------------

       SetValue

          Item: [photo].visible

          Expression:  False

       SetValue

          Item: [photo].visible

          Expression:  True

    Line 1 of this macro checks to see if the OLE object is null or

    empty. If it is, the Visible property is set to 0 (False), making

    the object invisible. For Line 2, if the OLE object is not null or

    empty, the Visible property will be set back to -1 (True) and the

    picture will be visible.

 4. From the View menu, choose Report.

 5. In the Database window, choose the New button.

 6. When prompted, base the report on the Employees table and select

    Blank Report instead of the Report Wizard.

 7. Drag Employee ID, Last Name, First Name, and Photo from the list

    of fields and place them in the detail section of the report.

 8. If the property sheet is not showing, choose Properties from the

    View menu, or click the Properties button on the toolbar.

 9. Click the detail section bar (the bar labeled "Detail"). On the

    property sheet, change the following properties:

       On Format:  Macro99

       Can Shrink: Yes

10. In the toolbox, click the text box button. Add an unbound text box

    to your report that completely overlaps the OLE object. The text

    box is necessary to cause the items below it to be pulled up.

11. For this unbound text box, change the following properties:

       Visible:    NO

       CanShrink: YES

12. From the Layout menu, choose Send To Back. The OLE object should

    now be on top of the unbound text box.

13. Save the report as Report1.

14. Scroll through the pages of the report in print preview. Scroll

    to the last page and note how the CanShrink property works with

    null or empty OLE objects.

    When an OLE object is visible, the CanShrink property will prevent

    the empty text box from shrinking. When the OLE object is

    invisible, the text box will shrink to nothing.

References


PRB: CancelEvent Action in OnClose Macro Prevents Exit

 Article Number: Q90856

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   After a form is opened, Microsoft Access and Microsoft Windows

   cannot be closed (quit).

CAUSE

   If there is a CancelEvent action in an OnClose macro, you will be

   unable to close Microsoft Access and Windows.

RESOLUTION

   If a form's OnClose property specifies a macro that executes a

   CancelEvent action, you won't be able to close the form. You must

   either correct the condition that caused the CancelEvent action or

   open the macro and delete the CancelEvent action. If the form is a

   modal form, you won't be able to open the macro.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 549-552

References


INF: Cut and Paste Removes Blank Lines in Macro's Design View

 Article Number: Q90857

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

If you cut and paste or copy and paste multiple rows, and several of

the rows are blank, the blank rows will be removed in the macro's

Design view.

Although Microsoft Access removes the blank lines, the resulting code

is functionally equivalent.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 21

References


PRB: Mail Label Wizard Cuts Off First Field at Top of Page

 Article Number: Q90858

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The first line on each page in a mailing label created with the

   ReportWizard may not print or show in Print Preview. Forms and

   reports may also exhibit this behavior.

CAUSE

   All printers have non-printable areas. Microsoft Access reads the

   default Windows printer driver to determine what to print or show

   in Print Preview. If the label layout exceeds the printable area,

   the labels will be truncated and the first line will not print.

RESOLUTION

   If you experience this problem, you should increase the height of

   your Page Header to align your labels. In some cases the first row

   of labels will be unusable.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.00, page 401.

References


PRB: Fonts May Change Zooming Out in Print Preview

 Article Number: Q90859

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Zooming out when Previewing a Report may cause the font to change

   to a generic font.

CAUSE

   Microsoft Access chooses fonts so that the font displayed will

   always be readable. The normal font will print as expected.

RESOLUTION

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 406-413.

References


PRB: #Error When ControlName Used in ControlSource Expression

 Article Number: Q90860

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A field resulting in "#Error" will be created when the

   ControlSource property (bound field) contains the ControlName

   property in an expression. However, in an unbound text box, the

   same expression generates the expected value rather than "#Error."

CAUSE

   There is a circular dependency in either a form or a report.

   Control names take precedence over field names when binding.

   Microsoft Access currently does not provide a more descriptive

   error for circular references.

RESOLUTION

   If you need to reference the ControlName property in an expression,

   use an unbound text box. Otherwise, reconstruct the ControlSource

   property expression so that it does not reference the ControlName

   property.

STATUS

   This behavior is by design.

More Information:

If you create a bound form and drag a numeric field onto the form, by

default the ControlSource property and ControlName property will be

given the name of the actual field in the underlying table or query.

If you change the ControlSource property to an expression that

includes the ControlName property, you will see "#Error" in this field

when you switch to Browse or Datasheet mode. The following

demonstrates an expression within the ControlSource property:

   ControlName:  Person_ID

   ControlSource: =[Person_ID] + 1

References


INF: Connecting to the First Available Network Drive

 Article Number: Q90861

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

To make a network connection with the Windows API, you can use an

unused logical drive letter or a UNC name (\\SERVER\SHARE). You can

call the Windows API function GetDriveType from an Access Basic module

to find the first available drive letter and then make a network

connection to this available drive.

More Information:

Use the following steps to find the first free drive and make a

network connection.

1. Declare the API functions.

   '------------------------------------------------------------------

   'NOTE: ENTER THE DECLARATION FUNCTIONS ON ONE LINE EACH.

   Option Explicit

   Declare Function GetDriveType% Lib "kernel" (ByVal nDrive%)

   Declare Function WNetAddConnection% Lib "User"(ByVal lpszNetPath$,

                                                 ByVal lpszPassword$,

                                                 ByVal lpszLocalName$)

   '------------------------------------------------------------------

2. Write a function to return the first free drive and make the new

   connection.

      Function FreeDrive ()

         Dim DriveNum, FirstFreeDrive

         Dim FirstDrive%, Results%

         DriveNum = -1

         Do

            DriveNum = DriveNum + 1

            FirstDrive% = GetDriveType(DriveNum)

         Loop Until FirstDrive% = 0

         FirstFreeDrive = Chr$(DriveNum + 65) + ":"

         'NOTE: ENTER THE FOLLOWING STATEMENT ON ONE LINE.

         'Also substitute the appropriate server share and password.

         Results% = WNetAddConnection("\\server\share", "password", _

                                       FirstFreeDrive)

      End Function

Reference(s):

"Microsoft Access Introduction to Programming," version 1.0, page 8

References


INF: Using the Windows 3.1 API to Connect to Network Resources

 Article Number: Q90862

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

The Microsoft Windows version 3.1 application programming interface

(API) can be used to connect to and disconnect from network drives and

printers in an Access Basic module.

More Information:

To use the API functions, follow the steps below. You will probably

want to use variables for the parameters.

1. Declare the functions required to add and remove network

   connections. Type the lines in a module in the Global Declarations

   section.

   '------------------------------------------------------------------

   ' NOTE: ENTER THE DECLARATION FUNCTIONS ON ONE LINE EACH.

   Option Explicit

   Declare Function WNetAddConnection% Lib "User" (ByVal lpszNetPath$,

                                                ByVal lpszPassword$,

                                                ByVal lpszLocalName$)

   Declare Function WNetCancelConnection% Lib "User" (ByVal lpszName$,

                                                ByVal fForce%)

   Const WN_SUCCESS=0           ' The function was successful.

   Const WN_NET_ERROR=2         ' An error occurred on the network.

   Const WN_BAD_PASSWORD=6      ' The password was invalid.

   Dim Results%, Force%

   '------------------------------------------------------------------

2. Create a function that makes the connection. Note that each command

   should be on one line. The line-continuation character ("_")

   improves the readability of the code.

      Function AddConnection ()

         ' lpszLocalName$ can be in the form D: or E: and LPT1 or LPT2.

         Results% = WNetAddConnection("\\server\share", "password", _

                                      "y:")

      End Function

   Some of the possible return values for Results% are WN_SUCCESS,

   WN_NET_ERROR, and WN_BAD_PASSWORD.

   For more information on how to obtain an unused drive resource

   programmatically, search the Knowledge Base for the following

   keywords:

      network AND getdrivetype

3. Create a function that cancels the connection. The parameter

   fForce% specifies whether any open files or open print jobs on the

   device should be closed before the connection is canceled. If this

   parameter is FALSE and there are open files or jobs, the connection

   will not canceled.

      Function CancelConnection ()

         Force%=1

         ' NOTE: If Force%=0 and files were open,

         '       the connection will not be 'canceled.

         Results% = WNetCancelConnection("y:", 1)

      End Function

   Two of the most common return values for Results% are WN_SUCCESS

   and WN_NET_ERROR.

Reference(s):

"Microsoft Access Introduction to Programming," version 1.0, Chapter

2, "Writing a New Function," pages 8-14

References


INF: Older Versions of Shared DLLs Cause Problems with Access

 Article Number: Q90863

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

Shared dynamic-link libraries (DLLs) in your system older than those

supplied with Microsoft Access version 1.0 or Microsoft Windows

version 3.1 can cause unexpected errors with Microsoft Access.

To avoid problems, make sure that all shared DLLs are at least as

current as those supplied with Microsoft Windows version 3.1 or

Microsoft Access version 1.0, and that they are all located in the

WINDOWS\SYSTEM subdirectory.

More Information:

The shared DLLs used by Microsoft Access are:

   COMMDLG.DLL   89248 bytes   3/10/92   Windows 3.1

   COMMDLG.DLL   89248 bytes   10/25/92  Access 1.0

   COMMDLG.DLL   97984 bytes   10/1/92   Windows for Workgroups

   OLECLI.DLL    83456 bytes             Same for all

   OLESVR.DLL    24064 bytes             Same for all

   DDEML.DLL     36864 bytes   3/10/92   Windows 3.1

   DDEML.DLL     36964 bytes   10/25/92  Access 1.0

   DDEML.DLL     38400 bytes   10/1/92   Windows for Workgroups

   SHELL.DLL     41600 bytes   3/10/92   Windows 3.1

   SHELL.DLL     41600 bytes   10/25/92  Access 1.0

   SHELL.DLL     41520 bytes   10/1/92   Windows for Workgroups

   VER.DLL        9008 bytes

(These DLLs are used by Windows applications other than Microsoft

Access, as shown above. The DLLs for which no date is provided are the

same for all applications.)

Microsoft Access supplies the same DLL versions as Windows 3.1, and it

requires these (or newer) versions for correct operation; older

versions can cause errors.

Microsoft Access and Windows copy shared DLLs into the WINDOWS\SYSTEM

subdirectory, and that is where Microsoft Access first looks for them.

If it doesn't find one or more of the shared DLLs, it looks in the

directory where Microsoft Access is installed, and then in the current

directory.

Often, Microsoft Access finds outdated or incorrect DLLs because

third-party software with old or foreign DLLs has been installed or

reinstalled, overwriting the correct DLLs. Some third-party software

packages copy DLLs into directories other than WINDOWS\SYSTEM,

creating multiple copies and making the problem harder to track and

resolve.

Microsoft Access will not reload DLLs previously loaded by another

software package; it will only load shared DLLs not already loaded. If

the previously loaded DLLs are incorrect, they can cause problems with

Microsoft Access.

If the Microsoft Access Setup program fails to locate a shared DLL, or

detects an older version of one, it issues an error message such as:

   Outdated XXXX.DLL found. Please reinstall MSAccess.

   -or-

   Can't find XXXX.DLL.

References


INF: Access Saves Printer Information with Each Form/Report

 Article Number: Q90864

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

Microsoft Access version 1.0 saves printer driver information with

each form or report that it generates. This means you don't have to

set up the printer with the correct driver in order to print out a

form or report--the form or report "remembers" the correct driver and

uses it. For example, you can save one form using a PostScript printer

driver and another form using the generic text driver.

Note: If the Default Printer option button is selected, the form will

print to the Windows default printer.

More Information:

If the printer that the printer driver requires is not currently

connected, Microsoft Access displays a dialog box stating that the

printer is not available and allows you to select another printer.

Bear in mind that some text formatting depends on the current printer

driver. For example, if you format a document with a PostScript

printer font instead of a software font (such as a TrueType font) and

send the document to a PostScript printer, everything should print out

correctly. However, if you send the document to a LaserJet, you will

get output errors because some PostScript printer fonts are not

available on a LaserJet.

A driver-related problem could be something such as the sudden

appearance of the Zapf Dingbats font in a form or report set up to use

the Windows System font and sent to a PostScript printer. This problem

occurs because the Windows System font is not available on PostScript

printers. When a font is unavailable, Windows attempts to find an

equivalent among those on the printer, searching through them

alphabetically. In this case, it arrives at the Zapf Dingbats font

last and uses it because there are no other options.

The best way to avoid these problems is to create all your forms and

reports with TrueType fonts, which appear correctly in print preview

and are processed the same way by all printers.

References


PRB: GP Fault If MSACCESS.INI Installable ISAM Path Uses '\..'

 Article Number: Q90865

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   A general protection (GP) fault occurs if the path in the

   "Installable ISAMs" section of the MSACCESS.INI file (located in

   the WINDOWS directory) contains the characters "\..". For example:

      [Installable ISAMs]

      dBASE IV=\..\ACCESS\DBSISAM.DLL

   The GP fault occurs whether or not the path and/or file is valid.

RESOLUTION

   Use explicit paths when referring to files in the MSACCESS.INI

   file. For example:

      [Installable ISAMs]

      dBASE IV=C:\ACCESS\DBSISAM.DLL

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Windows

   operating system version 3.1. We are researching this problem and

   will post new information here as it becomes available.

References


INF: Commonly Asked Questions About Access Version 1.0

 Article Number: Q90866

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

Commonly asked questions about Microsoft Access version 1.0 are listed

below.

More Information:

1.Q. Is it possible to customize the Help file in Microsoft Access?

  A. Customized Help files can be used only in Microsoft Access forms.

     Use the HelpContextId and HelpFile properties of the form to

     reference a Help file previously constructed with the Microsoft

     Windows Help Compiler. For more information on this, search for

     "HelpContextId" in the Microsoft Access online Help.

2.Q. Is it possible to set up a many-to-many relationship?

  A. No. The only kinds of relationships you can define are

     one-to-many and one-to-one. It is generally not a good database

     design to have many-to-many relationships. An alternative is to

     build a linking table between two tables that have a many-to-many

     relationship. For example, if you had an "Employees" table and a

     "Job Skills" table, each employee may have many skills, and each

     skill could belong to more than one employee--a many-to-many

     relationship. To work around this, you would build a linking

     table "EmpSkill" that had two columns, EmpID and SkillID, to

     relate the two tables.

3.Q. Where are OLE objects (such as the pictures in the Employees table

     in NWIND.MDB) stored?

  A. OLE objects can be either linked or embedded. Embedded objects

     are stored inside the .MDB file. Linked objects point to a file

     located external to the database, and are therefore not stored in

     the .MDB file. Since the Employees' pictures within NWIND.MDB are

     embedded OLE objects, the pictures are stored in NWIND.MDB.

4.Q. How can I tell if an OLE object is embedded or linked?

  A. To tell if an object is linked or embedded, first select the

     object, then choose the last command on the Edit menu. The

     command name varies depending on the object type. (For example,

     "Paintbrush Picture Object," "Microsoft Excel Worksheet Object,"

     and so on.) When the option is highlighted or selected, a submenu

     appears to the right of the menu. If the object in question is an

     embedded object, the Change Link option will be unavailable

     (dimmed). If it is a linked object, the Change Link option will

     not be dimmed.

5.Q. Is all the information (tables, queries, reports, and so on) that

     appears as part of a database actually stored in the database?

  A. All database information is stored in the database, with the

     exception of database "preferences" (choose Options from the View

     menu) and certain security information (users, their passwords,

     and group information), which are stored in the SYSTEM.MDA file.

6.Q. Is it possible to break out the information that is contained in a

     database (that is, tables) into individual files?

  A. You can use the Export option to export tables and other data to

     separate files (ASCII, dBASE, and so on). You can also export

     Microsoft Access objects to other Microsoft Access databases.

7.Q. Is some type of tool available that helps document applications?

     (For example, variables used, macros used, properties of different

     interface elements, and so on.)

  A. A tool called "Database Analyzer" is included with Microsoft

     Access that aids in this task. For information on using this

     tool, look in the PSSKB.TXT file, question number 23, or

     choose the Microsoft Access Q&A icon in the Access group in the

     Microsoft Windows Program Manager.

8.Q. Are memo fields part of a table, or are they stored in a

     separately linked file as is done in FoxPro, which has .DBF and

     .FPT files?

  A. They are part of a table and thus stored in the .MDB file.

9.Q. Can Microsoft Access create stand-alone applications?

  A. Currently, Microsoft Access does not create stand-alone

     applications. Since there is not yet a run-time version of

     Microsoft Access, a developer and his or her customers both

     require full working copies of Microsoft Access to run Microsoft

     Access applications. The developer distributes only the .MDB

     file(s) for the application to the customers.

     A run-time version of Microsoft Access is planned for the near

     future that a developer can distribute with his or her .MDB

     file(s) so that customers will not require a full working copy of

     Microsoft Access to run applications.

References


PRB: Select All Not Grayed Even When No Items Are Available

 Article Number: Q90867

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 2315

SYMPTOMS

   In Form View, the Select All option in the Edit menu is never

   grayed out, even if there are no items to select.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here as it becomes available.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Choose the Form control button, then choose New and Blank Form to

   create a new form with no controls.

2. Select the Edit menu. You will notice that Select All is available,

   even though there is nothing on the form to select.

References


PRB: Sizing Rows and Columns to Zero Works Differently

 Article Number: Q90868

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 201

SYMPTOMS

   In Table datasheet view, if you attempt to size a row height to

   zero, you receive the error message:

      The setting you entered isn't valid for this property.

   However, you will be able to set column widths to zero.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Problem

--------------------------

1. Open a new or existing table.

2. Choose a row and select Row Height from the Layout menu. Set the

   height to zero and choose OK.

References


PRB: ReportWizard Select No Fields for Form Still Shows All

 Article Number: Q90869

 CREATED: 22-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   Using the ReportWizard and not choosing anything for the fields you

   want on your report will give you a report that includes all the

   fields.

CAUSE

   Based on feedback from users, this is the desired result of

   selecting the Go To Last Page button, which bypasses the entire

   design questioning of AccessWizards.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Choose the Report button and the New button in the Database window.

2. Select a table or query, then choose the ReportWizards button.

3. Select one of the three types of reports, then choose the OK

   button.

3. Choose the Next button without selecting any fields.

4. Select one of the three available looks for your report, then

   choose the Next button.

5. Choose the Print Preview button.

   Note that your report includes all the available fields even though

   you did not choose any fields for your report.

References


INF: Page Header Will Span Full Width Of MultiColumn Report

 Article Number: Q90870

 CREATED: 22-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

You can design a report in Microsoft Access that has a page header

that spans the entire width of the page, a group section header that

is the width of a column, plus has a multiple-column detail section.

To do this, the columns are defined in the Print Setup option as either

Vertical (also called snaking-columns,) or Horizontal. This article

presents the steps to create a report with 3 across, 2 inch wide

snaking columns.

More Information:

To create a grouped, multiple-column report where the page header

spans the width of the page, follow these steps:

1) In report Design view, drag the right edge of any report section to

   the desired width of the report. For this example, drag over to the

   7 inch mark on the ruler.

2) Choose Sorting and Grouping from the View menu and enter a field

   or expression in the Field/Expression box to group your data by.

3) In the Group Properties section of the Sorting and Grouping dialog

   box, enter 'Yes' for Group Header.

4) Using the Toolbox, create a Label and place it in the Page Header

   section. Enter the text for the label in the Caption property. Size

   the text box so it is the same width as the Page Header section.

5) Using the Toolbox, create a Textbox bound to the group field. Place

   the Textbox in the Group Header. Size this control as 2 inches wide

   or less, and place the left edge of the box along the left edge of

   the group section.

6) In the detail section place your bound control(s) within the first

   2 inches.

7) From the File menu, choose Print Setup.

8) In the Print Setup dialog, choose the More button.

9) In the Items Across box, type the number of columns you want in the

   detail section. For this example, enter 3. Leave row spacing or

   column spacing as they are.

10) In the Item Size section, clear the Same as Detail check box.

11) In the Width box, type the number of inches you want to allow for

    each column of data. For this example, enter 2.

12) Under Item Layout, select Vertical. This will create a snaking-

    column report.

13) Choose OK.

14) Click on the group Header Section and display the property sheet.

    For the 'New Row Or Col' property, select 'Before Section'. This

    will cause the group header to print at the top the column once

    for each new group.

15) Print or Preview the report.

For another article describing how to print the group header at the

top of continued columns, search in this Knowledge Base for:

   Print AND Group's AND Name AND Subsequent AND Column AND Page

For additional information on columnar reports search Help for

"Multiple-column reports" and "NewRowOrCol".

Reference(s):

"Microsoft User's Guide," version 1.0, chapter 18, "Designing

Reports," and chapter 19, "Sorting and Grouping Data."

References


INF: Mouse Click Not Turning Off Extend (Selection) Mode

 Article Number: Q90873

 CREATED: 25-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

When you are in the QBE grid and enter extend (EXT) mode by pressing

F8, choosing another column with the mouse will not turn the extended

selection off (this is reflected in the status bar).

More Information:

This is the correct function of extend mode. To turn off extend mode,

press the ESC key.

References


INF: Correct Procedure for Inserting New Field Above Existing

 Article Number: Q90874

 CREATED: 25-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

On page 51 of "Getting Started," the procedure for inserting a new

field above an existing field is not correct. The procedure outlined

in the manual inserts the field under the existing field instead of

above it.

Step 1 for "Inserting a new field above an existing field" should be

changed from

   Click the row above which you want the new row to appear...

to:

   Click the row below which you want the new row to appear...

References


INF: Headers On Non-Continuous Forms Disable Scroll Bar

 Article Number: Q90875

 CREATED: 25-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

If you add a large form header to a non-continuous form, the

vertical scroll bar disappears and you will not have access to the

detail below the header.

More Information:

It is better to size the header so that it fits within the limits of

the scrollbar range so that the form behaves in form view just as it

does in design view. The user must scroll the form down to see the

rest of the form. For example, this problem occurs if you want a

summary chart in the header, then detail charts below the header. The

scroll bars consider the header and the form to be all one object.

References


INF: Displaying List or Combo Boxes with More Than One Field

 Article Number: Q90876

 CREATED: 25-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

This article discusses information needed to display more than one

field in a list box or combo list box.

More Information:

If you enter a SQL command in the RowSource property for the control,

Microsoft Access can display more than one field in a list box or

combo list box. For example, if you want to combine two fields into

one list box, the syntax for the SQL command could be as follows:

   Select [FieldName1] & [FieldName2] from [TableName];

If you are using a bound column in the list, the bound column would

now apply to the placeholder in the SQL statement. In the above

example, a bound column setting of 2 would equate to FieldName2.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 9

References


INF: Copy/Paste Operations from Forms to Queries

 Article Number: Q90877

 CREATED: 25-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

If you wish to copy and paste SQL statements from the RowSource

properties of a control, form, or report to a query, you must use

the CTRL+C method to copy to the clipboard.

More Information:

Using the pulldown menu commands Edit/Copy and Edit/Paste will not

work in this case. You must use CTRL+C to copy the RowSource

information to the clipboard from the form property, and then use

CTRL+V to paste this information into the queries SQL statement. This

method must be reversed to go from queries to forms because the View

SQL dialog box is modal.

Initially, after pasting the information into the RowSource, the

statement may appear truncated or incorrect. Moving the focus off of

the RowSource should correct this.

References


PRB: Tables Are Not Browsed in Primary Key Order

 Article Number: Q90878

 CREATED: 25-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   If a table has a primary key and you use the table in a RowSource

   property in a list box or combo box, you will see the data in

   insertion order, not primary key order.

RESOLUTION

   For historical reasons of the database, the order of insertion may

   have importance. To view the table's contents in primary key order,

   design a query that sorts on the primary key. Use the query as the

   RowSource property for the list box or combo box.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 21-33 and 87-114

References


INF: Empty Table Created by SELECT INTO with No Matching Rows

 Article Number: Q90879

 CREATED: 25-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

Using a SELECT INTO or APPEND query with criteria that has no matching

records causes an empty table to be created.

This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 6

References


PRB: Long WHERE Clause Is Truncated After View SQL Command

 Article Number: Q90880

 CREATED: 25-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   In Microsoft Access' Query By Example (QBE) grid, having a WHERE

   clause greater than 255 characters causes that clause to be

   truncated after the SQL command on View menu is used to see the SQL

   statement. The following error message appears:

      Expression is too long for the QBE grid and has been

      truncated...

   The beginning of the expression is listed after the error message.

CAUSE

   This problem most often occurs when a long WHERE clause using the

   OR operator is entered into the QBE grid on the Criteria and Or

   lines. To optimize performance, Microsoft Access combines queries

   that are entered on separate lines. The limit for each QBE grid is

   255 characters.

RESOLUTION

   When two or more query lines are combined together and the total

   number of characters is greater than 255, do not view the SQL

   statement.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here as it becomes available.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 6

References


INF: DDE Link Can't Find Data; Opens Second Copy of Server App

 Article Number: Q90881

 CREATED: 25-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

Using Microsoft Access and Dynamic Data Exchange (DDE) to access

information from an open DDE server application, such as Microsoft

Excel, where the data does not exist causes the following error

message to be displayed:

   Remote data not accessible. Start application Excel?

If you choose the Yes button in the message dialog box, a second copy

of Microsoft Excel is started with the name of the nonexistent

spreadsheet in its title bar.

More Information:

This behavior is correct unless you already have a spreadsheet with

the name given in the DDE link open in Microsoft Excel. If the DDE

link cannot find the spreadsheet, a second copy of Microsoft Excel

will be launched using the filename given in the DDE statement.

However, the DDE standard is not to have running applications open

documents.

This behavior is by design.

Reference(s):

"Microsoft Access Basic: An Introduction to Programming," version 1.0,

Chapter 9, "Dynamic Data Exchange"

References


PRB: Two Users Can Open the Same dBASE Database Exclusive

 Article Number: Q90882

 CREATED: 25-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   Attaching to a dBASE file in Microsoft Access using the Exclusive

   check box allows another user to attach to the same file over the

   network.

CAUSE

   When two users or applications are running on separate machines on

   a multiuser network, they can both open the same dBASE or Paradox

   file without receiving an error message. However, if two instances

   of Microsoft Access are running on one machine and both instances

   try to open the same dBASE or Paradox file, one instance will

   receive an error message saying the database is locked.

   In dBASE there is no exclusive database lock. In dBASE, records in

   files are locked, not the entire file. In other words, one user can

   open the first database exclusively, and a second user can open it

   shared or exclusively. Therefore, the exclusive database lock is

   only recognized when Microsoft Access controls both attempts to

   open the same file from the same machine.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 4

References


PRB: Alert With Wrong Filename Given When Opening File Copied

 Article Number: Q90985

 CREATED: 26-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   On a machine with a shared drive, if a large database file is copied

   to a new name or location, when another machine attempts to open

   that database during the copy procedure, an error message occurs

   stating the incorrect database name is corrupt or is not a Microsoft

   Access database file.

   Depending upon how the file was opened, an error message below

   is given where "Modules" is not the correct name of the file being

   opened.

         RO=Read Only                   Error Message

   ----------------------------------------------------------------

   1. RO:  No Exclusive:  No  --> "Database 'Modules' is corrupted."

   2. RO:  No Exclusive: Yes  --> "Couldn't access file 'filename'."

   3. RO: Yes Exclusive:  No  --> "Database 'Modules' is corrupted."

   4. RO: Yes Exclusive: Yes  --> "Couldn't access file 'filename'."

CAUSE

   Due to the way file locking is placed upon a file at DOS during the

   copy procedure, Microsoft Access has no way of knowing what is

   happening to the file being opened.

RESOLUTION

   Microsoft has confirmed this behavior in Microsoft Access version

   1.0 for Windows and that this is proper behavior according to the

   design specification.

References


PRB: Change Option Affects Only One Instance of Many of Access

 Article Number: Q90986

 CREATED: 26-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When two instances of Microsoft Access are run on the same machine,

   they both access the same SYSTEM.MDA, but the options for both do

   not always appear to be the same after being changed in one

   instance. However, the View option shows them both as being changed.

CAUSE

   When there are two instances of Microsoft Access running on the

   same machine, only the routines in the instance where the preferences

   are changed are called. The other instance does not have its memory

   copies updated.

STATUS

   This behavior is by design.

More Information:

Many options are stored in memory so that they do not have to be read

from the preferences table every time they are accessed. The mechanism

by which the memory and disk copies are kept in synchronization is the

array of routines that is called whenever a preference is changed.

When there are two instances of Microsoft Access running, only the

routines in the instance changing preferences are called. The other

instance does not have its memory copies updated, but the View options

shows them as being changed.

In order to make the preference take effect in another instance on the

same system, the user either needs to shutdown and reopen this

instance, or change the preference and resave it.

This is not an issue for users on separate systems, since their

preferences are stored per user.

Reference(s):

"Microsoft Access User's Guide," version 1.0, chapter 25,

"Administering a Database System."

"Microsoft Access User's Guide," version 1.0, Appendix D, "Setting Up

Microsoft Access on a Network."

References


INF: Common Dialog Boxes Allow Only Lowercase Typing

 Article Number: Q90987

 CREATED: 26-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

The File Name box in the File New Database, File Open Database, File

Compact Database, File Encrypt/Decrypt Database, and File Repair

Database dialog box allows typing in lowercase only.

This behavior occurs because the File Name box in the common dialog

box template has the lowercase flag set so as to allow more characters

to be displayed in the given width. This behavior has no effect on the

outcome of the given tasks because Microsoft Access does not

differentiate between lowercase and uppercase characters in filenames.

References


INF:  How To Use Get and Write PrivateProfileString

 Article Number: Q90988

 CREATED: 26-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

Microsoft Access version 1.0 does not have a function to access or

store various settings in user created applications (that is, a log of

users, window position settings, etc.). However, you can use the

Microsoft Windows 3.1 Application Program Interface (API) through

Access Basic (AB) to create user-defined functions to store

settings in a file outside the database.

More Information:

The variables are defined in this section of the article, followed by

the six steps necessary to create user-defined functions to store

settings in a file outside the database.

Definition Of Variables Used

----------------------------

Variables Required By GetPrivateProfileString and

WritePrivateProfileString:

   lpfilename$        - Filename looked for in Windows directory by

                        default.

   lpapplicationname$ - Section title in square brackets in the INI

                        file.

   lpkeyname$         - The section in the INI file where the

                        information is located.

   lpDefault$         - What information to give if there is no value.

   lpreturnedstring$  - Information asked for from the INI file.

   nSize%             - Max number of characters the buffer holds of

                        information returned.

   lpString$          - The information saved in the INI file.

User Defined Variables:

-----------------------

GotInfo  - Information retrieved from the level requested

GetInfo$ - Used to pass the lpkeyname$ to function GetInfo

Where$   - Used to pass the lpkeyname$ to function WriteIni

Info$    - Used to pass the lpString$ to function WriteIni

Steps to follow:

1. Choose Module from the Database window.

2. Choose New to create a new module.

3. Type the declaration statements that follow in the Global

   Declarations section.

   Enter each declaration statement below on one line.

      Option Explicit

      Declare Function GetPrivateProfileString% Lib "Kernel"

                              (ByVal lpapplicationname$,

                               ByVal lpkeyname$,

                               ByVal lpDefault$,

                               ByVal lpreturnedstring$,

                               ByVal nSize%, ByVal lpfilename$)

      Declare Function WritePrivateProfileString% Lib "Kernel"

                              (ByVal lpapplicationname$,

                               ByVal lpkeyname$,

                               ByVal lpString$,

                               ByVal lpfilename$)

5. Type the following function that gets the information from the file.

      Function GetIni (GetInfo$)

         lpfilename$ = "YOUR.INI"

         lpapplicationname$ = "Your Section"

         lpkeyname$ = GetInfo$

         lpDefault$ = "No Value"

         lpreturnedstring$ = Space$(255)

         nSize% = Len(lpreturnedstring$)

         'NOTE: The following statement is entered on one line.

         GetIni = GetPrivateProfileString(lpapplicationname$,

                                       lpkeyname$, lpDefault$,

                                       lpreturnedstring$, nSize%,

                                       lpfilename$)

         GotInfo = lpreturnedstring$

      End Function

6. Type the following function that writes the information to the file.

      Function WriteIni (Where$, Info$)

         lpapplicationname$ = "Your Section"

         lpkeyname$ = Where$

         lpString$ = Info$

         lpfilename$ = "YOUR.INI"

         'NOTE: The following statement is entered on one line.

         WriteIni = WritePrivateProfileString(lpapplicationname$,

                                       Where$, Info$, lpfilename$)

      End Function

To use these functions follow the two steps below:

1. When used in a macro, the function WriteIni creates the entry

   First=TIME in the file YOUR.INI under a section named [Your

   Section]. The following line calls the function:

      =WriteIni("First","TIME")

   In the file YOUR.INI the entry looks like the following:

      [Your Section]

      First=TIME

2. Use the function GetIni in a Macro to return "TIME" (without the

   quotes) in the variable GotInfo.

      =GetIni("First")

   The variable GotInfo now holds the value "TIME" (without the quotes)

   and can be used anywhere needed in the application.

   NOTE: This example does not have error trapping. Unexpected results

   may occur if the declarations and the variable types are not correct

   or your file is not in the location specified or does not exist.

Reference(s):

"Microsoft Access Basic: An Introduction to Programming", version 1.0,

chapters 1-5.

"Microsoft Access Language Reference", version 1.0, Part 1.

"Microsoft Windows Software Development Kit", Microsoft Press, 1992.

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3", Charles Petzold, Microsoft Press, 1990.

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference" Volumes 1 - 6, Microsoft Press, 1992.

References


INF: How To Tell If An Object Exists in the Database

 Article Number: Q90989

 CREATED: 26-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

It may be necessary to check for the existence of an object before the

creation of a new Table, Form, Report, etc., using Access Basic (AB).

This article explains how functions can check for the existence of a

given object.

More Information:

Definition of variables used

----------------------------

ObjectFound% - a test variable. If -1 then the object exists, otherwise

it does not.

WhatObjectType As String - the object type of the item in question.

ObjectName - the name of the item in question.

Follow these four steps to create a user-defined function to check for

the existence of a given object:

1. Choose Module from the database window.

2. Choose New to create a new module.

3. Type the declaration statements that follow in the Declarations

   page in the new module.

      Global ObjectFound%

      Global WhatObjectType As String

4. Type the following function that checks for the existence of a given

   object:

      Function ObjectExists% (WhatObjectType$, ObjectName$)

         Dim ObjectFound%

         On Error Resume Next

         If WhatObjectType = "Form" Then

            DoCmd SelectObject A_FORM, ObjectName, True

         ElseIf WhatObjectType = "Table" Then

            DoCmd SelectObject A_TABLE, ObjectName, True

         ElseIf WhatObjectType = "Macro" Then

            DoCmd SelectObject A_MACRO, ObjectName, True

         ElseIf WhatObjectType = "Module" Then

            DoCmd SelectObject A_MODULE, ObjectName, True

         ElseIf WhatObjectType = "Report" Then

            DoCmd SelectObject A_REPORT, ObjectName, True

         ElseIf WhatObjectType = "Query" Then

            DoCmd SelectObject A_QUERY, ObjectName, True

         Else

            MsgBox WhatObjectType & " type does not exist!"

            WhatObjectType = "False"

         End If

         If Err <> 2544 Then

         'Object was found in the Database Container (DBC)

            Err = 0     'Reset the error level

            ObjectFound% = -1

         Else           'Object was not found in the DBC

            ObjectFound% = 0

            MsgBox "Error #" & Err & ": " & Error

            'Give error number and message

         End If

      End Function

To use the function ObjectExists, do the following:

Choose Immediate Window from the View Menu while in a module, then

type:

   ?ObjectExists("object type","Object name")

Note: Where "object type" is "Form", "Table", "Macro", "Module",

"Query", or "Report" and "object name" is the name of the object in

question. An sample call would be:

   ?ObjectExists("Table","Employees")

If the object exists, the database window becomes active and the

object is selected. If the object does not exist a Message Box pops up

stating the error that occurred and that the object does not exist. If

the object type is incorrect, a Message Box pops up stating that the

object type does not exist.

Note: One side effect of the above function is that it will make your

Database window visible and have the focus if the table exists. This

can be corrected with a test function to find the Visible state of the

Database window and change it and the focus as desired.

Reference(s):

"Microsoft Access Basic: An Introduction to Programming", version 1.0,

chapters 1-5.

"Microsoft Access Language Reference", Part 1, version 1.0.

"Microsoft Windows Software Development Kit", Microsoft Press, 1992

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3", Charles Petzold. Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference" Volumes 1 - 6, Microsoft Press, 1992

References


PRB: Cannot Scroll Left in Form's Design View with Rulers

 Article Number: Q90990

 CREATED: 26-OCT-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   In a form's Design view, with both Microsoft Access and the form

   maximized, turning the rulers off and then selecting and dragging a

   control on a form to the left does not give expected results.

   The control will not scroll left until the ruler is turned back on.

   You can, however, move and scroll by using the "thumb" (scroll bar

   box) manually. Turning the rulers off and selecting and dragging a

   control right widens the form.

CAUSE

   Microsoft Access will scroll left if the edge of the form is

   encountered while dragging a control. With everything maximized,

   the control being dragged does not run into the edge of a form or

   window; it runs into the edge of the screen. The other edges have

   Microsoft Access objects (scroll bars or menu bars) so Microsoft

   Access is aware that the control is being dragged and will scroll

   accordingly.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 8, "Form

Basics," and Chapter 9, "Designing Forms"

References


INF: Transparent Text Boxes Not Supported in Access

 Article Number: Q91045

 CREATED: 27-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

The default label control associated with a text box control has a

BackStyle property that can be changed to Clear on the color palette,

but the text box itself has no such property and cannot be changed to

Clear on the color palette.

To work around this limitation, change the BackColor property of the

text box to the same color as the background it overlays.

References


INF: SQL Server Triggers and Key Values to and from Access

 Article Number: Q91179

 CREATED: 29-OCT-1992

 MODIFIED: 21-APR-1993

Summary:

If an Access procedure sends a record to SQL Server to insert into a SQL

Server table, and the unique key for the record is created by a trigger

on that table, the Access procedure will lose reference to the record.

More Information:

When information is sent to a SQL Server table, Access looks at the record

and determines a unique key value using the information in that record.

When the data is passed to a SQL Server backend to be inserted into a table

and a trigger creates a unique key value for the record, Access will lose

reference to that record because the unique key stored by Access is different

than the unique key created by the trigger on SQL Server. Until it is

queried on using the new unique key value, Access views the record just sent

to SQL Server as having been deleted.

References


PRB: Expression in Query Grid Doesn't Show All Text

 Article Number: Q91705

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 8053

SYMPTOMS

   When entering an expression in the Query Grid window, Microsoft Access

   does not fill a cell all the way to its right. On long expressions, it

   may look like your expression is cut off before the end of the cell.

CAUSE

   Microsoft Access reserves a portion of the cell to display the drop

   down arrow. Your expression remains unchanged.

RESOLUTION

   Click the cell and press SHIFT+F2 to view the entire expression in

   the Zoom box.  You can also change the size of the cell by clicking

   and dragging the cell border at the top of the grid cell.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open a Database (such as NWIND.MDB.)

2. Create a new Query (you do not need to add any tables).

3. Enter the following expression in the first column:

   [Unit Price]*[Quantity]

4. Press tab or enter to move to the next column.

The expression in the first column appears truncated.

Reference(s):

Microsoft Access On-Line Help, search on "Zoom Box"

References


INF: Use CTRL+M to Open Objects in Design Mode

 Article Number: Q91707

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

You can use the CTRL+M key combination to force any object in the

database window to open in Design mode.

More Information:

Steps to reproduce behavior:

----------------------------

1. Select any object in the database window.

2. While holding down the Control key (CTRL), type the letter M.

The object that you select will now be opened in design mode rather

than the default browse mode.

References


PRB: Query Design Status Bar Does not Have Help Message

 Article Number: Q91708

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   In Query Design Mode, the status bar does not inform the user that

   "F6=Switch Panes F1=Help" as it does in Table and Macro design modes.

STATUS

   This behavior is by design.

More Information:

Query design mode offers the use of F1 to display help, and F6 to

switch panes in the design window.

Reference(s):

On-Line Help, search on "F1" and "Keyboard: Navigation Keys".

References


PRB: Changing Caption on Title Label Leaves Shadow Unmodified

 Article Number: Q91709

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 10288

SYMPTOMS

   Changing the Caption on the Title Label leaves the shadow of the

   original Title Bar present. This occurs when creating a form with any

   Form Wizard (other than Graph) using Embossed View.

STATUS

   This behavior is by design. There are two labels associated with this

   caption.  The shadow is really another separate label that gives the

   impression of a shadow.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new form using any Form Wizard, except Graph.

2. Select Embossed as the View for the form.

3. Open the form in Design mode.

4. Select the title and change the Caption to something shorter than

   the current title.

5. Change to a smaller point size to make the shadow more visible.

6. Switch to Form view.

In order to use the Embossed View and the new title correctly, you

must also select the shadow and change it.

References


PRB: No Implicit Parameters on CrossTab Queries

 Article Number: Q91710

 CREATED: 03-NOV-1992

 MODIFIED: 25-APR-1993

Summary:

SYMPTOMS

   If you create a CrossTab (XTAB) Query using an implicit parameter

   [XXX] in a WHERE clause, Microsoft Access will return the following

   error:

      "Cannot Bind '[XXX]'"

   If you use an explicit parameter, the query works as expected.

CAUSE

   A CrossTab query dynamically creates column names. Therefore,

   Microsoft Access cannot tell whether [XXX] is referring to a parameter

   or a column name until after the query is bound. This may result in a

   Catch-22 situation, since sometimes it is necessary to run the query

   before binding it.

RESOLUTION

   To avoid this situation, define [XXX] as an explicit parameter by

   adding it to the Query Parameters dialog box of the requesting query

   (rather than the crosstab query).

STATUS

   This behavior is by design.

Reference(s):

Search On-Line Help for "Creating a Parameter Query."

References


INF: 'Couldn't Open File' Error Message Using Paradox Table

 Article Number: Q91711

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes why you may be unable to open an attached

Paradox table from within Microsoft Access, or why you may experience

an 'Unexpected Condition' in Paradox when you attempt to view a table.

Paradox and Microsoft Access are able to simultaneously access the

same Paradox tables if there is only one PARADOX.NET file in use by

both programs.

Microsoft Access

----------------

If you are in Microsoft Access and attempt to open an attached Paradox

table you may receive the following error:

   Couldn't open file 'filename'

This may be caused by already having the table open in Paradox. Other

situations could also cause this error message. For more information,

search for 'Error Messages Reference' using the help menu.

Paradox

-------

If you are in Paradox and attempt to open a table, you may experience

an error condition and be returned to the DOS prompt or Windows. A

message similar to the following appears:

   Unexpected condition: File open (I104) - c:\pdoxdata\yourfile.db

   (Code 5) -- Leaving Paradox

This may be caused by Microsoft Access having the table open.

In both situations the possibilty exists that there are two different

PARADOX.NET files in use by the applications.

More Information:

When you attach to a Paradox version 3.0 or 3.5 table (<filename>.DB)

in Microsoft Access, file locking information is maintained by

PARADOX.NET the Paradox network control file. Paradox requires this

file in network environments but it is also used in standalone

configurations.

Microsoft Access places a PARADOX.NET file in the Microsoft Access

program directory during the setup process. An entry is made in the

MSACCESS.INI file in the [Paradox ISAM] section pointing to the

location of the file. The MSACCESS.INI file should be in your Windows

directory. The entry follows:

   [Paradox ISAM]

   ParadoxNetPath=C:\ACCESS\

Paradox also installs a PARADOX.NET file during normal installation.

By default it will be located in the Paradox program directory. The

location of this file is determined by the network administrator

during a network installation.

To redirect Microsoft Access to the location of the PARADOX.NET file

that Paradox installed, edit the MSACCESS.INI file in any text editor

such as Notepad, and change the path. Do not include the name of the

file.

To change the Paradox configuration to point to the Microsoft Access

PARADOX.NET file, you could run the NUPDATE.EXE utility. Refer to the

Paradox "Network Administrator's Guide" for more information on this

topic.

References


INF: Height/Width Settings Don't Affect Size of Objects

 Article Number: Q91712

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

Setting the Height and Width properties for an object within an option

group does not affect the size of the Option button or Check box;

instead, it affects only the label associated with the Option button

or Check box.

More Information:

Adjusting the Height and Width properties for an object within an

option group increases or decreases the area you can click with the

mouse and select the specific Option button or Check box. Setting

these properties does not affect the visible size of the object.

For additional information, search Help for 'Option Button Properties'

and select the topic 'Option Button Control Properties.'

Reference(s):

"Microsoft User's Guide" version 1.0, chapter 9, "Designing Forms",

pages 247-252.

References


PRB: Grid Lines Not Visible in Access When Using Wizards

 Article Number: Q91713

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The grid is not visible in design mode when using Wizards for Forms or

   Reports.

CAUSE

   Report Wizards and Form Wizards will each use default GridX and GridY

   values of 64. If these settings are greater than 16, the grid is not

   visible. The default settings are in the visible range when you don't

   use the wizards.

RESOLUTION

   You can make the grid visible by selecting the properties box for

   the form or report and changing the GridX and GridY unit settings so

   that they are less than or equal to 16 units per inch.

More Information:

If you are creating a report or a form, the grid will be visible when

you do not use the Wizard, but will not be visible if the Wizards are

used. This is true only in design mode. The grid can be made visible

when you use the Wizards by changing the GridX and GridY property

settings.

Grids are dots that appear in the design views of a report or a form.

These help you position controls more precisely by letting you

increase or decrease the fineness of the grid. The number used in the

GridX and GridY properties reflect the number of dots per unit of

measurement. This unit of measurement is usually inches, but will vary

depending on the control panel settings of the individual. If the

numbers in the grid properties are greater than 16 dots per inch or 6

dots per centimeter, they will not be visible. The allowable values

are from 1 to 64.

References


PRB: Toolbars Do Not Use Control Panel Button Background

 Article Number: Q91714

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

Changing the button background in the control panel does not change

the Toolbar's background. This behavior is consistent with the status

bar in Microsoft Access, and with other applications' toolbars, such

as Microsoft Excel (with the exception of Microsoft Word for Windows.)

More Information:

Toolbars in Access are predefined forms. There is no way to specify

the Button Background as a color on a form. If you would like to

change colors within Microsoft Access, you can open and edit the forms

contained in UTILITY.MDA. If you modify UTILITY.MDA, however, extreme

care should be taken beforehand by creating one or more backups of it.

References


PRB: Text May be Hard to Read on an EGA Screen

 Article Number: Q91715

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Text may be hard to read or appear slightly off center when using an

   EGA video driver. This condition may worsen if you use a gray

   background. This is particularly true of Option Buttons.

STATUS

   This behavior is by design.

References


PRB: Two Labels on Top of Each Other Both Print

 Article Number: Q91716

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you have two labels on top of each other, both labels may

   print using the following Windows printer drivers and the hardware

   printer fonts:

      Win 3.0

         CANONIII

         DESKJET

         IBM4019

      Win 3.0 SDL

         BROHL24

         CANONIII

      Win 3.1

         HPPCL5A

         IBM4019

         LBPIII(Canon)

CAUSE

   This is a limitation of the printer driver.

RESOLUTION

   Do not place labels on top of each other.

STATUS

   This behavior is by design.

References


INF: Form Sizing Grid Accepts Non-Integer Values

 Article Number: Q91720

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

When you use use the Grid option in design mode for either a form or a

report, non-integer values are accepted, but are rounded to the

nearest integer.

More Information:

Steps to reproduce behavior

---------------------------

1. Open a report or form in design mode

2. Change the Grid option to any non-integer value

3. Upon exiting the field, the value you entered is rounded to

   the nearest integer

References


PRB: FormWizard Labels Placed on Left Margin Grow Down

 Article Number: Q91721

 CREATED: 03-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   New labels added at the left margin of a form created by FormWizards

   using a single column format appear to "grow" down instead of out

   towards the right margin. In fact, the default label is aligned right

   for all single-column FormWizards.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a bound form using a FormWizard and choose Single Column.

2. Open the form in Design Mode

3. Create a label on the leftmost side of the form in any section.

Results:  As the user enters text for the label, it grows down with

each keystroke.

References


FastTips: Database Structure Questions & Answers

 Article Number: Q92469

 CREATED: 08-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

            WX0635: DATABASE STRUCTURE QUESTIONS & ANSWERS

======================================================================

                                                  Revision Date: 10/92

                                                      No Disk Included

 --------------------------------------------------------------------

| 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(R)  |

| 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 Microsoft Corporation. All Rights Reserved.         |

| Microsoft and MS-DOS are registered trademarks and Microsoft       |

| Access and Windows are trademarks of Microsoft Corporation.        |

| 1-2-3 and Lotus are registered trademarks of Lotus Development     |

| Corporation. Btrieve is a registered trademark of SoftCraft, Inc., |

| a Novell Company. dBASE III PLUS and dBASE IV are registered       |

| trademarks of Ashton-Tate Corporation. Paradox is a registered     |

| trademark of Ansa Software, a Borland company.                     |

 --------------------------------------------------------------------

1. Q. What foreign data formats does Microsoft Access support?

   A. Microsoft Access can link to Btrieve(R), dBASE III PLUS(R),

      dBASE IV(R), and Paradox(R) versions 3.x data, including

      indexes.

      Microsoft Access can import data from Btrieve, dBASE III PLUS,

      dBASE IV, FoxPro versions 2.x, Lotus(R) 1-2-3(R) versions 2.x

      and 3.x, Lotus 1-2-3/W, Microsoft Excel for Windows versions 2.x

      and later, Paradox 3.x, and fixed-length and delimited ASCII

      text.

      Microsoft Access also supports the Open Database Connectivity

      (ODBC) specification for connectivity to data on database

      servers. ODBC drivers for Microsoft SQL Server are included with

      Microsoft Access. Microsoft SQL Server ODBC drivers are the only

      drivers certified for Microsoft Access version 1.0.

2. Q. What are primary and foreign keys in a relational database?

   A. Primary keys uniquely identify a specific row in a table. They

      are usually composed of a single field or column whose data is

      unique to each row of information (for example, a customer

      identification number, employee social security number, or order

      identification number). Primary keys also can be composed of

      more than one field. For example, the fields Company

      Identification and Contact Name could be combined to form a

      primary key for a table that contains information about

      companies that have more than one contact.

      Foreign keys identify rows in one table that match the primary

      key of another table. For example, if the field Employee ID is

      the primary key in the Employee table, in the Orders table,

      Employee ID is the foreign key. The relationship between primary

      and foreign keys enables you to access related data in multiple

      tables.

3. Q. Which FieldSize setting should I select for the Number data

      type in order to use a Counter field of another table as the

      foreign key in the current table?

   A. To use a Counter field of another table as the foreign key in

      the current table, select the Long Integer setting.

4. Q. How do you change the starting value of a Counter column to

      a number other than 1?

   A. To set the starting value of a Counter column to a number other

      than 1, use the following four-step procedure:

      1. Create an additional single-column temporary table. Give

         the Number column the same name as the Counter column in the

         original table.

      2. Create a new row in the temporary table by inserting a

         value in the Number column. This value should be 1 less than

         the desired starting value for the original table.

      3. Create an Append query to append the single row from the

         temporary table to the original table.

      4. Once you append the single row, delete the temporary

         table. You can then delete the dummy row from the original

         table.

       NOTE: Do not compact the database before you add the first row

       to the original table. If you do this, the counter value is

       reset to start at 1.

5. Q. Is data in tables stored in a sorted order? How can I view

      my data in sorted order?

   A. Data in tables is not stored in sorted order. Data is stored in

      the order in which it was entered. To view data in sorted order,

      create either a query, or a form based on a query, that uses the

      Sort field on the query grid. By default, if the table includes

      a primary key, the Datasheet view of the table will display the

      data sorted by the primary key. To view the data sorted by

      something other than the primary key alone, use a query, as

      previously described.

6. Q. How can I delete the primary key from a table?

   A. You can delete the primary key for a table by opening the Table

      Properties dialog box and deleting the entry for the Primary Key

      field. Please note that the primary key cannot be deleted from a

      table that is the primary table in a relationship.

7. Q. How can I create computed columns in tables?

   A. You can create computed columns or expressions with queries.

      Within the query, create a column that is defined as an

      expression. In general, it is helpful to think of queries as

      virtual tables; you can use a query wherever you can use a

      table. If you're familiar with SQL terminology, this is very

      similar to creating a view. Unlike most implementations of

      views, however, Microsoft Access views can be updated even if

      they involve joins from different data sources, such as Paradox,

      Btrieve, or separate Microsoft Access data sources.

References


FastTips: Access Basic and Macros Questions & Answers

 Article Number: Q92472

 CREATED: 08-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

          WX0636: ACCESS BASIC AND MACROS QUESTIONS & ANSWERS

======================================================================

                                                  Revision Date: 10/92

                                                      No Disk Included

 --------------------------------------------------------------------

| 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(R)  |

| 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 Microsoft Corporation. All Rights Reserved.         |

| Microsoft and MS-DOS are registered trademarks and Microsoft       |

| Access and Windows are trademarks of Microsoft Corporation.        |

 --------------------------------------------------------------------

1. Q. How can I run macros from Microsoft Access Basic?

   A. The following are three suggested ways to run macros from Access

      Basic:

      a. 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>"

      b. 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>"

      c. 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.

References


FastTips: Forms Questions & Answers

 Article Number: Q92475

 CREATED: 08-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

                   WX0637: FORMS QUESTIONS & ANSWERS

======================================================================

                                                  Revision Date: 10/92

                                                      No Disk Included

 --------------------------------------------------------------------

| 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(R)  |

| 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 Microsoft Corporation. All Rights Reserved.         |

| Microsoft and MS-DOS are registered trademarks and Microsoft       |

| Access and Windows are trademarks of Microsoft Corporation.        |

 --------------------------------------------------------------------

1. Q. How do I invoke my Microsoft Access Basic code from within a

      form?

   A. To call a function from a property, type the following:

        =function name()

      The equal sign and parentheses are required. You can call an

      Access Basic function from form or control properties, such as

      After Update or Default Value. Search for the name of a specific

      property in Help for examples. Subroutines cannot be called from

      properties. For more information, please refer to "An

      Introduction to Programming," Chapter 7, page 1.

2. Q. Do form rules override table rules?

   A. Yes, form rules do override table rules. When you position

      fields on a form by dragging them from the Field list, the

      validation property for the field inherits the validation rule

      that was defined for the field in the table design.

3. Q. When is it appropriate to use the exclamation point versus

      the period when identifying objects and properties in an

      expression?

   A. A good rule of thumb is to use the exclamation point before

      anything you specifically name (such as the name of your form or

      a control on the form) and to use a period before anything

      Microsoft Access names (such as a property).

4. Q. Why doesn't the header I created show in Form view?

   A. The header you created was most likely a page header. There are

      two different types of headers available on forms: form headers

      and page headers. A form header is displayed on-screen and when

      printed; a page header is displayed only when printed.

5. Q. How do I reference a control on a subform?

   A. To reference the subform control itself, you must use the form

      property of the subform control as follows:

        forms![master form name]![subform control name].form![control

        name]

6. Q. When are validation rules on a form evaluated?

   A. Microsoft Access evaluates a validation rule only when data is

      entered or edited in a field and the cursor is moved to a

      different field or record. If you leave the field unchanged, the

      validation rule is not evaluated. Microsoft Access also

      validates a field on a form when you leave the form, when you

      switch views, or when you close the form. To check for nulls,

      you must use a macro. For more information, please refer to

      Chapter 22 of the "User's Guide."

References


FastTips: Querying Questions & Answers

 Article Number: Q92476

 CREATED: 08-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

                 WX0639: QUERYING QUESTIONS & ANSWERS

======================================================================

                                                  Revision Date: 10/92

                                                      No Disk Included

 --------------------------------------------------------------------

| 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(R)  |

| 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 Microsoft Corporation. All Rights Reserved.         |

| Microsoft and MS-DOS are registered trademarks and Microsoft       |

| Access and Windows are trademarks of Microsoft Corporation.        |

| Btrieve is a registered trademark of SoftCraft, Inc., a Novell     |

| Company. dBASE III PLUS and dBASE IV are registered trademarks     |

| of Ashton-Tate Corporation. Paradox is a registered trademark of   |

| Ansa Software, a Borland company.                                  |

 --------------------------------------------------------------------

1. Q. How can I export the result of a query?

   A. To export the results of a query, you must create a table that

      contains the results. To do this, create a make-table query in

      Design view (choose Make Table from the Query menu). The

      resultant table will contain the data to be exported. After the

      make-table query is complete, choose Export from the File menu

      to export the data in the desired format. For more information,

      please refer to Chapter 4 of the "User's Guide."

2. Q. Can I join tables from different databases into one query?

   A. Yes, you can join tables from different databases into one

      query. Using the Attach Table method, you can generate queries

      from any supported data source (for example, Btrieve[R], dBASE

      III PLUS[R], dBASE IV[R], or Paradox[R]).

3. Q. Is data in tables stored in a sorted order? How can I view

      my data in sorted order?

   A. Data in tables is not stored in sorted order. Data is stored in

      the order in which it was entered. To view data in sorted order,

      create either a query or a form based on a query that uses the

      Sort field on the query grid. By default, if the table includes

      a primary key, the Datasheet view of the table will display the

      data sorted by the primary key. To view the data sorted by

      something other than the primary key alone, use a query, as

      previously described.

4. Q. How can I create computed columns in tables?

   A. Within the query, create a column that is defined as an

      expression. In general, it is helpful to think of queries as

      virtual tables; you can use a query wherever you can use a

      table. If you're familiar with SQL terminology, this is very

      similar to creating a view. Unlike most implementations of

      views, however, Microsoft Access views can be updated even if

      they involve joins from different data sources, such as Paradox,

      Btrieve, or separate Microsoft Access data sources.

5. Q. What is the difference between the keywords DISTINCT and

      DISTINCTROW?

   A. DISTINCT is part of the SQL standard and causes a query to

      return unique data, rather than unique records. For example,

      even if there are 10 customers named Jones, the query "SELECT

      DISTINCT Name FROM Customer" returns only one row containing

      Jones. In Microsoft Access queries, you specify DISTINCT by

      choosing Query Properties from the View menu and selecting the

      Unique Values Only check box.

      DISTINCTROW is unique to Microsoft Access and is not part of the

      SQL standard. It causes a query to return unique records, rather

      than unique data values. For example, if there are 10 customers

      named Jones, the query "SELECT DISTINCTROW Name FROM Customer"

      returns all 10 rows containing Jones.

      The major reason for adding the DISTINCTROW keyword to Microsoft

      Access SQL is to support semi-joins that can be updated (for

      example, one-to-many joins in which the output columns all come

      from the one-side table). DISTINCTROW is specified by default in

      Microsoft Access queries and is ignored in queries where it has

      no effect.

References


FastTips: Reporting Questions & Answers

 Article Number: Q92477

 CREATED: 08-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

======================================================================

  Microsoft(R) Product Support Services Application Note (Text File)

                 WX0640: REPORTING QUESTIONS & ANSWERS

======================================================================

                                                  Revision Date: 11/92

                                                      No Disk Included

 --------------------------------------------------------------------

| 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(R)  |

| 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 Microsoft Corporation. All Rights Reserved.         |

| Microsoft and MS-DOS are registered trademarks and Microsoft       |

| Access and Windows are trademarks of Microsoft Corporation.        |

 --------------------------------------------------------------------

1. Q. Why is every other page of my report blank? How can I correct

      this problem?

   A. This problem commonly occurs when the width of your report

      combined with the left and right margins is greater than the

      width of your paper. Adjust the width of your report and the

      margins so that your report fits on the page.

2. Q. How can I convert a form to a report?

   A. To convert a form to a report, open the form in Design view and

      choose Save As Report from the File menu.

3. Q. How can I sort the data in a report by a field not displayed

      on the report?

   A. To sort report data by a field in a separate table, create a

      query that includes the field from the other table, then base

      the report on the query. If you have already created the report,

      verify that the query includes all the fields used in the report

      and change the Record Source property of the report to refer to

      the new query. Now you can adjust the Sorting and Grouping

      properties of the report to sort on the new field.

References


FastTips: General Information Questions & Answers

 Article Number: Q92496

 CREATED: 08-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

======================================================================

   Microsoft(R) Product Support Services Application Note (Text File)

             WX0638: GENERAL INFORMATION QUESTIONS & ANSWERS

======================================================================

                                                    Revision Date: 11/92

                                                        No Disk Included

 --------------------------------------------------------------------

| 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(R)  |

| 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 Microsoft Corporation. All Rights Reserved.         |

| Microsoft and MS-DOS are registered trademarks and Microsoft       |

| Access and Windows are trademarks of Microsoft Corporation.        |

 --------------------------------------------------------------------

1. Q. What sources of information about Microsoft Access, in

      addition to the documentation, does Microsoft provide?

   A. Microsoft provides several resources with current information

      about Microsoft Access. If you have a modem, you can download

      Microsoft Knowledge Base articles about Microsoft Access from the

      Microsoft Download Service (MSDL). You can also download the

      Windows Driver Library (WDL) from this service. The WDL is also

      available at no charge on CompuServe, GEnie, and Microsoft OnLine.

      After you connect to any of these services, please read the

      WDL.TXT file for instructions on downloading the WDL and a

      complete list of files that it contains.

      You can reach the MSDL at (206) 936-6735. There is no charge for

      using this service; however, standard connect-time fees and long-

      distance telephone charges do apply when you are downloading

      information.

      On the CompuServe, GEnie, and Microsoft OnLine systems, the WDL is

      located in the Microsoft Software Library. On CompuServe, you can

      reach the Microsoft Software Library by typing "go msl" (without

      the quotation marks) at the command prompt. To locate the WDL.TXT

      file, search on the word S13354.

      If you do not have a modem, you can order the WDL on disk from

      Microsoft Consumer Sales at (800) 426-9400. Microsoft Consumer

      Sales is open Monday through Friday, 6:30 A.M. to 5:30 P.M.,

      Pacific time. There is a $20 charge to order the WDL on disk.

2. Q. How many databases can I open at one time in Microsoft Access?

   A. Through the user-interface menus in Microsoft Access, you can open

      only one database at a time; therefore, you can view only one

      Database window in each session of Microsoft Access. In Access

      Basic, however, you can use the OpenDatabase() function to open

      several databases at once. The number of databases you can have

      open simultaneously through Access Basic is limited only by

      memory. Also, by choosing Attach Table from the File menu, you can

      attach to as many databases as memory allows.

References


PRB: Cannot Install Cue Cards Without Installing Help

 Article Number: Q92639

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   During a custom installation, you can select and deselect options

   through the Microsoft Access Setup Options dialog. If you deselect

   "Help," the size of the "Cue Cards" files increases from 1688 K to

   5112 K. However, the total disk "Space required" does not increase and

   the size of "Help" does not decrease from 3424 K to 0 K.

CAUSE

   You must have Help loaded in order to use Cue Cards. Therefore, when

   you deselect Help, the size of the Cue Cards files increases to

   include the size of the Help files.

   "Help" and "Cue Cards" are separate selections because it is possible

   to install and use the Help files without installing the Cue Cards

   files.

STATUS

   This behavior is by design.

References


INF: How to Take a Button Out of Tab Order

 Article Number: Q92640

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes two methods for removing push buttons from the

tab order on a form.

More Information:

1. Place the buttons in a form header or footer. Each section on a

   form has it's own tab order, so the form user would have to explicitly

   move from the detail section to the header or footer.

2. Place an unbound, hidden text box before the buttons in terms of

   tab order on the form. In the OnEnter property of the hidden text box,

   call a macro that sets focus to the first control on the form.

   This solution is one that FormWizards also use. Put all of your

   regular controls in the detail section of the form first in the tab

   order, then place an unbound, hidden text box on the form, and finally

   place any buttons on the form. In the OnEnter property of the hidden

   text box, use a macro to set focus to the first of your regular

   controls.

References


INF: Differences Between Native and Attached Tables

 Article Number: Q92644

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

Attached tables (ie. Paradox, dBase IV, etc.) are not treated

differently from Microsoft Access tables, except for:

1. In the table list, attached table icons look slightly different

   than Access table icons. For attached tables, a black arrow is

   added to the table icon.

2. When attempting to take an attached table into design mode, you get

   a warning message, "Table 'xxxxx' is an attached table. Some

   properties can't be modified. Open it anyway?"

3. When you delete an attached table, its contents are not deleted

   (Which is what happens when you delete a native Access table.) Only

   the attached table entry is deleted from the list of tables.

   However, the alert message is the same for both types of deletions,

   which may lead you to believe that the attached table has been

   erased when it has not.

References


INF: How to Remove Relationships

 Article Number: Q92649

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

This article explains how to delete a relationship in Microsoft Access once

it has been created.

More Information:

The sample database NWIND contains a relationship between the Employees

and the Orders tables. The steps that follow describe how to delete

this relationship.

1. Open the NWIND database by selecting Open Database from the File menu.

2. From the Edit menu, choose Relationships.

3. From the Primary Table combo box, choose Employees.

4. From the Related Table combo box, choose Orders.

   Since there is a relationship already defined for these two tables,

   Microsoft Access automatically displays Employee ID in the Select

   Matching Fields combo box and grays out the Add button.

5. Choose the Delete button to remove the existing relationship.

6. Choose the Close button to exit the Relationships dialog box and return

   to the Database window.

Note: In addition to the Relationships dialog box, you can view

existing relationships by creating a query. Include all the tables in

your database in the query. Microsoft Access automatically displays

join lines when there are existing relationships between tables.

References:

For more information on listing relationships in a database, query on

the following words in the Microsoft Knowledge Base:

   relationships and list

References


PRB: OLE Objects Format From Excel Changes After Being Updated

 Article Number: Q92650

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

New OLE Objects created in Microsoft Excel are displayed without row or

column headings in Microsoft Access. Once the object has been updated,

the display changes and row and column headings are displayed.

More Information:

This article contains the steps to reproduce this problem.

Steps To Reproduce Behavior

---------------------------

1. Start Microsoft Excel.

2. Enter "Test" in cell A1.

3. Select cell A1 and choose Copy from the Edit menu.

4. Start Microsoft Access and open a database.

5. Create a new form and choose Paste from the Edit menu.

   This creates an OLE Object which displays cell A1.

6. Double-click on the OLE Object to activate Excel.

7. Modify the contents of cell A1.

8. From the File menu choose Update.

9. Activate Microsoft Access.

   The OLE Object now displays row and column headings.

   You may need to resize the OLE Object to see the updated

   contents of cell A1.

References


PRB: Excel Custom Date Format Not Detected by Import

 Article Number: Q92651

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When importing an Excel spreadsheet containing custom date formats

   into a new table, Microsoft Access imports the formatted fields with

   the data type of Double instead of Date/Time.

CAUSE

   The import protocol supports date and currency guessing only on cells

   formatted with a system-supplied (built-in) format.

RESOLUTION

   One possible workaround is to import the Excel file into an existing

   table where that field has been formatted for Date/Time. Access will not

   recognize the custom format but will display the date in the standard

   mm/dd/yy Date/Time format.

   Another option is to go into the design view of the newly imported

   table and change the data type from Number to Date/Time.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a New Excel spreadsheet.

2. Enter a date into Cell A1.

3. Create a New Date format such as mmmmmm/dd/yyyy.

4. Apply the format to the A column.

5. Import the spreadsheet with Access.

Results: Date comes in as a Number (Double) not Date/Time.

Reference(s):

"Microsoft Access User's Guide," version 1.0, chapter 4, pages 72-75.

References


PRB: Can't Attach to Paradox Table on Read-Only Drive

 Article Number: Q92653

 CREATED: 12-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   You cannot attach to a Paradox table (*.DB) that is on a read-only

   drive. If you attempt to attach you receive the error message:

   Couldn't open file 'FILENAME#DB'

CAUSE

   Neither Paradox or the Paradox ISAM shipped with Microsoft Access

   support databases on read-only shares.

STATUS

   This behavior is by design.

More Information:

Paradox is manufactured by Borland International, a vendor independent

of Microsoft; we make no warranty, implied or otherwise, regarding

this product's performance or reliability.

References


INF: How to Create a Chart Without a Title

 Article Number: Q92655

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

When creating a graph in Form Design mode using the GraphWizard,

Microsoft Access fills in the default value "Graph" if no title is

specified for the chart.

More Information:

There is a workaround for this by changing the font color for the

chart title:

1. Launch the Microsoft Graph Server from Form Design mode by selecting

   Insert Object from the Edit menu.

2. Double-click on the chart title.

3. Select Font from the Format menu.

4. Change the font color to the same color as your form background color.

5. Close Microsoft Graph and answer "Yes" to update.

6. Save the form.

   The title now blends in with the form background.

References


PRB: CTRL+HOME Navigation Problem in Macro Design Mode

 Article Number: Q92665

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you press the key combination CTRL+HOME when you are in design

   mode of a new macro, the cursor might not move to the beginning of

   the macro, as you might expect.

CAUSE

   If you click in the Action column you are in Edit mode for the current

   macro line; pressing CTRL+HOME moves the cursor to the beginning of

   the drop down list. If you click in any Comments column which is

   empty, you are already at the beginning of the field.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new macro.

2. Click in the Comments column of any row but the first.

3. Press CTRL+HOME.

Nothing happens. If you navigate with the arrow keys after clicking in

the Comment section, pressing CTRL+HOME positions you on the first

line of the macro.

References


INF: No Permission to Modify Data in a Table

 Article Number: Q92667

 CREATED: 12-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

When you attempt to modify data in a table (while in datasheet view),

you may receive the following error message:

    No permissions for '<name of table>'

This is confusing, because you were able to open the table without any

warning messages.

More Information:

This message indicates that you only have Read Definitions and Read

Data permissions for the table. Because you have rights to view the

data, there is no error message when you first open the table in the

default datasheet view.

A more descriptive message is generated when you first open the table

in design view:

    You don't have permission to modify '<name of table>'.

    Open as read-only?

This message appears when opening the table in design view because you

have no security permissions that would provide you design view

usability.

Reference(s):

"Microsoft Access User's Guide", version 1.0, page 621.

For more information, search in Help on "permissions command".

References


PRB: Can't Exit Extend Mode in Parameters Dialog Box

 Article Number: Q92669

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When in the Parameters dialog box of a query, you cannot get out of

   Extend mode by pressing SHIFT+F8.

CAUSE

   Pressing F8 turns Extend mode on (EXT appears in the status bar).

   Once Extend mode is on, pressing F8 repeatedly extends the

   selection to the word, the field, the record (in Datasheet and Form

   view), and all records (in Datasheet and Form view). Pressing

   SHIFT+F8 reverses the selection, but will not take you out of Extend

   mode. To turn off Extend, mode press ESC.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open a new Query (don't need to add any tables.)

2. Choose Parameters from the Query menu.

3. Enter a couple parameters with more than one word in each.

4. Click in the center of a word and press F8 to enable Extend mode.

At this point pressing SHIFT+F8 does not take you out of Extend mode.

References


PRB: Default Width in Report Design Does Not Reflect Margins

 Article Number: Q92670

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The default grid area is independent of how a report or form is

   printed. The controls you place in the document determine the size. In

   the USA, the default width of the grid area is set to 5 inches,

   regardless of the print settings (paper size, orientation, margins).

   You may think that because the default, US, print settings call for a

   page size of 8.5" x 11", portrait orientation, with 1" margins that

   the default grid area would be 8.5" - 2" = 6.5".

STATUS

   This behavior is by design.

More Information:

Search Help for "Creating a New Template for Forms and Reports" to change

the desired layout of reports or forms.

References


INF: Error Message 'Unable to Recover'

 Article Number: Q92671

 CREATED: 12-NOV-1992

 MODIFIED: 29-APR-1993

Summary:

You may receive the following error message when attempting to open a

table in design view:

   Unable to recover from attempt to switch view. Window

   will be closed.

Microsoft Access returns focus to the Database window.

More Information:

This error message occurs only in rare scenarios. It is an

informational message only, not a program error.

Steps to Reproduce behavior

---------------------------

1. Two users (User A and User B) both open the same database non-

   exclusively.

2. Both users open the same table in Datasheet view.

3. Both users simultaneously switch to Table Design view.

4. User A succeeds, but User B receives the following error message:

      Table is in use, cannot lock by user '<user B's logon name>'

      on machine <user B's machine name>'.

5. User B tries to reopen the table in Datasheet view, and receives

   the following error message:

      Couldn't lock table. Table '<table name>' is exclusively

      locked by user '<user A's logon name>' on machine '<user

      A's machine name>'.

6. User B is returned to the Database window with the following error

   message:

      Unable to recover from attempt to switch view. Window

      will be closed.

7. Microsoft Access returns User B's focus to the Database window.

When in Datasheet view (step #3), both users have the table open

non-exclusively. When they try to go into Table Design view, they are

actually closing the table and attempting to re-open it exclusively.

In the above scenario, User A succeeds and User B fails. Thus the

error message in step #4.

When User B then tries to re-open the table (non-exclusively) in

Datasheet view, User A already has the table exclusively locked. Thus

the error message in step #5.

The error message in step #6 is an information message designed to let

User B know that Microsoft Access is unable to open the table in

either Table Design or Datasheet view. Microsoft Access returns the

focus to the Database window.

References


PRB: TransferDatabase Macro Accepts Invalid File Names

 Article Number: Q92674

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When using the TransferDatabase macro to export a database,

   Microsoft Access allows you to enter file names that include spaces in

   the Destination argument. Once the database is exported with a file

   name that includes a space, Microsoft Access will not be able to import

   that file. If you try to import the file, the following error message

   appears:

      The filename is not valid

RESOLUTION

   If you export a file with a blank embedded in the filename, renaming

   the file without the space, using File Manager or MS-DOS, enables

   Microsoft Access to import the file.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a table and call it Table1.

2. Create a new macro:

   Macro Name   Condition   Action

   ---------------------------------------------

   Macro1                   TransferDatabase

   Macro1 Actions

   ---------------------------------------------

   TransferDatabase

   Arguments          Attribute

      Transfer Type:    Export

      Database Type:    Dbase or Paradox

      Database Name:    c:\access

      Object Type:      Table

      Source:           Table1

      Destination:      Test Table

      Structure Only:   No

3. This macro creates a file called Test Tab.xxx where xxx is the

   appropriate extension for the export type.

4. Try to import this file. Microsoft Access displays the message:

      Test Tab.xxx This filename is not valid

References


PRB: Insert Object Dirties Record

 Article Number: Q92675

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Placing your cursor in a field with the data type OLE Object, choosing

   Insert Object from the Edit menu, and then clicking the cancel button

   in the Insert Object dialog box will "dirty" a record. A dirty

   record is one that has been edited.

   If the field is part of an existing record, the previous contents of

   the field are not deleted or modified, but the record is rewritten

   when you move off of it.

STATUS

   This behavior is by design.

More Information:

Steps To Reproduce Behavior

---------------------------

1. Open a table that includes an OLE object field.

2. Place your cursor in the OLE object field.

3. Select Insert Object from the Edit menu, then click Cancel.

4. The record selector now indicates that the record is dirty by

   displaying the pencil indicator.

References


PRB: Subform not Updated

 Article Number: Q92676

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   As you scroll through records in the main form, your subform is not

   updated. The records on the main form and the subform are not

   synchronized.

CAUSE

   Your subform is not linked to the main form.

STATUS

   This behavior is by design.

RESOLUTION

   You should use the LinkMasterFields and LinkChildFields form

   properties to link your main form and subform automatically. You may

   manually update the subform by pressing the F9 function key

   (Recalculate).

More Information:

Recalculation occurs automatically for controls that reference other

fields on the same form, or fields in subforms. Recalculation does not

occur automatically for subform controls that only reference fields on

the main (master) form, or in other subforms.

This is because subforms notify the master form of any changes, but

the master form does not notify the subforms of changes. Nor do

subforms on the same main form notify one another of any changes.

Reference(s):

In the online Help, search on "Link: main form and subform" and

"function keys".

References


PRB: Scrolling to Bottom of Module Window Goes Past Typed Info

 Article Number: Q92677

 CREATED: 11-NOV-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   In a Module window, moving the vertical scrollbar thumb control all

   the way to the bottom takes you past the end of your program. You must

   manually scroll back up to locate the end of your code.

CAUSE

   The scrollbar indicates your position relative to the module's data

   boundaries, rather than your position relative to the current

   information in the module. Therefore, it is likely that at some point

   you entered information some distance below the end of your current

   code. Even though that information has been deleted, the module's

   boundaries still reflect the furthest position of entered information.

RESOLUTION

   Once a sheet's boundaries have been extended, there is no way to

   shrink them. A possible workaround would be to copy and paste your

   code into a new module window.

STATUS

   This behavior is by design.

References


PRB: Access Trims Spaces Off Database Names

 Article Number: Q92678

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When naming a database that has one or more spaces at the front of the

   database name, Microsoft Access strips off the leading spaces.

CAUSE

   By default, the Windows Common Dialog strips leading spaces off

   names.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new database.

2. Give the database a name that begins with a space.

3. Save the database.

4. Reopen the database. The space has been stripped off the name.

References


PRB: Out Of Memory When Pasting Text Into Module

 Article Number: Q92679

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   An "Out of Memory" message appears when pasting in more than

   64K of ASCII text from the Clipboard.

CAUSE

   The implementation of the Clipboard paste in Microsoft Access cannot

   paste more than 64K of ASCII text. This message appears even if the

   code translates into less than 64K of pseudocode.

RESOLUTION

   Paste the text into the module in more than one step. Each paste

   must contain less than 64K of text.

References


INF: Currency is Significant to Four Digits

 Article Number: Q92680

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

When using the currency data type within Microsoft Access Basic, be aware

that numbers are significant to four digits to the right of the decimal

point.

More Information:

The reason for this is that most financial information, such as

mortgage rates and stocks, require four digit degree of precision.

Currency variables are stored as 64-bit numbers (8 bytes) in a

two's complement integer format and scaled by 10,000 to give a

fixed-point number with 15 digits to the left of the decimal point

and 4 digits to the right. This representation provides a range of

-922,337,203,685,477.5808 to 922,337,203,685,477.5807. The Currency

data type is extremely useful for calculations involving money and for

fixed-point calculations in which accuracy is particularly important.

References


INF: Defragment and Compact Database to Improve Performance

 Article Number: Q92681

 CREATED: 12-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

Compacting your database and defragmenting your hard drive will

improve the performance of Microsoft Access.

More Information:

Since the data on your hard disk becomes fragmented over time, you

should run a disk defragmentation utility (or "defragmenter")

periodically. Within the file, portions of the database may also

become fragmented due to Microsoft Access. Because of this, you should

also run Compact from within Microsoft Access.

A disk defragmenter will place the database file in contiguous

clusters on your hard disk, making file access quicker in general. If

you do not defragment your hard disk, the time it takes for MS-DOS to

retrieve your file may increase since it must go to several physical

locations on the disk to retrieve the entire file.

The Compact option under the File menu will also aid in increasing the

performance of Microsoft Access. Compact makes a copy of the database,

rearranging how the database file is stored on disk if it is

fragmented.

File storage can become fragmented when you make many changes to a

database. The compacted database file is usually smaller. You can use

the same name as the original for the compacted database file, or you

can use a different name to create a separate file. If you use the

same name and the database is compacted successfully, Microsoft Access

automatically replaces the original file with the compacted version.

Limitations of Compact

----------------------

 - The compact operation succeeds only if you have enough storage space

   on your disk for both the original and compacted versions of the

   database.

 - You cannot compact a database when it is open. In a multi-user

   environment, the compact operation fails if another user has the

   database open.

Fragment or Compact First?

--------------------------

If you compact after running a defragmenter, you would theoretically

leave open disk space immediately after the .MDB file on the disk,

thereby allowing MS-DOS to place any additional information in the

next physical clusters (this would be very fast). However, if you

defragment after running Compact, your .MDB might be placed on the

first part of the disk followed by the rest of your files, with no

open disk space until the end (the inside tracks) of the disk. This

would result in somewhat slower disk access.

References


INF: Parameter Queries, Wildcards, and SQL Server

 Article Number: Q92682

 CREATED: 12-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

"*" and "?" are not valid wildcard characters in parameterized SQL

Server queries, and thus are interpreted by SQL Server as text. This

means that unless "*" and/or "?" happen to be present in the field

restricted by the parameter, the query will return an empty set.

Instead of using "*" and "?" in parameterized queries, use the SQL

Server wildcard characters ("%" and "_").

More Information:

SQL Server uses the ANSI standard wildcards "%" and "_", whereas

Microsoft Access uses "*" and "?". When using a parameterized query,

Microsoft Access does not translate the "*" or "?" to the SQL Server

wildcard equivalents "%" or "_". The string that is typed in the

parameter dialog box is passed verbatim to SQL Server. Microsoft

Access only translates strings that are part of the QBE Grid.

Reference(s):

For more information, search for "Parameter Query" using the Help

menu.

References


INF: '#Name?' or Control is Blank on Form Based on a Query

 Article Number: Q92683

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

If you have a form based on a query, and the query contains multiple

fields with the same name (such as FieldA from Table1 and FieldA from

Table2), the control(s) on the form that are bound to that field name

will be blank or may display the error "#Name?".

More Information:

Because the same field name appears multiple times in the query that

the form is based on, Microsoft Access does not know which field to

link to the control(s). Therefore, instead of making an assumption

about which field to bind to, it leaves the control(s) linked to

duplicate field names blank or displays the error "#Name?" in the

control.

To correct this problem, rename the field in the query.

To change a field name in a query:

1. In a query's Design view, place the insertion point in front of the first

   letter of the field name in the QBE grid.

2. Type the new name followed by a colon. Delete any names assigned by

   Microsoft Access, but don't delete the field name or expression.

Note: Changing a field name in a query's Design view changes the

heading in the query's Datasheet view and the field name in a Form or

Report based on the query. However, the underlying field name in the

table doesn't change.

Reference(s):

"Microsoft Access User's Guide," version 1.0, page 103.

References


INF: How to Change the Caption on the Access Window

 Article Number: Q92684

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

This article shows you how to change the default title bar of the

Microsoft Access window with a function called from a macro.

This macro can optionally be named "Autoexec", which would then change the

window caption automatically whenever this database is opened.

More Information:

To create this function:

1. Open a new database and name it TEST.MDB.

2. Open a new blank form. Place at least one control on the form.

   Close and save the form as "MainForm".

3. Open a new macro and enter the following action (Close and save the

   macro as "Macro1"):

     Action        Argument

     -----------------------

     RunCode       ChangeAccessCaption("<Your Custom Caption Here>")

4. Open a new module, and enter the following declarations:

      Option Explicit

      Declare Function GetParent% Lib "USER" (ByVal hwnd%)

      Declare Sub SetWindowText Lib "USER" (ByVal h%, ByVal lpstr$)

5. On the next line in the module, type the following and press enter:

      Function ChangeAccessCaption(Caption as String)

6. This will allow you to enter the code for the ChangeAccessCaption

   function. Enter the following:

      Function ChangeAccessCaption (Caption$)

         Dim X%

         Dim hParent%

         ' Here's an example of how to set the caption bar in Access.

         DoCmd OpenForm "MainForm"            'Open the main startup form...

         X% = Forms!MainForm.hwnd             'Get its handle...

         hParent% = GetParent(GetParent(X%))  'Get the forms parent...Access

         Call SetWindowText(hParent%, Caption$)

      End Function

7. Save the module as "Module1".

8. After closing and saving the module, run Macro1. The Window title

   for the Microsoft Access window should change to the text you specified

   as the function parameter in step 3.

References


PRB:  GoToRecord Macro Doesn't Work on Subform

 Article Number: Q92685

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you create a GoToRecord macro that points to a subform and run that

   macro from the main form, you get the following error message:

      Object 'Subform Name' isn't open

  (Where 'Subform Name' is the subform that you specified in the GoToRecord

   macro)

STATUS

   This behavior is by design.

RESOLUTION

   Use a GoToControl macro and specify the subform, then use the

   GoToRecord action to specify the specific record within the subform.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open NWIND.MDB and create the following macro:

      Macro Name     Condition     Action

      -----------------------------------

      Macro1                       GoToRecord

      Macro1 Actions

      -----------------------------------

      GoToRecord

         Object Type: Form

         Object Name: Categories Subform

         Record: Next

2. Open up the Categories form and from the File menu,

   choose Run Macro, then select Macro1. You will get the

   following error message:

      Object 'Categories Subform' isn't open

3. Now change Macro1 to the following:

      Macro Name     Condition     Action

      -----------------------------------

      Macro1                       GoToControl

                                   GoToRecord

      Macro1 Actions

      -----------------------------------

      GoToControl

         Control Name: Categories Subform

      GoToRecord

         Record: Next

Run the macro in the same way as above. The macro will go to

the second record in the Categories subform.

References


PRB: Opening a Database Read Only Forces Others to Read Only

 Article Number: Q92686

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you open a database as Read Only, all other users attempting to

   open the same database as Exclusive are forced to open it Read Only

   also. This applies to multiple copies of Microsoft Access running on

   one workstation as well as the multi-user environment.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open Microsoft Access and open the NWIND database with Read Only

   selected and Exclusive not selected.

2. Minimize the first instance of Microsoft Access and start a second

   instance of Microsoft Access.

3. In the second instance of Microsoft Access, open the NWIND database

   with Exclusive selected and Read Only not selected.

Result: the database opens as Read Only, even though the Read Only

flag wasn't selected.

Work Around

-----------

To override the database opening in Read Only mode, do not select

Exclusive when opening the second instance.

References


PRB: Report or Form Bound to a Table Locks the Table

 Article Number: Q92687

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You may receive the following message when you try to open a table

   in Design view:

      Can't open table 'table name' for modifications. Open it read-only?

   This message occurs by attempting to open a table in design view when

   the table is the record source for a form or report, and one of the

   following conditions is also true:

   1. A report is opened in Print Preview or a form is opened in Browse

      view that has the same record source, or is based on a query

      with the same record source.

   2. A form is opened in Browse view first and then switched to Design

      view.

   3. A report is opened in design view, then switched to Print Preview

      and back to design. (You cannot switch to design view if you opened

      the report in Print Preview first.) This message does not occur when

      opening the form or report in Design view first, (without ever

      switching to Browse view or Print Preview), and then opening the table

      in Design view.

STATUS

   This behavior is by design.

More Information:

You must close the Form or Report window to be able to open the table

in Design view to allow changes. Search in Help for "error messages:

reference" for more information regarding this error.

References


INF: Setting a Default Value to The Last Record Entered

 Article Number: Q92688

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes a technique to set a control's default value to

the last entered value.

More Information:

This technique is a two-step process:

1. Create a hidden control on the form.

2. Use the SetValue macro in the OnEnter and OnExit Properties of the

   control whose default value you want to change.

Example

-------

For example, if you have a form (Form1) and you want to set a control

on that form (Control1) to the last value that was entered,

1. Create another control, HiddenControl2, and set its Visible

   property to No (hidden).

2. Create two Macros, Macro1 and Macro2:

      MacroName       Action

      ---------------------------------------------------

      Macro1          SetValue

      Macro2          SetValue

      Macro1 Actions

      ---------------------------------------------------

      SetValue

         Item:  Forms![Form1]![Control1]

         Expression:  Forms![Form1]![HiddenControl2]

      Macro2 Actions

      ---------------------------------------------------

      SetValue

         Item:  Forms![Form1]![HiddenControl2]

         Expression:  Forms![Form1]![Control1]

3. Set the following properties:

      Control1

      ---------------------------------------------------

      OnEntry: Macro1

      OnExit: Macro2

Reference(s):

"Microsoft Access User's Guide," version 1.0, chapter 9, "Designing

Forms," pages 224-227

"Microsoft Access User's Guide," version 1.0, chapter 22, "Using

Macros with Forms," pages 538-541

References


INF: Queries Sort by Order of IN() Parameters

 Article Number: Q92689

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

If you use the IN() operator in an unsorted query, the output will be

grouped on the associated field. In addition, Microsoft Access will place

the groups in the same order as the parameters are listed in the IN()

operator.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a table with Firstname and Lastname fields (data type

   "text"). Enter the data listed below:

      JOE    SMITH

      JANE   DOE

      ABE    LINCOLN

      JOHN   DOE

2. Create a query on this table.  In the Criteria for Lastname, type:

      IN("LINCOLN","DOE")

   The query will generate these records:

      ABE    LINCOLN

      JANE   DOE

      JOHN   DOE

You can have the records appear in a different sequence by changing

the order of the parameters in the IN() operator, or you can

explicitly specify a SORT order.

References


INF: Limit of AND's in SQL Select Statement

 Article Number: Q92690

 CREATED: 12-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

There is an undocumented limit on the number of ANDs you can use in

a SQL Select statement. The limit is 40 for the Where clause and 40

for the Having clause. Microsoft Access returns the following error

message when you exceed this limit:

   Out of Memory

References


INF: Unsupported SQL Keywords Not Listed in Access

 Article Number: Q92691

 CREATED: 12-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

In Appendix C of the "Microsoft Access User's Guide", there is a list

of all SQL keywords that are supported in Microsoft Access version

1.0. However, there is no list of SQL keywords that are not supported

in Microsoft Access version 1.0.

More Information:

There are over 200 ANSI SQL keywords that Microsoft Access does not

support. Rather than list them all, only the supported keywords are

listed in Appendix C.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Appendix C,

"Expressions", pages 649-650, 655-656.

References


INF: Pasting Columns to the Clipboard in Access

 Article Number: Q92692

 CREATED: 12-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

It is not possible in Table Datasheet Browse/Edit mode to select a

column of data and copy it to the clipboard, as you can in Microsoft

Excel.

There are, however, other ways to change or rearrange data without

copying to the clipboard. This article gives three likely scenarios

where you might want to change or rearrange data, and techniques to do

it.

More Information:

Scenario A

----------

If your purpose is to rearrange the order of the columns, there is no

need to cut-and-paste. To rearrange columns:

   1. Select the column using the column indicator.

   2. Then, drag the column to the desired position, and release it.

For more information, search Help on "Column Width (datasheets)" and

read "Changing a Datasheet's Appearance." Also, read "To Move a

Column" in the Microsoft Access User's Guide, Chapter 14: "Adding and

Editing Data."

Scenario B

----------

If your purpose is to add an additional column to an Access table, you

must run an Update Query. If you are also adding new records, you must

run an Append Query (step 3 below) before running the Update Query.

The steps below assume two tables, Master and ExtraInfo (data shown in

the example below.) To copy information from ExtraInfo to Master:

1. Create ExtraInfo and Master to have the same primary key.

2. Manually add the new column names from ExtraInfo to Master. Make

   sure they are the same data type. They don't have to be the same name

   as the corresponding fields in ExtraInfo, but it saves a lot of typing

   if the names are the same.

3. (Skip this step if ExtraInfo contains only records that exist in

   Master.) Use ExtraInfo to create an Append Query. Specify Master as

   the destination table. You must make sure that the Unique Values

   query property is checked. Add all the field names from ExtraInfo

   to the QBE grid. If the field names are spelled correctly,

   Microsoft Access will automatically fill in the Append To field

   with the name of the correct field from Master. If not, you must

   select the Master fieldname manually in the Append To field. Run

   the Query. New records will be appended to Master from ExtraInfo.

   Other records in ExtraInfo will be processed by the Update Query

   in the next step.

4. Create an Update Query that contains both Master and ExtraInfo.

   Join the two tables by dragging the key field from Master to

   ExtraInfo. Drag the new fields from Master and drop them onto

   the QBE grid. You must type the [ExtraInfo]![<fieldname>]

   manually into the Update From field. Run the query to update

   the new fields in existing Master records.

EXAMPLE for Scenario B

----------------------

1. Create two tables called MASTER and EXTRAINFO. The MASTER table has

   two fields: KEY and ITEM1. The EXTRAINFO table has two fields: KEY and

   ITEM2. Add data as follows:

      MASTER:  KEY   ITEM1          EXTRAINFO:  KEY   ITEM2

                 1   AAAAA                        1   11111

                 2   BBBBB                        3   33333

2. Now, open MASTER in Design view and add the field ITEM2. It should

   look like this:

      MASTER:  KEY   ITEM1   ITEM2

                 1   AAAAA

                 2   BBBBB

3. Create a new query. Add ExtraInfo to the query & close the Add

   Table dialog box. Select Append... from the Query menu. Choose

   Master as the table to append to. Also make sure that the Unique

   Values setting is checked. Drag the KEY field and the new field,

   ITEM2, into the QBE grid. Microsoft Access will fill in the Append

   To field names. Run the query. Microsoft Access will respond "2

   rows will be appended." Press OK. Microsoft Access will respond

   with a message stating that "1 record(s) were lost due to key

   violations" (This is OK. The record with Key=1 couldn't be

   appended. This will be taken care of by the Update Query). Press

   OK. Master should now look like this:

      MASTER:  KEY   ITEM1   ITEM2

                 1   AAAAA

                 2   BBBBB

                 3           33333

4. Create a new query. Add both ExtraInfo and Master to the

   query & close the Add Table dialog box. Join the tables by

   dragging the KEY field from ExtraInfo to Master. A line will

   connect the two tables. Select Update from the Query Menu.

   Drag the new field, ITEM2 from Master into the QBE grid.

   Type [ExtraInfo]![ITEM2] in the Update From position. Run the

   query. Microsoft Access will respond "2 rows will be updated."

   Press OK. Master should now look like this:

      MASTER:  KEY   ITEM1   ITEM2

                 1   AAAAA   11111

                 2   BBBBB

                 3           33333

For more information on Append and Update queries, search Help on

"Appending Records to a Table", "Update Queries, Updating Records as a

Group", and "Joins, Joining Tables in a Query." Also, look in the

Microsoft Access User's Guide under "Appending Records" and "Updating

Tables" in chapter 7, and "Creating Multiple Table Queries" in chapter

6.

Scenario C

----------

If your purpose is to copy a column of data from Access to another

application, such as Microsoft Excel, try one of the following

methods:

1. Use Copy & Paste to transfer the records you desire. Then delete

   the unwanted columns in Excel.

2. Use the Hide Columns command from the Layout menu to suppress the

   columns that you do not want copied. Then use Copy & Paste to

   transfer the records that you desire. You must Unhide each column

   individually.

3. Create a Query that contains only the columns that you want. Then

   use Copy & Paste to transfer the records that you desire. This last

   method is useful if you plan to do this on a regular basis.

For more information, search Help on "Copy Command."

References


INF: Inconsistent Save and Save As Menus with Forms

 Article Number: Q92693

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

With a Form open in Design view, the File menu has options for Save

and Save As. With a Form open in Form view or Datasheet view, the File

menu has options for Save Form and Save Form As.

More Information:

These options are available so that the user will be less likely to

think that saving the Form while in Form view or Datasheet view will

save the actual data displayed at that time. While in Design view, no

data is displayed, and it is clear that saving the Form will not save

any data from the form's dynaset. In all the cases, only the

information which defines the Form itself will be saved by choosing

either save option from the File menu.

References


INF: Using TransferDatabase to Export to Btrieve Format

 Article Number: Q92694

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

According to the online Help for the TransferDatabase Action, it is

not necessary to have a Database Name entry in order to export to

Btrieve format. This is incorrect.

The third paragraph under "Database Name" should read:

   For Btrieve databases, enter the path and file name (FILE.DDF)

   of the Xtrieve dictionary file for the Btrieve database. If the

   path you specify doesn't contain an Xtrieve dictionary file,

   Microsoft Access will create a dictionary file. This is a

   required entry. If you don't know the location of an Xtrieve

   dictionary file, enter a space <using the spacebar> and

   Microsoft Access will create this file for you.

More Information:

You must physically enter either a space or an invalid path before

Microsoft Access will create a dictionary file for you. An Xtrieve

dictionary file is required when exporting a table to Btrieve format.

References


PRB: Fields on Popup not Editable when Access is Minimized

 Article Number: Q92695

 CREATED: 12-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   When you minimize the Microsoft Access program window and a Microsoft

   Access popup form is displayed, you are unable to place a cursor in an

   editable field on the popup form, and as a result, cannot edit its

   contents.

STATUS

   Microsoft is researching this problem and will post new information here

   as it becomes available.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a form with a Text Box and a Command Button on it, set the

   form's Popup property to Yes, and save the form as MinPop.

2. Create a macro with the following macro actions (save this macro

   as MinPop):

      Actions

      -------------------------

      SendKeys

         Keystrokes: "%n"

         Wait: Yes

      OpenForm

         Form: MinPop

3. Run the macro MinPop.

When you run the macro Minpop the Microsoft Access program window is

minimized and the MinPop form is displayed. When you click on the text

box to edit or tab to it, no cursor is displayed and you are unable to

edit or enter data in the text box. If you restore the Microsoft

Access program window while the MinPop form is displayed, you then are

able to click on the text box, see the cursor, and edit the field.

Reference(s):

"Microsoft Access Language Reference" version 1.0, pages 348-351,

and 432-435.

References


PRB: Disabled Buttons Not Visible with ATI 1280x1024

 Article Number: Q92701

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When using an ATI Ultra Card with the ATI 1280x1024 driver,

   disabled buttons within Microsoft Access are not visible. This does

   not apply to push buttons that you create on a form, only with buttons

   that are part of Microsoft Access.

RESOLUTION

   Using a video driver supplied with Microsoft Windows will remedy this

   problem.

More Information:

This occurs only with Microsoft Access buttons and not with

user-created buttons because the "text" of the two types of buttons

are different. With Microsoft Access buttons, the text is actually

text and with user-defined buttons the text is actually a bitmap.

The ATI Video driver is manufactured by a vendor independent of

Microsoft; we make no warranty, implied or otherwise, regarding this

product's performance or reliability.

References


INF: Status Bar Text Too Long for Auto Repeat Property

 Article Number: Q92702

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

When you select the Auto Repeat property for a push button, the text

that appears in the status bar can get cut off if you are using a

display mode that is less than VGA. The text that appears in the

status bar should read:

   Run macro specified in OnPush property repeatedly while button is

   pressed?

References


PRB: Alt+ Any Key Combination Does Not Work With Active Popup

 Article Number: Q92703

 CREATED: 12-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

SYMPTOMS

   When a Microsoft Access popup window is active in Form Browse, pressing

   any ALT+key combination to access the menu bar does not work.

RESOLUTION

   Use the mouse instead of the keyboard to access the menu bar.

More Information:

Currently, when a popup window is active, pressing any of the

ALT+key combinations will not pass any function to the system

menu bar, only to the current active window.

Steps to Reproduce Behavior

---------------------------

1. Run Microsoft Access and open NWIND.MDB.

2. Select the Forms command from the View menu.

3. Open the "Add Products" form into Design mode.

4. Select the Properties command from the View menu. The property sheet

   will be displayed.

5. Pressing ALT+F to access the menu File option does not work.

References


INF: CueCards Started Outside Access Does Not Work

 Article Number: Q92706

 CREATED: 12-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

When you select the Microsoft Access Help Icon without having

Microsoft Access started and then try to run any topic from the Cue

Cards menu, you are returned to the Program Group without any error

message.

More Information:

This is a limitation of WinHelp's ability to call and respond to DLLs.

Steps to Reproduce Behavior

---------------------------

1. From Microsoft Access Program Group open Microsoft Access Help Icon

2. Select Cue Cards.

3. Select any Cue Cards topic.

Result: You are returned to the Microsoft Access Program Group without

any error message.

References


INF: Form View Allowed When ViewsAllowed Set to Datasheet

 Article Number: Q92709

 CREATED: 12-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

If you create a form and set the ViewsAllowed property to

Datasheet, you can still open the form in Form View.

More Information:

The DefaultView property in Microsoft Access specifies how to open

the form, while the ViewsAllowed property determines what you can do

once the form is opened. ViewsAllowed determines whether users can

switch between Datasheet View and Form View by choosing either the

Form or Datasheet command from the View menu.

References


PRB: Out of Disk Space Error Makes Paradox Table Unusable

 Article Number: Q92739

 CREATED: 15-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When working with a Paradox table in Microsoft Access you receive the

   following error message if you run out of disk space:

      Out of Disk Space

   You continue to get the same error message even after you remedy the

   problem by freeing up disk space.

RESOLUTION

   To correct this problem:

1. Delete the attachment to the remote Paradox table by highlighting

   the table name in the table list and pressing the DEL key.

2. Rename the table (xxx.DB) and its index (xxx.PX) to some other

   names.

3. Recreate the attachment, then try attaching to the remote Paradox

   table again.

References


PRB: Help Gives Error Importing File From Floppy Disk

 Article Number: Q92740

 CREATED: 15-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Pressing F1 for help, after importing a file from a floppy disk

   drive, results in a System error:

      Cannot read from drive A:.

CAUSE

   This problem is caused by a bug in the Microsoft Windows Help engine

   (WINHELP.EXE) and, as a result, manifests itself in several products,

   such as Microsoft Word for Windows.

RESOLUTION

   To avoid this problem, change the selected drive in the import dialog

   box back to a fixed-disk drive before closing the dialog box.

STATUS

   Microsoft has confirmed this to be a problem in WINHELP.EXE. We are

   researching this problem and will post new information here as it

   becomes available.

More Information:

Steps to reproduce behavior

---------------------------

1. Import a database file from a file on floppy disk (such as drive

   A:).

2. Close the Import dialog box.

3. Remove the disk from drive A:.

4. Press F1 for help. You receive the error message:

       Cannot read from drive A:

References


PRB: Choosing a New Printer Resets Some Printer Settings

 Article Number: Q92741

 CREATED: 15-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 10012

SYMPTOMS

   Microsoft Access retains certain printer settings with Form and

   Report objects. However, if you select a new printer in the Print Setup

   dialog your Orientation, Paper and Option settings change to the

   default values.

CAUSE

   This functionality is controlled by the Windows Common Dialog DLL

   (Dynamically Linked Library.)

STATUS

   This behavior is by design.

References


INF: Planning Database Security

 Article Number: Q92742

 CREATED: 15-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

There are two things to remember when dealing with security:

1. Plan your security scheme from the beginning.

   Planning a good security scheme from the beginning will ensure you a

   minimum of work in the future.

2. Assign permissions to Groups, NOT to Users.

   This is very important. By creating appropriate, well thought out

   groups, a user has the "best" permissions of the groups that (s)he is

   a member of. (For example, if a user is member of Group A, which does

   not have permissions to an object but also is a member of Group B,

   which does have the permissions to an object, the user will have Group

   B's permission to the object.)

   You will find that maintenance work will decrease significantly if

   you plan your groups carefully. A typical database setup should have a

   maximum of 4 to 5 groups. This is not a maximum number of groups

   limitation for Microsoft Access, merely a guideline for easier

   security management.

At this time there is no multi-selection functionality in the security

dialogs. There is no way can you give a group or user permissions to

more than one object at the time; each object must be selected

individually and then permissions may be assigned.

More Information:

User Name Case Sensitivity

--------------------------

User and group names are not case sensitive when you enter them to start

a Microsoft Access session. However, if you are recreating a user

account or group you have to match the name exactly. This is due to the

way the account information is stored by the system.

Note: Passwords are case sensitive.

Reference:

"Microsoft Access User's Guide," version 1.0, chapter 25,

"Administering a Database System."

References


PRB: No Error Given When Linked OLE Object Can't be Found

 Article Number: Q92745

 CREATED: 15-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 14062

SYMPTOMS

   Microsoft Access does not warn you if you close an OLE server

   without saving a linked embedded object.

STATUS

   This behavior is by design.

More information:

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Excel.

2. In SHEET1 enter data in several cells, select and then copy them to the

   clipboard.

3. Start Microsoft Access.

4. Open a new form and choose Paste Link to create a linked embedded

   object.

5. Switch back to Excel and close SHEET1. DO NOT save the changes.

6. Switch back to Access and double-click on the linked embedded

   object.  Excel comes to the foreground; the hourglass is displayed;

   and Excel is then closed.  There is no error message displayed.

References


INF: Exporting Table to Excel Does not Set 'Database' Name

 Article Number: Q92746

 CREATED: 15-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

When you export a table from Microsoft Access to Microsoft Excel,

the defined name "Database" is not set in Excel.

More Information:

To use the exported data as a Microsoft Excel database, the database

range must be set manually in Excel. This can be done by highlighting

the entire set of data, including the first row of labels, and

choosing Set Database from the Data menu.

For additional information on interaction between Microsoft Access and

Microsoft Excel, query in the Knowledge Base for the following keywords:

   Access AND Excel AND database AND biff

Note: BIFF is the Microsoft Excel Binary Information File Format.

References


INF: Count() Ignores Null Values

 Article Number: Q92747

 CREATED: 15-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

NULL values are ignored when using a query to perform a count.

More Information:

Steps to reproduce behavior

---------------------------

1. Create Table1 with two text columns as follows:

      Column1    Column2

      -------    -------

       foos

       ball

       foosball   junk

       null

       notnull    junk

2. Open a new query based on Table1.

3. From the View menu, choose SQL. Enter the following SQL query:

      SELECT Column2, COUNT(Column2)

      FROM Table1

      GROUP BY Column2;

4. Run the query. The result of the query is:

      Column2    Count(Column2)

      -------    --------------

                       0

       junk            2

Workaround:

To count NULL values, count on a primary key column, a column that

contains unique values, a counter column, or a dummy column where all

records equal 1.

The new SQL statement would read:

   SELECT Column2

   COUNT(PrimaryKey)

   FROM Table1

   GROUP BY Column2;

Reference(s):

On-Line Help, search on "Count" and select the topic "Calculating

Totals in a Query" and "Count Function" for more information.

References


INF: Hints for Printing Mailing Labels

 Article Number: Q92807

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

The Microsoft Access ReportWizard for mailing labels makes it quick

and easy to create a report design for many standard mailing labels.

However, sometimes you may have difficulty getting the labels to print

correctly on your printer. Here are some hints and suggestions for

getting labels to print.

More Information:

The Microsoft Access ReportWizard for mailing labels creates report

specifications for standard mailing labels. However, in order to do

so, it makes some assumptions about your printer which may not be

true. In particular, it assumes that it can print within a certain

distance of each edge of the paper. Every Windows print driver can

have a different "printable region," which is the rectangle on the

printed page that the application can print into. This rectangle may

be smaller than the rectangle that the physical printer can print, due

to space and efficiency considerations in the print driver. Therefore

you may not be able to print labels as close to the edge of the paper

as you would like.

In general, the ReportWizard assumes that it can print within .25 inch

of the edge of the paper. If you find that some of the text in your

labels is getting cut off or is not getting printed at all, try going

into design mode for the report and moving text items until all of the

text prints. For example: Select all the controls and move the entire

group down a little within the Detail section to adjust for a top

label being missed. You may have to make the items smaller, choose a

smaller font, and move them closer together to get everything to fit

without having the label cut off at either the top or the bottom of

the printed page.

If your printer has such a large top margin that you can't move your

text items down far enough (or if doing so results in a visually

crowded label), the next thing to do is change the Print Setup margins

so that the first label on each page is not used. To do this, choose

Print Setup and add the height of your labels to the top margin

provided by the ReportWizard. For example, if you are using 1 inch

labels, and the top margin is .03 inch, change it to 1.03 inches to

skip the first label on the page. If you are having trouble with the

last line of the last label getting cut off, you can use the same

technique on the bottom margin to cause the last label on the page to

be skipped.

Another common problem is that some labels come on sheets that are 12

inches tall, whereas the print driver only knows about 11 inch paper.

In this case, you must ignore the last label on the page and use the

labels that fall within the first 11 inches.

References


PRB: QBE Grid Disappears on Highlight and Delete

 Article Number: Q92808

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The Query By Example (QBE) grid, which displays when you enter

   design mode for a query in Microsoft Access, disappears if you

   highlight the grid by clicking on the query grid's column header and

   drag across to the end of the query grid, then select Delete from the

   Edit menu.

CAUSE

   Microsoft Access deletes the grid columns instead of clearing the

   contents of the columns when you highlight a whole column, or an

   entire grid, and then select Delete from the Edit menu.

RESOLUTION

   To get a blank query grid column to display after the grid has

   disappeared, choose Insert Column from the Edit menu.

   To get a column already filled with field information to display,

   click on a field name in one of the field lists displayed in the top

   portion of the query design window, then drag the field to the query

   grid portion of the query design window, or double-click on the field.

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 92-100

References


INF: RunApp Action Command has 255 Character Argument Limit

 Article Number: Q92809

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

The RunApp action for macros allows 255 characters.

More Information:

MS-DOS has a 127 limit on command line arguments, but Microsoft Access

allows up to 255 characters for the RunApp macro action. This is by

design, because there is a 127 character limit for the program name

and path, but there is a 127 character limit for the list of arguments

to the program. The two argument lists add up to the allowed 255

characters.

References


PRB: BeforeUpdate Macro Executing Twice

 Article Number: Q92810

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The BeforeUpdate macro appears to be executing twice, rather than

   only once.

CAUSE

   The BeforeUpdate macro will execute whenever an edited record is

   saved. And if you add records using the Paste Append command, it

   will execute when each of those records is added. If you find that

   the BeforeUpdate macro is executing more than once, check to see

   exactly what actions you are taking.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

 1. Create a macro with a MsgBox action and then a CancelEvent action.

 2. Save this macro as Macro1.

 3. Create a bound form with text boxes.

 4. Set the form's BeforeUpdate property to Macro1.

 5. Switch the form from Form Design view to Form view.

 6. Enter data in a field, then select the data in that field.

 7. From the Edit menu, choose Copy.

 8. From the Edit menu, choose Paste Append.

 9. Choose the OK button when the Message box (that you created in

    Macro1) appears.

10. Close the form.

11. Choose the OK button when the Message box (that you created in

    Macro1) appears.

12. Choose the OK button when the following error message appears:

       The record being edited can't be saved. If you close the form,

       the changes you've made to the record will be lost. Close

       anyway?

Note that the message box you created in Macro1 reappeared in step 11.

The macro that you assigned to the BeforeUpdate property is executing

twice: when the record that you added using the Paste Append command

is saved, and when when the edited record is saved.

Reference(s):

Microsoft Access Help, "BeforeUpdate, AfterUpdate Properties" topic

References


PRB: Can't db.OpenTable With Only Read Definition Permission

 Article Number: Q92811

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 13813

SYMPTOMS

   When you have only Read Definition permissions on a table,  you are

   unable to open the table in order to examine the table definition from

   Access Basic. The following error message appears:

      No permission for 'Tablename'

CAUSE

   The table cannot be opened from Access Basic when you have only

   Read Definition permission. You should give users Read Data

   permission for the table if they need to examine the table definition

   via Access Basic.

   A user with Read Definition permission can manually only look at

   the table definition by opening the table in design mode as read only

   via the User Interface (UI).

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce the Problem

------------------------------

1. Open a new database and create a table called Table1.

2. Add a new user named "Joe" and give this user Read Definition

   permission only on Table1.

3. Exit Microsoft Access, restart Microsoft Access and logon as Joe. (Be

   sure you have removed all permissions from the group Users since everyone

   who logs on to Microsoft Access is a member of the group Users.)

4. Enter the following code in a new Module:

      Option Explicit

      Sub Test ()

         Dim Mydb As Database

         Dim MyTable As Table

         Set Mydb = CurrentDB()

         Set MyTable = db.OpenTable("Table1")

         MyTable.MoveFirst

         MyTable.Close

         Mydb.Close

      End Sub

5. Run this sub by typing 'test' in the immediate window. The following

   error message is displayed:

      No permission for 'Table1'.

References


PRB: Cannot Use DoMenuItem for Open Database or New Database

 Article Number: Q92812

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 13744

SYMPTOMS

   If you use the macro command 'DoMenuItem' to open or create a new

   database, the database is not opened or created, and no error message

   is shown. Attempting to open a database brings up the File Open dialog

   box; however, the database you select in this dialog is not opened.

CAUSE

   When the macro attempts to open/create another database, Microsoft

   Access tries to close the current database, then detects that a macro

   is still executing from the currently open database and, as a result,

   does not close the database.

STATUS

   This behavior is by design.

RESOLUTION

   You can have only one database open at a time in the Database Window.

   (If you need to open more than one database at a time, you can use

   Access Basic.) It is possible to close a database via a macro since

   the close is the final action in the macro. The database from which

   the macro is running would have to be closed before a new database is

   opened. The close action could not be followed by an open/create

   action because the database that contains the code to open/create has

   already been closed.

More information:

Steps to reproduce behavior

---------------------------

1. Create the following macro:

   Action

   ------

   DoMenuItem

   Arguments

   ---------

   Menu Bar: Database

   Menu Name: File

   Command: New Database

2. Run the macro. No database is opened and no error message is

   given.

References


PRB: Column Widths in Table Design not Saved

 Article Number: Q92813

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 1124

SYMPTOMS

   The browse mode column widths of the table are automatically

   saved by Microsoft Access. When working on tables in design

   mode, however, changes made to the design mode grid's column

   widths are not saved when the form is closed.

CAUSE

   Microsoft Access does not currently support saving the column

   width of the design mode grid for a table.

STATUS

    This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open a table in design mode.

2. Adjust the column width of "field type" (or one of the

   other columns.

3. Exit the table.

4. Return to the table in design mode and notice that the

   width has returned to its original state.

References


PRB: No Error Msg When BoundColumn Greater Than ColumnCount

 Article Number: Q92814

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 6718

SYMPTOMS

   The default value for the ColumnCount and BoundColumn properties of

   List Boxes and Combo Boxes is "1". If you change the BoundColumn

   property to a number that is greater than the number of columns

   (ColumnCount), you do not get an error message.

CAUSE

   Microsoft Access does not enforce any error checking at this point

   of form or report design. Otherwise, you would always have to enter

   the correct column count before entering the bound column number.

STATUS

   This behavior is by design.

RESOLUTION

   When using List or Combo Boxes, check to ensure that the BoundColumn

   property setting is an integer between 0 and the number set by the

   ColumnCount property.

   For more information, search for "ColumnCount" and "BoundColumn" using

   the Microsoft Access Help menu.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 239-241

References


INF: Using the Generic Print Driver with Forms/Reports

 Article Number: Q92815

 CREATED: 16-NOV-1992

 MODIFIED: 20-MAY-1993

Summary:

One way to get Microsoft Access output from forms or reports into a

text file is to use the Windows Generic print driver and print to a

file. However, using the Generic print driver (TTY.DRV) can be a

little tricky. Listed below are some hints on how to set up your forms

and reports for the Generic print driver.

More Information:

The Windows Generic print driver simulates a line-oriented printer

with a fixed pitch font, like a TTY device or a line printer. Because

of this, it can only print text, and it can only position the text on

a grid that is 10 characters per inch in the horizontal direction and

6 lines per inch in the vertical direction. (By contrast, most Windows

print drivers can position text on any pixel position.)

This means that any form or report using the Generic print driver to

create a text file should be layed out so that everything lines up

with this character grid.

Here are some considerations for the form/report layout:

- Ensure that each section of your report has a height that is

  an integral multiple of 1/6".

- Lay out the text items in your report such that each falls on 1/6"

  boundaries.

- Since the default hardware font for most printers is a Courier

  10cpi font, you should set the font for all of your text items to be

  Courier 10.

- Don't use Bold fonts, as they will appear three times in your output.

  (The Generic driver simulates bold text by overstriking.)

Here are some problems that frequently occur when using the Generic

print driver to do text output:

- Blank lines appear in the output -- text items or sections are slightly

  farther apart than 1/6".

- Overlapped lines appear in the output -- text items or sections are

  slightly closer together than 1/6"

- Text appears three times in the output -- text is formatted as

  Bold.

References


INF: Converting Julian Dates with Access Basic

 Article Number: Q92816

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

Most government agencies and contractors require the use of Julian

dates. (A Julian date starts with a two-digit year, then counts the

number of days from January 1, as printed on many desktop calendars.)

Microsoft Access does not have any built-in functions for using or

converting Julian dates to standard dates. However, you can write a

function in Access Basic to do this. Below is an Access Basic function

which converts a Julian date to a standard serial date in Microsoft

Access. Note that the following sample code assumes the year is in the

20th century. The code must be changed to process dates after the year

2000.

More Information:

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

Before attempting the examples below, create a new module and enter

the following function:

    Option Explicit

    Function ConvertJulian (JulianDate as Long)

       ConvertJulian = DateSerial(1900 + Int(JulianDate / 1000),_

                        1, JulianDate Mod 1000)

    End Function

Example1

--------

1. Create a new unbound form and add two unbound text boxes (called

   field0 and field2) to the form.

2. In the Control Source property of field2 type:

      =ConvertJulian([field0])

3. Go to form view and enter 90001 into the first text box. The Julian

   date is converted into a normal date and displayed in the second text

   box.

Example2

--------

1. In Microsoft Access, create a table called Table1. Make one field

   named "Julian", data type "Number".

2. After saving the table, go to Datasheet View and enter the

   following numbers in the Julian field:

      90001

      90010

      92100

3. Create a new query based on Table1 and drag the Julian field into

   the query grid.

4. In the Field row of another column of the query grid, enter the

   following:

      Normal: ConvertJulian([Julian])

5. Go to Datasheet view. The Julian dates are converted into normal

   m/d/y dates.

References


INF: Initial Size of Every MDB File is 64K

 Article Number: Q92817

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

The initial size of every .MDB file is 64K. Microsoft Access allocates

additional space in 16 page blocks (2K per page x 16 = 32K).

More Information:

The initial size of every .MDB file is 64K, (32 pages). If more space

is needed, the additional space is allocated in 16 page blocks. The

reason for using 16 page blocks, as opposed to smaller blocks of disk

space, is to prevent excessive disk fragmentation.

References


PRB: 'No Default Printer' Error Message When Printing

 Article Number: Q92818

 CREATED: 16-NOV-1992

 MODIFIED: 29-APR-1993

Summary:

ISSUE ID: 7382

SYMPTOMS

   When you create a new report and no default printer is set in

   the Windows Control Panel, you get the error message:

      There is no default printer. Select or install one

      using the Windows Control Panel.

CAUSE

   Reports have a "Layout for print" property that defaults to "Yes",

   which enables the "Size to fit" option when designing reports or

   labels. This option uses the printer font metrics defined in the

   printer driver. When there is no default printer, Microsoft Access

   cannot calculate the layout.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. In Windows Control Panel, highlight your default printer and choose

   Remove.

2. In Microsoft Access, choose Report, then New.

3. Choose either Report Wizard or Blank Report.

You receive the error message immediately when you use the Blank

Report option. When you use the Report Wizard, you receive the message

after answering all of the Report Wizard information. By choosing OK,

you can continue creating the report.

References


PRB: Pressing HOME Key in Text Box Doesn't Move to Beginning

 Article Number: Q92819

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you type a great deal of text in a text box control, pressing

   the HOME key does not move you to the beginning of the text but

   does position the cursor at the beginning of the current line.

CAUSE

   Microsoft Access allows a maximum line length of 20 inches. If your

   data exceeds this length, or if you have entered a carriage return

   (CTRL+ENTER) in the text box, pressing HOME will not move you to

   the beginning of the data.

RESOLUTION

   In these cases, press CTRL+HOME instead of HOME.

More Information:

Both text boxes bound to text fields and those bound to memo fields

act the same with regard to the HOME and END keys.

References


PRB: A '#' Appears in Place of a '.' When Referring to a Filen

 Article Number: Q92820

 CREATED: 16-NOV-1992

 MODIFIED: 16-NOV-1992

Summary:

SYMPTOMS

   In some error messages which refer to file names, a '#' appears in the

file name in the error message in place of the period such as:

      Can't access file TEST#DBF

RESULT:

   You get the error message 'Can't access file TEST#DBF' instead of 'Can't

access file TEST.DBF'.

CAUSE

   A '.' is not a valid entry in the JET table, and as a result the

translated string that JET provides to Microsoft Access contains a valid

replacement character for the '.', namely the '#'.

RESOLUTION

   This is a known bug in Microsoft Access version 1.0.

References


PRB: Unable to Specify Label Order in Graph Form Wizard

 Article Number: Q92821

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 11641

SYMPTOMS

   The labels on a chart created using the Graph Form Wizard are not

   in order. No matter how you organize the underlying data, the

   labels always appear in alphabetical order.

CAUSE

   Microsoft Access has no way of knowing whether a text field contains

   date information or regular text information. The Graph FormWizard

   uses the SQL "Group By" clause, which defaults to alphabetically

   grouping text fields.

STATUS

   This behavior is by design.

RESOLUTION

   If you want to chart dates, store the underlying data for the form

   in date fields (as date/time data types). Then, when you tell the Graph

   FormWizard to GROUP, Microsoft Access will know to group date fields

   chronologically.

   If you want neither alphabetical or chronological grouping of

   labels, you will need to manually edit the ColumnHeads property for

   your graph. This property is available when the form is in Design

   mode.

More Information:

Steps to reproduce behavior

---------------------------

1. Create a table called Table1 with two fields: a text field called

   Text and a numeric field called Number.

2. Switch to Datasheet view and enter the following data in the order

   shown:

      Text      Number

      ----      ------

      Jan       5

      Feb       1

      Mar       2

3. Use the Graph FormWizard to create a new form based on Table1

The labels on your chart are in alphabetical, not chronological order.

Reference(s):

For more information, search for "Parameter Query," then "GROUP BY

clause (SQL)," then "graph labels," then "ColumnHeads" using the Help

menu.

References


PRB: One Side of Join Line Not Attached to Table

 Article Number: Q92822

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The join line in the QBE (Query by Example) grid is attached to

   only one table.

CAUSE

   The table is joined to another table that is currently positioned

   out of view on the Query window.

RESOLUTION

   Try maximizing the Query window or using the scroll bars to find

   the other table, and then move the second table closer to the first

   table.

STATUS

   This behavior is by design.

References


INF: Access Table with Time Field Exports Strangely to Excel

 Article Number: Q92823

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

A Microsoft Access table that has a Time formatted field displays a

strange date format when exported to Microsoft Excel. The Time column

on the spreadsheet displays the time as the date 1/0/00. This behavior

occurs because of the way Microsoft Excel interprets serial numbers.

To display the time correctly, apply a Microsoft Excel time format to

the affected information.

More Information:

Microsoft Access and Microsoft Excel both use serial numbers to

display dates and times. A Microsoft Access table that is exported to

Microsoft Excel automatically formats all serial numbers as dates. The

spreadsheet column of serial numbers simply needs the format changed

to time. To correctly display a time format, highlight the column of

dates on the spreadsheet. From the Format menu, choose Number, and

select one of the time formats (for example, hh:mm:ss AM/PM). The

time will now display correctly.

Reference(s):

Microsoft Excel Help, "Serial Numbers," "Date and Time Numbers"

References


INF: Custom Setup May Show Zero or Negative Disk Space Needed

 Article Number: Q92824

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

The amount of disk space required for each option does not display a

consistent number when running a custom installation.

More Information:

The setup program calculates and displays the total space that you

will need, it does not just display a flat number. If you already have

the same version installed the option will display a zero for required

disk space. If a previous version of one of the options was much

greater, the required disk space will display a negative number.  An

example of this would be if you added more data or objects to the

NWIND.MDB. In the Sample Apps Disk requirement you would notice a

negative number.

Steps to Reproduce Behavior

---------------------------

1. Run the setup program for Microsoft Access from Disk 1.

2. Choose Custom Installation.

3. Notice the required disk space for the options: some may

   be zero or negative.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Introduction, "Setting

Up and Starting Microsoft Access," pages vi-vii.

References


INF: How to Find Out If a Form Exists in a Database

 Article Number: Q92825

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

This article discusses how to obtain a dynaset containing the names of

all the forms in a database whether or not they are active.

This article assumes that the reader has some understanding of

programming with Access Basic and using recordset (Virtual Table)

objects.

More Information:

If you want to obtain a complete list of forms whether or not they are

active, you can create a dynaset that queries MSysObjects for all the

forms stored in the current database. MSysObjects stores the names of

every object in a database, and each record includes the type of

object represented by a code and stored in a field called Type. The

code that represents forms in the Type field is -32768. Given this

information, you can create a dynaset that obtains the names of all

the objects in MSysObjects that are forms:

   Dim D As Database, S As Dynaset

   Set D = CurrentDB()

   Set S = DB.CreateDynaset("SELECT Name FROM MSysObjects

                                              WHERE Type = -32768;")

After executing the code above, a dynaset called S is created. This

dynaset contains the names all the forms in the current user database.

You can then process the information as shown in the example below.

The procedure below accepts a form name and opens it if it exists in

the database, or presents a message indicating that it does not exist

in the database:

   Option Explicit

   Sub FormOpener (FormToOpen$)

      Dim D As Database

      Dim S As Dynaset

      Set D = CurrentDB()

      Set S = DB.CreateDynaset("SELECT Name FROM MSysObjects _

                    WHERE Type = -32768;")

      S.FindFirst "Name = '" & FormTopOpen$ & "'"

      If S.NoMatch Then

         MsgBox FormToOpen$ & " does not exist in this database"

      Else

         DoCmd OpenForm FormToOpen$

      End If

   End Sub

References


PRB: MS Access Short and Medium Time Formats Have Leading Zero

 Article Number: Q92826

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you use the "Short Time" and "Medium Time" Date/Time formats,

   a leading zero appears in your data.

STATUS

   This behavior is by design. To eliminate the leading zero, use a

   custom format, such as "h:mm am/pm."

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a Date/Time field.

2. Format it as Medium Time.

3. Type "4:57pm" (without the quotation marks).

4. Press TAB to leave the field.

The value you entered will be displayed as "04:57 PM".

References


PRB: Removing User Admin from Admins Group Can't Be Reversed

 Article Number: Q92827

 CREATED: 16-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you start Microsoft Access as the user "Admin" (which occurs by

   default) and then remove the user Admin from the Admins group, you

   will not be able to go back and make the user Admin a member of the

   Admins group during this session.

CAUSE

   As soon as you remove the user Admin from the Admins group, this

   change is written to the Microsoft Access system tables. At this

   point, the Admin user no longer has permission to add anyone to the

   Admins group, including itself.

RESOLUTION

   To add the user Admin back to the group Admins, you must log on as

   another user who is in the Admins group.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Change the password for the user Admin from blank to some nonblank

   password. (NOTE: This will allow you to bring up the Log On dialog

   box at the start of the next session.)

2. IMPORTANT: Create a new user and add this user to the Admins group.

   (There must always be at least one user in the group Admins.

   Remember that you are currently logged in as the user Admin.)

3. Remove the user Admin from the Admins group.

4. Try to add the user Admin back to the Admins group. You will

   receive the error:

      No permission for 'Admin'

5. Quit Microsoft Access and restart it.

   The Log On dialog box will appear because of the change you made in

   step 1.

6. Log on as the user that you created in step 2.

7. Add the user Admin back to the Admins group.

  Note: To disable the Log On dialog box, you must change the Admin

  password back to an empty string (do not enter any information in

  the New Password or Verify fields).

For more information on Admin, search on "Admin account" and

"password" using the Help menu.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 25,

"Administering a Database System."

References


INF: How to 'Freeze' a Record on a Form

 Article Number: Q92889

 CREATED: 17-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

This article outlines a method for retaining the focus on a particular

record so that any attempt to move out of that record fails, until an

AfterUpdate event is triggered. This ensures that the record is

updated before the user moves to the next record. You can then

programmatically "unfreeze" the focus of the record from some event on

the form to allow the user to move to another record.

More Information:

1. Create a new module and add the following line to the <Declarations>

   section:

      Option Explicit

      Global RecordIsLocked$

2. Add the following functions to the module:

      Function LockRecord ()

         If Len(RecordIsLocked$) Then

            Screen.ActiveForm.Bookmark = RecordIsLocked$

         End If

         RecordIsLocked$ = Screen.ActiveForm.Bookmark

      End Function

      Function UnLockRecord ()

         RecordIsLocked$ = ""

      End Function

3. Add the following entry to the OnCurrent event of the form which

   will utilize this functionality...

      =LockRecord()

4. Add the following entry to the control or form event which is to

   "unfreeze" the record:

      =UnLockRecord()

5. Save and Close the form and reopen it in Browse mode.

At this point, you will only be able to move to another record on the

form if the "unfreeze" event has occurred.

References


INF: Mail Label Wizard Shows Blank Line in Label Size List Box

 Article Number: Q92890

 CREATED: 17-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

In the Mailing Label ReportWizard, the Label Size list box has a blank

line at the bottom. This blank line shows on standard VGA and super

VGA monitors but does not show on model 8515/A monitors.

References


PRB: 'Invalid Range' Error When Importing Spreadsheet Range

 Article Number: Q92891

 CREATED: 17-NOV-1992

 MODIFIED: 22-APR-1993

Summary:

SYMPTOMS

   When you try to import a range of cells from a spreadsheet, you

   receive the following error message:

      Invalid Range.

   The Select File dialog box appears after the error message.

CAUSE

   You specified an invalid range of cells to import, either by

   improperly referencing them (for example, R0C0:R5C3) or by

   providing a nonexistent range name.

RESOLUTION

   Reselect the file that you want to import, and then choose Import

   from the File menu. When the Import Spreadsheet Options dialog box

   is displayed, make sure you type a valid range reference in the

   Spreadsheet Range box. This range can be a specific range of cells

   (for example, A5:B12 or R3C3:R50C9) or a defined name that refers

   to a range of cells on the spreadsheet (for example, MYRANGE).

STATUS

   This behavior is by design.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 4, pages 72-75

References


PRB: Concatenation of Memo Fields Creates Text Field

 Article Number: Q92892

 CREATED: 17-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 12754

SYMPTOMS

   When you use a Make Table query to concatenate two memo fields, the

   query concatenates the memo fields into a text field in the resulting

   table. This will result in the truncation of memo field data in the

   new text field if you have over 255 characters in the memo fields.

CAUSE

   Text fields have a limit of 255 characters, but memo fields can

   contain up to 32,000 characters.

RESOLUTION

   A workaround is to perform an Append query to an existing table with a

   memo field and concatenate the two memo fields into the existing memo

   field.

More Information:

The following are the SQL statements for the Make Table Query:

   SELECT DISTINCTROW

      [Memo1]&[Memo2]

   AS Concat

   INTO NewTable

   FROM OldTable;

The following are the SQL statements for the Update Query:

   INSERT INTO ExistingTable

      [ExistingField]

   SELECT DISTINCTROW

      [Memo1]+[Memo2]

   AS Concat FROM OldTable;

In these sample SQL statements ExistingTable and ExistingField are the

destination, and OldTable and Memo1 and Memo2 are the source.

The steps to generate the second set of SQL statements are:

1. Create a table with two memo fields:

      Table: OldTable

      ---------------

      Field Name: Memo1

         Data Type: Memo

      Field Name: Memo2

         Data Type: Memo

2. Create another table:

      Table: ExistingTable

      ---------------

      Field Name: ExistingField

         Data Type: Memo

3. Create a Query based on OldTable. From the Query menu choose

   Append (to ExistingTable). In the Query Grid place the following

   properties:

      Query: AppendQuery

      ------------------

      Field: Concat:[Memo1]+[Memo2]

         Append To: ExistingField

This generates the update SQL statement shown above.

References


INF: Internal Database Error (-1106) & Disk or Network Error

 Article Number: Q92893

 CREATED: 17-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

If you are connected to a Microsoft Windows for Workgroups server and

have a database from the server open on your workstation in Microsoft

Access, you may be disconnected by the server and receive error

messages from Microsoft Access.

The server can disconnect any client by using NetWatcher, a program

that comes with Windows for Workgroups. If you have been disconnected,

you will receive two separate error messages when you attempt to

browse a table from within Microsoft Access. The first message is:

   Internal database error (-1106).

When you choose the OK button in response to the first message, you

will receive this error message:

   Disk or Network error.

The second message is more informative in this case. You must

reconnect to the server on which the database is stored in order to

use the database.

More Information:

Steps to Reproduce Problem

--------------------------

1. Connect your machine (client) to a Windows for Workgroups server.

2. Start Microsoft Access on the client and open a database file

   located on the server.

3. Start NetWatcher on the server. (NetWatcher is in the Accessories

   group.) Disconnect the client from the server using NetWatcher

   (Connection-Disconnect).

4. From the client machine, the database still appears to be open.

   Select a table in the database window and attempt to browse the

   table.

You will receive the error messages shown above.

References


INF: Setup Options Dialog Box Lists Disk Space Info Twice

 Article Number: Q92894

 CREATED: 17-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

The Setup Options dialog box will be displayed during a Custom setup,

or during an Express setup with insufficient disk space for a full

installation. The bottom half of the Setup Options dialog box provides

disk information (space required and space available).

The bottom left side provides disk information about the drive that

you specified for Microsoft Access. The bottom right side provides

disk information about the drive that contains your Windows software.

If both Microsoft Access and Windows are located on the same drive,

the disk information displayed on the left side is also displayed on

the right side of the dialog box.

More Information:

The Setup Options dialog box is a common dialog box. The same dialog

box is opened for installations with Microsoft Access and Windows on

the same drive, and Microsoft Access and Windows on different drives.

In the former, the disk information for Windows is identical to that

for Microsoft Access.

Steps to Reproduce Behavior

---------------------------

 1. Run SETUP.EXE for Microsoft Access.

 2. Specify an installation path that is on the same disk drive as

    your Windows directory.

 3. Choose Custom Installation (Option 2).

 4. The Microsoft Access Setup Options dialog box will open. The

    bottom half of the dialog box lists Space Required and Space

    Available information twice.

 5. Cancel Setup.

The following steps are optional:

 6. Run SETUP.EXE for Microsoft Access.

 7. Specify an installation path that is on a different disk drive

    than your Windows directory.

 8. Choose Custom Installation (Option 2).

 9. The Microsoft Access Setup Options dialog box will open. The

    bottom half of the dialog box lists different disk information:

    one set of information for the Microsoft Access disk drive, and

    one set of information for the Windows disk drive.

10. Cancel Setup.

References


INF: CopyObject Appears to Copy Wrong Object

 Article Number: Q92895

 CREATED: 17-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

The macro command "CopyObject" always copies the currently selected

object from the Database window. When you precede this macro command

with a "SelectObject" command, set its "In Database Window" parameter

to "No", then run the macro from the Database window, the macro is the

selected object and the object copied.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a table and save it as "Table1".

2. Create the following macro and call it Macro1. Add the following

   actions:

      Macro1 Actions

      ------------------------------------------------

      SelectObject action

         Object Type: Table

         Object Name: Table1

         In Database Window: No

      CopyObject action

         New Name: Table2

3. Open and minimize the table Table1.

4. Select and run Macro1.

Result: Macro1 is copied to Table2, not Table1.

NOTE: If 'In Database Window' is set to 'Yes', everything works as

expected.

For more information, search for "SelectObject Action" using the Help

menu.

Reference:

"Microsoft Access Language Reference: Part 2," version 1.0, page 431.

References


INF: Hourglass in Setup Changes to Arrow During Copy

 Article Number: Q92896

 CREATED: 17-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

During the Microsoft Access setup process, the mouse pointer will

change from an hourglass to an arrow if the mouse is moved while files

are being copied. The pointer will not return to an hourglass until

the Setup program changes to another disk.

More Information:

This behavior is by design and reflects the ability to switch the

Setup program to background processing, which enables you to continue

working with other applications running in the Windows environment.

Steps to Reproduce Problem

--------------------------

1. Run SETUP.EXE.

2. Choose Complete Installation. When Microsoft Access begins copying

   the files, move the mouse. The hourglass will change to an arrow.

References


INF: Changing the RowSource of a ListBox/ComboBox at Runtime

 Article Number: Q92897

 CREATED: 17-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

The RowSource property for a ComboBox or ListBox cannot be modified

while the form is active. However, there is a workaround for changing the

recordset that the object is bound to. This article discusses that

workaround.

More Information:

The workaround for this problem is to bind the object to a query, then

manipulate the query's recordset underneath the object. For example, you

would bind the object to a query called Query1, then create a new query

called Query1 programmatically, while the object is active.

The following example illustrates this. In the following example, there

is a combo box bound to data from the NWIND.MDB Products table. By clicking

on one of two check boxes, the order of records in the combo box will be

changed.

1. Create a form with an Option Group control called MyOption, and a

   combo box called MyCombo.

2. Add two check box controls to MyOption and specify the following

   property:

      AfterUpdate: =NewOrder([MyOption])

3. For MyCombo, specify the following properties:

      RowSourceType: Table/Query

      RowSource: DeleteMe

      ColumnCount: 2

      Locked: True

      Enabled: False

4. Add the following function to a module in the database:

   Note: In the following sample code, an underscore(_) is used as a

   line continuation character. Remove the underscore when re-creating

   this code in Access Basic.

      Option Explicit

      Function NewOrder (WhichSort%)

         DoCmd Hourglass True

         Dim D As Database, Q As QueryDef

         Set D = CurrentDB()

         Screen.ActiveForm!MyCombo.Enabled = True

         Screen.ActiveForm!MyCombo.Locked = False

         On Error Resume Next

         D.DeleteQueryDef ("DeleteMe")

         On Error GoTo 0

         If WhichSort = 1 Then

            Set Q = D.CreateQueryDef("DeleteMe",_

                   "SELECT [Product ID], [Category ID]_

                   FROM Products ORDER BY [Product ID];")

         Else

            Set Q = D.CreateQueryDef("DeleteMe",_

                   "SELECT [Product ID], [Category ID]_

                   FROM Products ORDER BY [Category ID];")

         End If

         Q.Close

         D.Close

         DoCmd Requery "MyCombo"

         DoCmd Hourglass False

      End Function

5. Open the form, click one of the check boxes, and drop down the

   combo box. Notice the order of records in the combo box.

6. Click the other check box and drop down the combo box again.

   Notice that the order of records has changed.

The key to changing the recordset is found in Step 4 above. By using

different SELECT statements for the CreateQueryDef() methods, you can

create any kind of query.

References


INF: Double-Clicking on Control Moves Control Unintentionally

 Article Number: Q92898

 CREATED: 17-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

If you double-click on a control on a form, a property sheet will appear

containing the properties for that control. A negative side-effect to this

feature is that the control sometimes gets moved when the user double-clicks

on it. This article discusses some tips on how to avoid or correct this

situation.

More Information:

Here are a couple of tips for avoiding this problem...

- Use the TAB key to move between controls.. When you move to the control

  by using the TAB key, the control will not be moved.  Once the desired

  control has focus, you can choose the Property Sheet button in the toolbar

  at the top of the screen.

  An alternative to tabbing to the control is to select it by drawing

  a selection around it with your mouse.

- Take advantage of the 'Snap to Grid' feature.  This feature disallows

  any moving of a control unless the move is significant, thus

  reducing the possibility of moving the control accidentally. Turn

  'Snap to Grid' off only when you need fine movement for the control.

  You can toggle 'Snap to Grid' by choosing Snap to Grid from the

  Layout menu at the top of the screen.

- If you accidentally move the control, you can choose Undo Move from

  the Edit menu at the top of the screen immediately after the move.

References


INF: Requery Control Err Msg: There Is No Control Called...

 Article Number: Q92899

 CREATED: 17-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

When you try to requery a control by using the Requery macro action,

an error appears indicating that the specified control does not exist

even though the control clearly exists on the form.

More Information:

For the Requery Control Name parameter, Microsoft Access expects a

short control name without any brackets. The Help system informs you

that you should not use the full syntax, but it does not mention that

the brackets must be omitted even if the control name consists of more

than one word. Because other scenarios require the use of brackets,

this inconsistency is confusing.

The following example reproduces the problem and discusses the

solution:

1. Create an unbound form called Form1.

2. Place a combo box bound to NWIND.MDB "Sales Totals Query" on the form

   and call the combo box Field1.

3. Create a macro called Macro1 with the following Action/Parameter:

      Action       : Requery

      Control Name : [Field1]

   Note that [Field1] is enclosed in brackets.

4. Save and close Macro1 and drag it on to Form1 in design mode.

5. Switch to Browse mode on the form and choose the button.

   The following error message appears:

      There is no control called '[Field1]'.

6. Remove the brackets from the Control Name parameter in Macro1 and

   try again.

   The control should now work properly.

References


INF: Choosing Toolbar Design Button Causes Unexpected Behavior

 Article Number: Q92949

 CREATED: 19-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

In Form view, pressing the Design button on the toolbar does not

return Microsoft Access to Design mode if the form's OnClose property

opens another form.

More Information:

Perform the following seven steps to demonstrate this behavior.

Steps to Reproduce Behavior

---------------------------

1. Create two new forms named Form1 and Form2.

2. Create a macro named TestMacro to perform two actions: close the

   open form (Form1) and then open Form2.

   Macro Name         Action

   -------------------------

   TestMacro          Close

                      OpenForm

   TestMacro    Actions

   --------------------

    Close

       Object Type: Form

       Object Name: Form1

    OpenForm

       Form Name: Form2

       View: Form

       Data Mode: Edit

3. View the property sheet for Form1. Set the OnClose property to run

   the macro named TestMacro you created in step 2.

   Object: Form

   --------------------------

   OnClose: TestMacro

4. Save Form1 and close it.

5. Select Form1 from the Database window and choose the Design button.

6. Choose the View Form button on the toolbar. (The form view is

   displayed.)

7. Choose the Design button on the toolbar.

At this point, you would expect to return to Design mode. However,

Microsoft Access runs the OnClose macro and opens Form2.

References


INF: Bound OLE Object Blank in Form View

 Article Number: Q92950

 CREATED: 19-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If a bound object frame on a form has the ControlSource property

   set to a field that is not of the type OLE Object, this control

   will be blank when the form is in Form view. In Datasheet view, the

   cells for this control contain "Invalid Object."

CAUSE

   A bound object frame must refer to a field of the type OLE Object

   in a table or query in order to display anything in Form view. To

   display an object in this control, the ControlSource property must

   be set to an OLE Object field. For example, Microsoft Access cannot

   display the contents of a Text field as an OLE Object. Object

   frames will appear blank unless there is something to show.

STATUS

   This is by design.

References


PRB: Undo Property Setting Command Appears in Macro Design

 Article Number: Q92951

 CREATED: 19-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The text string for the Undo command does not correctly reflect the

   type of object that you are editing. If you are adding or modifying

   actions in a macro, and then open the Edit menu, the text string that

   you see for the Undo command is

      Undo Property Setting

   rather than something similar to "Undo Macro Action." However, the

   functionality of the Undo command is unaffected.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new macro.

2. In the Macro Action column, type "Close" (without the quotation

   marks) and press ENTER.

3. Open the Edit menu. Note the Undo Property Setting command.

4. Choose the Undo Property Setting command.

   The word "Close" is now gone.

References


PRB: Import/Export Setup Cancel Button Cancels Unsaved Changes

 Article Number: Q93022

 CREATED: 22-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOM

   The Cancel button in the Import/Export Setup dialog box cancels only

   those changes that have not been saved. It does not cancel all changes

   made since entering the dialog box.

CAUSE

   If you make a change to the specification and then choose the Save As

   button, choosing the Cancel button does not invalidate those changes.

   The Cancel button cancels only those changes that have not been saved

   and then returns you to the Database window.

   Note: The OK button performs a "save and exit"; the Save As button

   saves your changes but does not close the dialog box.

STATUS

   This behavior is by design.

References


INF: No Custom Printer Setup for Mailing Labels ReportWizard

 Article Number: Q93023

 CREATED: 22-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

The Mailing Labels ReportWizard allows you to choose from 66 different

labels. However, the ReportWizard does not verify whether the labels

you select will correctly fit on the paper size that you have

specified.

You may need to manually customize your printer setup and/or the

number of labels per page after using the ReportWizard.

More Information:

The need to customize the printer setup is most common with dot-matrix

printers. Label sizes other than .5 inch or 1 inch may not fit evenly

on the default 11-inch page.

To manually customize your printer setup and/or the number of labels

per page:

1. Open your report in Print Preview.

2. From the File menu, choose Print Setup.

3. Customize your margins to accommodate the number and/or width of

   the labels.

4. Choose the More button in the Print Setup dialog box to customize

   the number of rows of labels.

References


INF: Default AutoLabel and AddColon Properties

 Article Number: Q93024

 CREATED: 22-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

The following table shows the default values for the AutoLabel and

AddColon properties for the different form and report objects:

   Toolbox object       AutoLabel    AddColon

   ------------------------------------------

   Text box                Yes         Yes

   Option group            Yes         No

   Toggle button           No          No

   Radio button            Yes         No

   Check box               Yes         No

   Combo box               Yes         Yes

   List box                Yes         Yes

   Subform/report          Yes         Yes

   Bound object frame      Yes         Yes

   Command button          No          No

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 9, "Designing

Forms," and Chapter 18, "Designing Reports"

References


INF: Using DLookup() to Look Up Values in Forms and Reports

 Article Number: Q93025

 CREATED: 22-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

You can display multiple fields in a combo or list box on a form or report

even when those fields come from a table that is not bound to the form or

report. You can also update controls such as text boxes with new

information based on what a user selects from a combo or list box.

More Information:

To accomplish these objectives, use one of these three techniques:

1.  Use Row Fix-up in forms. For more information on Row Fix-up, query on

    the following words in the Microsoft Knowledge Base:

       "Row Fix-up" and "multiple" and "One to Many"

2.  Use multiple DLookup() functions in forms and reports. See the "More

    Information" section below.

3.  Use the Column property of a multiple-column combo box to update a

    text box control with new information as focus moves from row to

    row in the combo box. For more information on this, query on the

    following words in the Microsoft Knowledge Base:

       "Column Property" and "combo box" and "Update"

More Information:

DLookup() Function

------------------

Here's the syntax for DLookup():

   DLookup(expr, domain [, criteria] )

The DLookup() Function returns a value from a field in a specified set of

records called the domain. The DLookup() function specifies the criteria

for the domain. To make the domain dependent on one or more values listed

in controls on a form or report, refer to the controls in the DLookup()

criteria argument.

The following example looks in the Employees table (the domain) and returns

the Last Name of the Employee ID specified in the [ControlName] control on

the Form. Although the example is split into two lines for readability, you

should enter it as one formula.

   =DLookup("[Last Name]", "Employees", "[Employee ID] =

            Forms!FormName![ControlName]")

For reports, use Reports!ReportName![ControlName].

DLookup() returns one value from a single field even if more than one

record satisfies the criteria. If no record satisfies the criteria or if

the domain contains no records, DLookup() returns Null.

Reference(s):

For more information on DLookup(), search for "DLookup function" using the

Help menu.

References


INF: Users Can Edit but Not Commit Read-Only OLE Objects

 Article Number: Q93026

 CREATED: 22-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

Users are allowed to edit OLE objects in a database that has been

opened as read-only, or in a form that is read-only. However, when a

user attempts to move to the next record or chooses Save Record from

the File menu, Microsoft Access displays a message indicating that the

record cannot be updated.

To prevent users from attempting to edit OLE objects in read-only

forms, set the Enabled property of the object frame to No.

More Information:

In a read-only database, a user is allowed to edit and update OLE

objects but is not allowed to commit a record with these changes. At

the point the record is committed, the following message appears:

   Can't save changes to this object because you don't have

   permission to write to the record. Copy the object to the

   Clipboard if you want to save it, then choose Undo Field.

The user must undo the changes before the record can be committed. To

save the changes, the user must copy the object to the Clipboard

before choosing Undo Field.

References


INF: DeleteControl, DeleteReportControl, and CreateGroupLevel

 Article Number: Q93094

 CREATED: 23-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

This article discusses two Microsoft Access undocumented commands,

DeleteControl and DeleteReportControl, and an undocumented function

CreateGroupLevel(). If you intend to write your own FormWizard or

ReportWizard, you can use the commands to delete controls on a form or

report that is available in Design view, and you can use the function to

create groups on a Report that is available in Design view.

For more information on Microsoft Access Libraries, query on "libraries

AND debugging AND creating" in the Microsoft Knowledge Base.

For more information on other AccessWizard functions, query on the

following words in the Microsoft Knowledge Base:

   CreateControl AND CreateReportControl AND CreateForm AND

   CreateReport AND 'Section Property' AND DeleteControl AND

   DeleteReportControl AND CreateGroupLevel

More Information:

You can use DeleteControl and DeleteReportControl commands to delete a

control that exists on a form or report in design view. Both commands

require a string value that represents the name of the form or report and

a string value that represents the name of the control.

DeleteControl and DeleteReportControl are commands, not functions. They do

not return a value.

The example below creates a form, then creates a button on the form,

displays a message, and deletes the button on the form:

   Dim MyForm As Form, MyControl As Control

   Set MyForm = CreateForm()

   Set MyControl = CreateControl(MyForm.FormName, 104)

   MsgBox "About to Delete " & MyControl.ControlName

   DeleteControl MyForm.FormName, MyControl.ControlName

When you delete a control using DeleteControl or DeleteReportControl,

there is no visual feedback that the control is gone if the form or report

is not minimized. The control still appears as if it were not deleted

even though you can not click it to give it focus. To make the deleted

control disappear, you must repaint the form design window by minimizing it

and then restoring it.

If you have a report available in design view, you can create groups for it

in a procedure by using the CreateGroupLevel() function. Here is the syntax

for CreateGroupLevel():

   Function CreateGroupLevel(ReportName$,Expression$,

                             HasHeader$, HasFooter$)

ReportName is a string expression representing the report name.

Expression is a string expression representing the name of the field or

calculated field that you want to group by.

HasHeader and HasFooter indicate whether the group includes a group

header or group footer, respectively.

On execution, CreateGroupLevel() adds a group at the innermost level. For

example, if one group already exists, CreateGroupLevel() creates a second

group within the first group. CreateGroupLevel() returns a number

indicating which level it created, beginning with zero. In the example just

mentioned, CreateGroupLevel() returns one because it is the second group,

and the first group was Group zero.

References


INF: CreateControl() and CreateReportControl() Functions

 Article Number: Q93095

 CREATED: 23-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

This article discusses the Microsoft Access undocumented functions

CreateControl() and CreateReportControl(). If you intend to write your

own FormWizards or ReportWizards, you can use these functions to create

controls on a form or report that is available in Design view.

For more information on Microsoft Access Libraries, query on "libraries

AND debugging AND creating" in the Microsoft Knowledge Base.

For more information on other AccessWizard functions, query on the

following words in the Microsoft Knowledge Base:

   CreateControl AND CreateReportControl AND CreateForm AND

   CreateReport AND 'Section Property' AND DeleteControl AND

   DeleteReportControl AND CreateGroupLevel

This article is for those who are already familiar with Access Basic and

with designing forms and reports.

More Information:

You can use the CreateControl() and CreateReportControl() functions to

create new controls for a form or report opened in Design view. These

functions require two arguments: the name of the form or report as a string

value and a numeric code that represents the control type.

Here are the control types and their associated numeric codes:

   Label .......... 100

   Box ............ 101

   Line ........... 102

   Picture ........ 103

   Button ......... 104

   Radio Button ... 105

   Check Box ...... 106

   OLE Object ..... 108

   Text Box ....... 109

CreateControl() and CreateReportControl() both return a control object

value. Therefore, you need to first define a control variable, and then set

the control variable to the function name.

For example, the following procedure creates a form and then adds a button

to the form:

   Dim MyForm As Form, MyControl As Control

   Set MyForm = CreateForm()

   Set MyControl = CreateControl(MyForm.FormName, 104)

When the procedure has finished, you can modify the properties of the new

control by using the control variable you defined. For example, you can

change the control's Width and Caption properties with these statements:

   MyControl.Width = 2000

   MyControl.Caption = "&Sum All Records"

For controls that are frequently associated with a field in a table or

query, you can modify the ControlSource property to bind the control to

the field.

By default, some controls are created with their Height and Width

properties set to zero to make them invisible. Also by default, controls

appear in the upper-left corner of the form. You can adjust the size and

position of a control immediately after you create it by changing the

control's properties. For example, the following code creates, sizes,

moves, and then binds a text box to a field by changing the properties:

   Set MyControl = CreateControl(MyForm.FormName, 109)

   MyControl.Width = 1500

   MyControl.Height = 200

   MyControl.Top = 440

   MyControl.Left = 200

   MyControl.ControlSource = "[Category ID]"

In addition to the form name and the code for the type of control, you can

also specify the form or report Section where you want Microsoft Access to

place the control.

The following is the CreateControl() syntax. The CreateReportControl()

syntax is identical.

   Function CreateControl (FormName As String,

                           ControlType As Integer

                           [,SectionNumber As Integer])

SectionNumber is the Section property setting number that identifies a

particular section as follows:

   Detail section ................................ 0

   Form or report header section ................. 1

   Form or report footer section ................. 2

   Form or report page header section ............ 3

   Form or report page footer section ............ 4

   Group-level 1 header section (reports only) ... 5

   Group-level 1 footer section (reports only) ... 6

   Group-level 2 header section (reports only) ... 7

   Group-level 2 footer section (reports only) ... 8

If a report has additional group-level sections, the header/footer pairs

are numbered consecutively beginning with 9.

References


INF: Using Undocumented CreateForm(),CreateReport() Functions

 Article Number: Q93096

 CREATED: 23-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

This article discusses the Microsoft Access undocumented functions

CreateForm() and CreateReport(). If you intend to write your own

FormWizard or ReportWizard, you can use these functions to create and

customize a blank form or report to which you can add controls.

This article assumes that you are familiar with Access Basic and

designing forms and reports.

More Information:

CreateForm()/CreateReport() is roughly equivalent to choosing "New...

Form/New... Report" from the File menu at the top of the screen. When

the function is executed, a new empty form/report appears in an

iconized state.

Both functions return an object value that you can use for further

manipulation, and neither function requires parameters.

To use these functions, first define a form or report object

variable, then assign the variable to the function name. An example of

how to do this is:

   Dim MyForm As Form

   Set MyForm = CreateForm()

After opening the form/report in design mode after executing the

commands above, you can bind the form to a table or query by modifying

the form's/report's RecordSource property:

   MyForm.RecordSource = "Categories"

With the form/report in design mode, you can access and

change any of the other design-time properties of the form/report. You

can also access and change properties of each of the form's/report's

sections via the Section property. The Section property is actually an

array with each array value being a reference to a form's/report's

section. For forms, the Section property array is broken down as:

   Section(0) - Detail Section

   Section(1) - Form Header

   Section(2) - Form Footer

   Section(3) - Page Header

   Section(4) - Page Footer

For reports, the section property array is broken down as:

   Section(0) - Detail Section

   Section(1) - Report Header

   Section(2) - Report Footer

   Section(3) - Page Header

   Section(4) - Page Footer

   Section(5) - Group Level 1 Header

   Section(6) - Group Level 1 Footer

   Section(7) - Group Level 2 Header

      ...etc.

With this information, you can customize the design of a form/report

section programmatically. The following example creates a new report,

hides the page footer by setting its Visible property to false, sets

the Height property of the detail section, and enables its

KeepTogether property:

   Dim MyReport As Report

   Set MyReport = CreateReport()

   MyReport.Section(4).Visible = False

   MyReport.Section(0).Height = 1760

   MyReport.Section(0).KeepTogether = True

For more information on Microsoft Access libraries, query on the

following words in the Microsoft Knowledge Base:

    "libraries AND debugging AND creating"

For more information about other ReportWizard and FormWizard

functions, query on the following words in the Microsoft Knowledge

Base:

   "CreateControl AND CreateReportControl AND CreateForm AND

   CreateReport AND 'Section Property' AND DeleteControl AND

   DeleteReportControl AND CreateGroupLevel"

References


PRB: Creating Multiple New Import/Export Specifications

 Article Number: Q93136

 CREATED: 24-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Creating multiple new Import/Export specifications using the

   Import/Export Setup dialog box requires that you either exit the

   dialog or delete or change each entry in the dialog that does not

   apply. The dialog does not provide a method to clear or reset each

   option in the dialog.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open any database or create a new one.

2. From the File menu, choose Imp/Exp Setup.

3. Enter information in several fields.

4. From the File menu, choose Save As.

If you want to create another specification at this point, you must

either exit this dialog or manually delete all of the irrelevant

information.

References


INF: Field Size of 0 Treated as 255

 Article Number: Q93137

 CREATED: 24-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

If you set a field size to zero (0) for a text field in table Design

view, the field is treated as if the size is set to 255. When you

close and save the table, and then reopen it in Design view, the field

size will have been changed to 255.

References


INF: Using Column Property of Combo Box to Update Text Box

 Article Number: Q93138

 CREATED: 24-NOV-1992

 MODIFIED: 14-MAY-1993

Summary:

You can display multiple fields in a combo or list box on a form or report

even when those fields come from a table that is not bound to the form or

report. You can also update controls such as text boxes with new

information based on what a user selects from a combo or list box.

More Information:

To accomplish these objectives, use one of these three techniques:

1.  Use Row Fix-up in forms. For more information on Row Fix-up, query on

    the following words in the Microsoft Knowledge Base:

       "Row" and "Fix-up"

2.  Use multiple DLookup() functions in forms and reports. For more

    information on the DLookup() function, query on the following words

    in the Microsoft Knowledge Base:

       "DLookup" and "forms" and "reports"

3.  Use the Column property of a multiple-column combo box to update

    a text box control with new information as focus moves from row to

    row in the combo box. The next section describes this technique in

    detail.

Using the Column Property of a Combo Box

----------------------------------------

By assigning the Column property of a multiple-column combo or list

box to a text box, you can display one column from the current

combo-box selection in the text box. Microsoft Access automatically

updates the text box as focus changes from row to row in the combo

box. Here is the procedure:

1.  Create your form or report based on the desired table or query.

2.  Create a combo or list box that retrieves information from more than

    one field. For example, you might use the following multiple-column

    Select statement as the RowSource for a combo or list box to display

    information from several columns in the Categories table:

       Select [Category Id], [Category Name], [Description] from

          Categories Order by [Category Name];

    For this example, set the RowCount property to 3, and set the

    ColumnWidth property to an appropriate size for the combo or list

    box. Once you have the combo or list box sized correctly and

    defined to return multiple fields, you can use the Column property

    to display the current selection in a text box control.

    Note: You must choose an entry in the list box (either by selecting a

    record with the mouse pointer or pressing TAB + ENTER) before

    referring to the list box or any entries in it or else it returns a

    null.

    The Column property uses a reference argument to refer to a specific

    column in the multiple-column combo or list box. Use Column(0) to

    refer to the first column, Column(1) to refer to the second column, and

    so on.

    This example uses Column(1) to refer to [Category Name] -- the second

    column in the combo box.

3.  To display the [Category Name] of the current combo box selection,

    create a text box control. Make the text box a calculated control by

    defining the following expression as the data source for the text box:

       =[ComboControlName].Column(1)

    ComboControlName is the name of the combo box. The Column property will

    make the text box (calculated control) read only.

Reference(s):

For more information on how to set up a combo box see the "Microsoft Access

User's Guide," version 1.0, Chapter 9, "Designing Forms," pages 233-245.

For more information on the Column property, see the "Microsoft Access

Language Reference," version 1.0, "Column Property," pages 72-73.

References


PRB: Inaccurate Message When Opening MDB Shared vs. Exclusive

 Article Number: Q93139

 CREATED: 24-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 13645

SYMPTOMS

   When you open a database exclusively, then attempt to open the same

   database as shared in another instance of Microsoft Access, you

   will receive the following error:

      'Database.mdb' This file is already in use. Use a new filename or

      close the file in use by another application.

   When you open the database as shared, then attempt to open the same

   database exclusively in another instance of Microsoft Access, you

   will receive the error:

      Couldn't open file '<path><filename>'.

CAUSE

   The second error can be confusing because it does not state why the

   file couldn't be opened. You can get around this error by opening

   the database in the second instance of Microsoft Access as shared,

   or by closing the database in the first instance of Microsoft

   Access.

STATUS

   The behavior is by design.

References


PRB: Cannot Rollback in Transaction without Closing Database

 Article Number: Q93140

 CREATED: 24-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A subroutine or a function contains a transaction process which

   calls a subroutine or function that dimensions and opens a database

   using the OpenDatabase method. When the subroutine or function

   exits, Microsoft Access implicitly closes the database (no Close

   method is called). When the subroutine or function attempts to

   execute the CommitTrans or Rollback statement, Microsoft Access

   displays the following message:

      Commit or Rollback without BeginTrans.

CAUSE

   When the called subroutine or function exits, Microsoft Access

   implicitly closes the database. Internally, the initial attempt to

   close the database fails because the database was opened in a

   transaction. Microsoft detects this error and performs an implicit

   transaction rollback, then it closes the database successfully.

RESOLUTION

   To perform a Rollback in the called subroutine or function, you

   must first use call the Close statement to close the open database.

STATUS

   This behavior is by design.

More Information:

Perform the following three steps to demonstrate this behavior.

Steps to Reproduce Behavior

---------------------------

1. Create the following module.

      '************************************************************

      'Declarations section of the module.

      '************************************************************

      Option Explicit

      '============================================================

      'The following Sub procedure starts a transaction, calls

      'another sub procedure, then attempts to rollback.

      '============================================================

      Sub Test1

         BeginTrans

            Call Test2

         Rollback

      End Sub

      '============================================================

      'The following Sub procedure sets a Database variable to

      'the current database.

      '============================================================

      Sub Test2

         Dim MyDB as Database

         Set MyDB = CurrentDB()

         'the database is implicitly closed on exit

      End Sub

2. Compile the module.

3. In the Immediate window, enter Test1. Microsoft Access generates

   the following message:

      Commit or Rollback without BeginTrans.

Perform the following four steps to demonstrate the resolution to this

problem.

1. Perform Step 1 above.

2. Edit the second function to add MyDB.Close, as follows.

      '============================================================

      'The following Sub procedure will set a Database variable to

      'the current database, and then close the database.

      '============================================================

      Sub Test2

         Dim MyDB as Database

         Set MyDB = CurrentDB()

         MyDB.Close

      End Sub

3. Compile the module.

4. In the Immediate window enter Test1. The Rollback works correctly

   because the code explicitly closes the database opened in the

   transaction.

References


INF: How to Pass a Single Byte of Data Using API Calls

 Article Number: Q93141

 CREATED: 24-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access does not have a single-byte data type. To pass a byte

to an external function such as a Windows application programming

interface (API) function or a dynamic-link library (DLL), you should

declare the byte as an integer.

If you need to pass a single byte of information in a data type, such

as the RGBQUAD structure, you should pass the data structure as a

string type.

More Information:

The Intel chip supports only a full word on the stack. You cannot put

just 8 bits on the stack; you must use the full 16 bits. If you

attempt to pass only 8 bits, you will end up passing 16 bits (your 8

bits of data plus an additional 8 bits that will be "padded" on). This

is a limitation of the processor, not Microsoft Access.

To pass a single byte of data in a structure such as the RGBQUAD, use

a fixed-length string of 1. For example, suppose you want to pass a

single byte in the "C" RGBQUAD data structure, which looks like this:

   typedef struct tagRGBQUAD{

      BYTE   rgbBlue;

      BYTE   rgbGreen;

      BYTE   rgbRed;

      BYTE   rgbReserve;

   } RGBQUAD

You can redefine this structure with Access Basic as:

   Type RGBQUAD

      rgbBlue As String * 1

      rgbGreen As String * 1

      rgbRed As String * 1

      rgbReserve As String * 1

   End Type

   Dim RGB As RGBQUAD

   RGB.rgbBlue = Chr$(10)

   RGB.rgbRed = Chr$(14)

   RGB.rgbGreen = Chr$(15)

     Note: In the above example, Blue=10, Red=14, and Green=15.

For more information on this topic, search for "Type Statement" using

the Help menu.

References


PRB: Option Button Appears Fuzzy in Datasheet View

 Article Number: Q93142

 CREATED: 24-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 13865

SYMPTOMS

   If you create a form and place an option button on the form, then

   switch to Datasheet view, the outline of the option button will

   appear fuzzy. This happens when the focus is on any option button

   in Datasheet view.

RESOLUTION

   Move the focus to a field that does not contain an option button.

   The option button will change to a normal appearance.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Problem

--------------------------

1. Create a new blank form.

2. From the toolbox, select the Option Button and place it on the

   form.

3. Switch to Datasheet view.

4. Make sure the focus is on the button. Notice the outline of the

   button has a fuzzy appearance.

References


INF: Online Help for Sigma Button Is Incorrect

 Article Number: Q93143

 CREATED: 24-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

In Microsoft Access Help, if you search for "Sigma Button," you are

incorrectly pointed to information about the Reinitialize button.

Instead, you should be pointed to information about the Totals button.

More Information:

One of the tools available on the toolbar in the Query Design window

is the Totals button. The symbol used to identify the Totals button is

the Greek letter sigma.

The Reinitialize button is one of the tools available on the toolbar

in the Module Design window.

References


INF: Microsoft Access is Pen Compatible but not Pen Aware

 Article Number: Q93144

 CREATED: 24-NOV-1992

 MODIFIED: 30-MAY-1993

Summary:

Microsoft Access is pen compatible but not pen aware. This means you

can use the pen as a substitute for the mouse.

More Information:

The request to allow Microsoft Access access to Pen extensions has

been noted as an enhancement request and will be considered for future

releases.

References


INF: How Access Handles Logins to Attached SQL Tables

 Article Number: Q93145

 CREATED: 24-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

How Microsoft Access handles a login to an attached SQL table depends

on how the table was originally attached, and whether the login and

password were saved with the table information. It may also depend on

who attached the SQL table, what rights that person has to that table,

what rights you have to that table, and where the tables are located

(different servers, different databases, same database).

More Information:

If the "Save login ID and password locally" option was enabled when a

SQL table is attached, you will not be prompted for a login ID and

password. Instead, you automatically receive the rights to each table

that are appropriate for the login ID used when the table was

attached.

If this option was not enabled, you are prompted for a login ID and

password once for each unique data source, and you receive the rights

to each table that are appropriate for the login ID that you use.

NOTE: A unique data source is composed of the unique combination of a

SQL server and a database on that server.

So, if you attach multiple SQL tables and use different login IDs with

different rights for each table, but do not enable the option to save

the login and password information, the next time you access the

tables, the login ID and password you supply for each data source will

determine the authority you have to the tables from that data source.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 60-62, 66-68

References


PRACC9303: Error Msg: Data Has Changed, Operation Aborted

 Article Number: Q93146

 CREATED: 24-NOV-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 2158

SYMPTOMS

   When a user (User1) attempts to commit a record in an attached Paradox

   table and that record has been changed by another user (User2), User1

   sees this error message:

      Data has changed; operation aborted.

   After User1 chooses the OK button, a second error message appears:

      This record has been changed by another user since you

      began editing it...  Save Record, Copy to Clipboard,

      Drop Changes.

   If User1 selects the Save Record option, the first error message is

   repeated. User1 is caught in a continuous loop, unable to commit the

   record.

RESOLUTION

   To save the changes made to the current record, User1 must:

   1. Select the Copy to Clipboard option.

   2. Select the record User1 was attempting to change.

   3. Choose Paste from the Edit menu.

   4. Commit the record.

   User1 can prevent User2 from changing a record while User1 is editing it

   by changing the multiuser option to Edited Records.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access version

   1.0. We are researching this problem and will post new information here

   in the Microsoft Knowledge Base as it becomes available.

More Information:

Steps to Reproduce Problem

--------------------------

These steps require either two users or two instances of Microsoft Access.

1. Both users attach to a Paradox Table.

2. Both users set their multiuser options to No Locks.

3. User1 starts to edit a field but does not commit the record.

4. User2 changes and commits the same record by choosing Save Record from

   the File menu or by moving the cursor to the next record.

5. User1 attempts to commit the changed record.

   Error Message #1: Data has changed; operation stopped.

   Error Message #2: This record has been changed by another user since you

      began editing it... Save Record, Copy to Clipboard, Drop Changes.

References


PRB: Form Opened in Form View Is Completely Blank

 Article Number: Q93261

 CREATED: 03-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You open a form in Form view, and it is completely blank. There are no

   controls or text. Everything is blank.

CAUSE

   Typically, this happens because the dynaset contains no records or

   privileges have been limited.

RESOLUTION

   Controls located in form headers or footers are always visible -- even

   when privilege limits or empty dynasets prevent the display of controls

   located in the detail section. Therefore, when you design a form, place

   necessary controls such as command buttons and check boxes in the form

   header or footer section. Also, you should ensure that each dynaset

   contains at least one record.

STATUS

   This is by design.

More Information:

The following six situations may cause a blank form to display:

1. The form is based on a query that contains a one-to-many join, and

   the query returns no records.

2. The form is not updatable at all. It is a read-only form with the

   AllowUpdating property set to No Tables, or it is a static form that

   displays results by using a GROUP BY clause or a DISTINCT operator.

3. The form is based on a query that contains a one-to-one join, and one of

   the tables is in a read-only database.

4. The form is based on a query that contains a many-to-one inner join,

   and the query does not contain all the joined columns of the many-side

   table.

5. The form is based on a query that includes an updatable remote table

   but does not include all the columns that make up the primary key.

6. The form is read-only and is based on an empty table.

Steps to Reproduce Situation 1

------------------------------

1. Change the Catalog query in the NWIND sample database placing IS NULL

   in the criteria cell for the field [Category Name].

2. Create a new form based on the modified query, and place some fields

   and a command button in the detail section.

3. Switch to Form view.

Result: The blank form is displayed.

Steps to Reproduce Situation 6

------------------------------

1. Create a new table. Do not enter any data.

2. Create a new form based on the table. Add a command button and

   make the form read-only.

3. Switch to form view.

Result: A blank form is displayed.

The form displays blank in all situations because the dynaset is empty.

The form would display as expected if you were adding new records, but

the setting for the form or the joins in the query prevent you from

using the form to add new records.

To work around this issue, place necessary controls or command buttons in

the form header and footer. Headers and footers display even when the

detail section is blank.

References


PRB: Close Dynaset Based on Form Multiple Times

 Article Number: Q93292

 CREATED: 03-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 12782

SYMPTOMS

   If you create a dynaset that is based on a form through Access

   Basic, you can have multiple dynaset.Close statements without

   generating an error message.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open NWIND.MDB and create a new module.

   '*******************************************************

   'Declarations section of the module.

   '*******************************************************

   Option Explicit

   '=======================================================

   ' The following function will create a dynaset based on

   ' the Add Products form in the NorthWind database. The

   ' function will then attempt to close the dynaset twice.

   '=======================================================

   Function Foos()

      Dim MyDyna as Dynaset

      Set MyDyna=Forms![Add Products].Dynaset

      MyDyna.Close

      MyDyna.Close

   End Function

2. Run the code. Notice that there are no error messages even though

   the code attempts to close the dynaset more than once.

References


PRACC9303: Error When Use SQL in Report RecordSource Property

 Article Number: Q93293

 CREATED: 03-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 14092

SYMPTOMS

   You receive the following error message when you try to use a valid

   SQL statement as the RecordSource in a report:

      This report is bound to a table or query that doesn't exist:

      '<SQL statement>'.

RESOLUTION

   Create a query using the desired SQL statement, and base your report

   on that query.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access version

   1.0. We are researching this problem and will post new information here

   in the Microsoft Knowledge Base as it becomes available.

More Information:

Steps to Reproduce Problem

--------------------------

1. Open the NWIND.MDB database.

2. Open the Category List query in Design view.

3. To bring up the SQL statement for this query, choose SQL from

   the View menu.

4. Highlight the contents of the SQL window. Then use the keystroke

   combination CTRL+C to copy the SQL statement to the clipboard.

5. Choose Cancel to close the SQL dialog box. Then close the Category

   List query.

6. Open a new unbound form, and paste the SQL statement into the form's

   RecordSource property by using CTRL+V.

7. Switch to Form view.

8. Open a new unbound report, and paste the SQL statement into the

   report's RecordSource property by using CTRL+V.

9. Click the Print Preview button on the toolbar.

You receive the error message on step 9, but not on step 7. You can use

a valid SQL statement as the RecordSource in a form, but not in a report.

References


INF: All Duplicate Macro Names in Macro Group Are Executed

 Article Number: Q93294

 CREATED: 03-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

When you have two macros in the same macro group with the same name,

both macros will be executed. This problem will not occur if the

macros are not consecutive in the macro group--that is, there is a

different macro (Macro Name: "Between") between the two macros with

the same name (Macro Name: "First One").

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new macro with two actions:

      MacroName         Action   Argument

      ----------------------------------------------------

      First One         MsgBox   "This is the message"

      First One         MsgBox   "This is the message"

2. Save the macro as Macro1.

3. Run the macro using Macro1.FirstOne.

   The MsgBox will appear twice.

References


PRB: 'Couldn't Open File <database name>'

 Article Number: Q93295

 CREATED: 03-DEC-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   Attempting to open a database exclusively when another user already

   has it open results in the error message:

      Couldn't open file <database name>.

CAUSE

   The help topic says in part "You must have ReadData permission for

   the file in order to view its data." The error message and help

   text are misleading because the problem is that the file cannot be

   opened exclusively.

   To open the file successfully:

   1. Press ESC or choose the OK button to exit the error message.

   2. From the File menu, choose Open Database.

   3. Select the database you want to open.

   4. Clear the Exclusive check box.

   5. Choose OK.

STATUS

   This behavior is by design.

References


INF: View Procedures Sorts Modules Alphabetically

 Article Number: Q93296

 CREATED: 03-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

When you choose Procedures from the View menu after opening a module,

the Modules box displays the modules in alphabetic order. If the

modules are numbered, they may appear out of order. You can rename the

procedures so they appear properly sorted in the list.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create three modules (Module1, Module2, Module19).

2. Open Module1, and choose Procedures from the View menu.

   The modules are listed Module1, Module19, and Module2, since they

   are sorted alphabetically.

To have the list sorted properly, rename Module1 and Module2 as

Module01 and Module02. The modules will now be sorted as Module01,

Module02, and Module19.

Note: The modules are sorted the same way in the Database window.

References


INF: How to Remove Attached Tables

 Article Number: Q93297

 CREATED: 03-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

The TransferDatabase action is the macro equivalent of the Attach

Tables command on File menu. However, there is no action to detach a

table. To remove an attached table from the user interface, select the

table in the Database window and press the DELETE key. You can also

create a macro to detach a table or you can call the action from a

Access Basic module using the DoCmd statement.

More Information:

To detach a table in Microsoft Access, create the following macro:

   Macro Name          Action

   --------------------------------

   RemoveTable         SelectObject

                       DoMenuItem

   RemoveTable Action

   --------------------------------

    SelectObject

      Object Type: Table

      Object Name: <tablename>

      In Database Window: Yes

    DoMenuItem

      Menu Bar: Database

      Menu Name: Edit

      Command: Delete

In Access Basic, you must use DoCmd to run the macro actions.

References


INF: How to Change Read-Only Properties at Run Time

 Article Number: Q93298

 CREATED: 03-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access does not allow you to change some control properties,

such as Color and Caption, at runtime. This article discusses how you

can get around this limitation.

More Information:

You can work around this limitation by creating two controls that are

identical except for the property you want to change. You place these

controls at the same location with their Visible property set to No.

At the point where the property is to change, set the Visible property

of the control with the desired property setting to True using a Macro

SetValue action, and set the Visible property of the other control to

False in the same manner.

The following example demonstrates this method. In the example, a form

appears with one button and text box. The text box is Blue, and the

button has the Caption "Red." When you click the button, the text

box's Color will change to red and the button's caption will change to

"Blue." Clicking the Blue button will toggle back to Red, and so on.

1. Create a new blank form.

2. Add two text box controls to the form and set their associated

   properties:

       Text Box

       --------------

       Control Name: Red

       Fill Color: 255

       Visible: No

       Text Box

       --------------

       Control Name: Blue

       Fill Color: 16711680

       Visible: Yes

3. Position the text box called "Blue" directly on top of the text box

   called "Red" and make sure they are exactly the same size so that

   one covers the other.

4. Add two command button controls to the form. Name one button

   "RedButton" and the other "BlueButton," and set their associated

   properties:

       Command Button

       --------------

       Control Name: RedButton

       Caption: Change to Red

       Visible: Yes

       On Push: ChangeColor.Red

       Command Button

       --------------

       Control Name: Blue Button

       Caption: Change to Blue

       Visible: No

       On Push: ChangeColor.Blue

5. Position command button called "BlueButton" directly on top of the

   command button called "RedButton" and make sure they are exactly

   the same size so that one covers the other.

6. Add a text box to the form. Delete its label and and set the text

   box's associated property:

       Text Box

       --------

       Control Name: GiveMeFocus

       Width: 0

   The purpose of the zero width for the text box is to maintain focus

   while visible properties of other controls are changing.

7. Close and save the form as "ChangeColor"

8. Create a macro as shown below:

       Macro Name  Action          Arguments

       -------------------------------------

       Blue        GoToControl     ControlName .. GiveMeFocus

                   SetValue        Item ......... [Blue]

                                   Expression ... [Red]

                   SetValue        Item ......... [Blue].Visible

                                   Expression ... True

                   SetValue        Item ......... [Red].Visible

                                   Expression ... False

                   SetValue        Item ......... [RedButton].Visible

                                   Expression ... True

                   SetValue        Item ......... [BlueButton].Visible

                                   Expression ... False

       Red         GoToControl     ControlName .. GiveMeFocus

                   SetValue        Item ......... [Red]

                                   Expression ... [Blue]

                   SetValue        Item ......... [Red].Visible

                                   Expression ... True

                   SetValue        Item ......... [Blue].Visible

                                   Expression ... False

                   SetValue        Item ......... [BlueButton].Visible

                                   Expression ... True

                   SetValue        Item ......... [RedButton].Visible

                                   Expression ... False

9. Close and save the macro as "ChangeColor."

Open the ChangeColor form, type something into the text box, and click

the button. Notice that each click of the button changes the caption

of the button and the color of the text box without changing the value

of the text box.

References


PRB: 'Too Many Expressions in Distinct Output' Error

 Article Number: Q93299

 CREATED: 03-DEC-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   An attempt to create an SQL statement in the SQL dialog box or in

   Access Basic fails and Microsoft Access displays the following

   message:

      Too many expressions in DISTINCT output.

CAUSE

   The query contains a DISTINCT clause that lists more than ten

   expressions. The online help file documents the ten field limit as

   the cause of the error. However, help provides the only

   documentation of this limit. The other reference, Appendix B in the

   "Microsoft Access Language Reference," version 1.0, does not state

   a ten field limit for the DISTINCT clause.

RESOLUTION

   There are two methods to deal with this error message:

    - Modify the query to remove the reserved word DISTINCT.

    - Reduce the number of fields in the DISTINCT clause to ten or

      fewer.

   One possible method to work around this error involves

   concatenating some of the fields together into an expression when

   your query checks for DISTINCT rows. Each concatenation equals one

   DISTINCT expression. For example, substitute the code in example 1

   below for the code in example 2 below.

Example 1

---------

   SELECT DISTINCT

      table1.lname & table1.fname,

      table1.address,...;

Example 2

---------

   SELECT DISTINCT

      table1.lname,

      table1.fname,

      table1.address,...;

References


INF: Using Data From Access In A Word For Windows Print Merge

 Article Number: Q93427

 CREATED: 10-DEC-1992

 MODIFIED: 12-MAY-1993

Summary:

Microsoft Word for Windows does not supply a converter for Microsoft

Access database files.  To use data from a Microsoft Access database

in Microsoft Word for Windows, the data must be converted to a format

which Microsoft Word for Windows recognizes. This can be done by

exporting the data from Microsoft Access as text, or copying tables

and queries from Microsoft Access and pasting them into a Microsoft

Word for Windows document.

This article described the steps to create a data file in Microsoft

Word for Windows using each of the methods described above.

More Information:

A data file is a comma or tab separated file that contains information

that can be used in Microsoft Word for Windows for a print or mail

merge.

A field name in Microsoft Word for Windows cannot contain more than 20

characters. A field name must begin with a letter and can contain only

letters, numbers, and the underline character (_). For example:

FirstName,LastName,Address,City,State,Postal_Code

Randy,Johnson,123 West St.,Baker,OR,97445

Jennifer,Smith,5 Circle Court,Yorkshire,WI,34507

Note: Do not include spaces after the commas. Spaces will be inserted as

part of the mail merge.

Method One:  Copying and Pasting

--------------------------------

1. From the Database window, select the table or query

   that contains the information you want.

2. Choose Copy from the Edit menu.

3. Activate Microsoft Word for Windows and open a new document.

4. From the Edit menu, select Paste.

Note: If there are spaces in your field name you will need to delete

them once you have pasted the data into Microsoft Word for Windows.

5. Save this document as MyData.Doc.

Because this method does not place each field inside quotation marks,

you may encounter errors if any of the fields contain tabs.

Method Two: Using The Transfer Text Macro Action

------------------------------------------------

1. Open a new macro.

2. Add the macro action TransferText with the following

   arguments:

      Transfer Type: Export Delimited

      Specification Name: <leave blank>

      Table Name: <name of the table or query you wish

                   to export.>

      File Name: <valid DOS file name.>

         (Example: c:\winword\mydata.txt)

      Has Field Name: Yes

This is a one-time export. If the data in your database changes

you will need to re-export it, overwriting the original file.

3. Perform the following steps in Microsoft Word for Windows:

     a. Open the main document.

     b. Choose Print Merge from the File menu.

     c. Choose the Attach Data File button.

     d. Select the exported text file that you created in step 2.

   Note:  if you did not specify a full path name for the

   text file, it will be in the same directory as your Microsoft

   Access database.

Now you can use the merge features of Microsoft Word for Windows:

Insert Merge Fields, Edit Data Field, Check, and Print Merge. The

check button will make a pass through the data document and check for

errors, such as those caused by commas or tabs stored in the Microsoft

Access fields.

Reference(s):

"Microsoft Word for Windows User's Guide," version 2.0, pages 620-622

References


PRB: Cannot Write README.TXT Error Msg During Installation

 Article Number: Q93590

 CREATED: 16-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   While installing Microsoft Access, you see the following error message

   when SETUP.EXE is processing Disk 6 or Disk 7:

      Cannot Write C:\MSACCESS\README.TXT

CAUSE

   This is a setup problem that occurs setup when Microsoft Access is

   writing the README.TXT file. There are a number of possible causes.

   The MS-DOS APPEND command, located in the AUTOEXEC.BAT file, causes this

   error if there is a README.TXT file in any of the directories that are

   specified on the APPEND line.

   When SETUP.EXE tries to install README.TXT, the APPEND command can cause

   MS-DOS to tell SETUP.EXE that there is a file with the same name in the

   installation directory. When SETUP.EXE is notified by MS-DOS that there

   is an existing file with the same name, SETUP tries to overwrite the

   existing file. MS-DOS returns an error code stating that the file is

   write protected.

   Some customers have reported possible problems installing the README.TXT

   file when using certain terminate and stay resident programs (TSRs) such

   as Quicken's BillMind and Logitech's Click and Logimenu.

RESOLUTION

   There are several possible workarounds. They are detailed in the More

   Information section below.

STATUS

   We are researching this problem and will post new information here in

   the Microsoft Knowledge Base as it becomes available.

More Information:

Before trying any of the following workarounds, ensure that you have a

standard Windows configuration. Then exit from Windows and from all

applications. Modify your AUTOEXEC.BAT file to remove any non-standard

TSRs, and then restart your computer.

Workaround One

--------------

1. Use File Manager to search the entire hard drive for all README.TXT

   files.

2. Rename all README.TXT files to another file name (for example,

   READTHIS.TXT).

3. Install Microsoft Access from the original disks.

Workaround Two

--------------

1. Change to the directory of the path given in the error message.

2. Use a text editor such as the MS-DOS Edit program to create an

   empty README.TXT file.

4. Install Microsoft Access from the original disks.

Workaround Three

----------------

1. Make a duplicate copy of Disk 6 or Disk 7.

2. On the new disk, copy the README.TX$ file to a new file

   named README.2

3. On the new disk, rename the README.TX$ file to README.1.

   Then rename README.2 to README.TX$.

4. Install Microsoft Access using the new disk you made.

Workaround Four

---------------

1. Make a duplicate copy of Disk 6 or Disk 7.

2. On the new disk, rename the README.TX$ file to README.1.

3. On the new disk, use a text editor such as the MS-DOS Edit

   to create a new file and save it as README.TX$.

4. Install Microsoft Access using the new disk you made.

References


INF: Importing Keyed Paradox Tables Requires .PX File

 Article Number: Q93640

 CREATED: 17-DEC-1992

 MODIFIED: 17-DEC-1992

--------------------------------------------------------------------

Summary:

When you import a keyed Paradox table into Microsoft Access the

associated index file must be in the same directory as the Paradox

table. If the index (.PX) file is not found you will receive the

following error message:

   'FILENAME#DB' is corrupted or isn't a Microsoft database.

More Information:

If you're importing a Paradox file, this message might be displayed

if you don't have an index (.PX) file. Paradox stores important

information about a table's primary key in the .PX file. Make sure you

have the .PX file before importing.

If a Paradox table and it's associated index file become separated, or

the .PX file is corrupt, Access will be unable to import the table. To

recreate the index file the table must be Restructured in Paradox.

Paradox is manufactured by Borland International, a vendor

independent of Microsoft; we make no warranty, implied or otherwise,

regarding this product's performance or reliability.

References


INF: Microsoft Access Performance Enhancement Recommendations

 Article Number: Q93684

 CREATED: 17-DEC-1992

 MODIFIED: 17-JUN-1993

Summary:

If you run Microsoft Access on a 4 MB machine, you can gain performance

improvements by altering the configuration of memory usage on the machine.

More Information:

The following steps can be used to enhance the relative performance of

Microsoft Access on computers with 4 MB of RAM:

1.  Do not use any of your RAM for a RAM disk.

2.  Use a maximum of 512K for SmartDrive or other disk caches.

3.  Set your network installation to use less than 200K of RAM, if

    possible.

4.  Don't run several other applications that require large amounts of

    memory. Running even one other large application (such as a

    spreadsheet, wordprocessor, or alternate desktop manager such as

    "Norton Desktop for Windows") can significantly degrade the performance

    of Microsoft Access.

5.  Run Windows in standard mode.

6.  Set the MaxBufferSize entry in MSACCESS.INI to a value less than

    512. In low memory cases this will help, even though less memory will

    be used for by Microsoft Access for buffering database I/O. (See the

    Microsoft Access README.TXT file for details on setting this value.)

7.  Open databases as Exclusive and Read/Only, if possible.

8.  If you don't want to use Access Wizards, you can disable them by

    removing the line "WIZARDS.MDA=RO" from the [Libraries] section of the

    MSACCESS.INI file. This frees up over 300K of RAM, but takes away the

    ability to use Access Wizards.

9.  Keep the number of Windows applets running to a minimum.

10. If you have a full-screen background bitmap (or "wallpaper") on your

    Windows desktop, replace it with a smaller bitmap, or no bitmap at all.

    For a standard VGA video display, this frees about 256K. For a 1024x768

    256 color display, this can free about 3/4 of a megabyte. (Your actual

    memory savings may vary, depending on the display.)

11. Keep in mind that CD ROM device drivers, sound board drivers, screen

    savers, MIDI drivers, multi-media support drivers, and other drivers

    take extra memory. The 4 MB recommendation does not take this

    into account. If you need to have several drivers running under

    Windows, then more memory than 4 MB will be required for Microsoft

    Access to run efficiently.

The 4 MB RAM recommendation was based on a 386/20 computer, MS-DOS 5.0,

unmodified Windows 3.1, VGA display, mouse, and network workstation

software. If your configuration is similar to, or better than this, you

will get good performance. (This has been verified by benchmarks with

Microsoft Access fully installed.) However, if your system's configuration

is more sophisticated, you will require more memory for peak Microsoft

Access performance.

References


PRB: 'Couldn't find object <tablename>' Error with Btrieve

 Article Number: Q93685

 CREATED: 17-DEC-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   When attempting to import or attach Btrieve files, you receive the

   following error message:

      Couldn't find object <tablename>

CAUSE

   Microsoft Access requires all three Xtrieve data dictionary files

   (FILE.DDF, INDEX.DDF, and FIELDS.DDF) to be able to import or attach

   Btrieve files. The path statements in FILE.DDF may not be correct for

   the current environment.

RESOLUTION

   Inspect the path statements in FILE.DDF. Then either move the Btrieve

   data files to the locations specified in FILE.DDF, or Use Btrieve or a

   third-party tool to modify the FILE.DDF file so that the path statements

   to the data files are correct.

More Information:

Microsoft Access requires all three Xtrieve data dictionary files

(FILE.DDF, INDEX.DDF, and FIELDS.DDF) to be able to import or attach

Btrieve files.

FILE.DDF contains the MS-DOS file name of each data table in the

dictionary. These file names can be in any of the following valid MS-DOS

formats:

 -  File Only (For example, MYDATA.DAT)

 -  Relative Path (For example, ..\DEV\TEST\MYDATA.DAT)

 -  Fully Qualified (For example, C:\TOOLS\DEV\TEST\MYDATA.DAT)

 -  Universal Naming Convention -- UNC (For example,

   (\\MYSERVER\USERS\JOE\TOOLS\DEV\TEST\MYDATA.DAT)

When importing or attaching a Btrieve file, Microsoft Access retrieves the

MS-DOS file name from FILE.DDF and attempts to open the file. If the file

does not exist in the location specified, you will see this error:

   Couldn't find object

In the case of the File Only and Relative Path formats, the ability to open

the file depends on the correctness of current directory. For example, in

the File Only format, MYDATA.DAT must exist in the current directory. In

the Relative Path format, MYDATA.DAT must exist in the ..\DEV\TEST

directory, which in turn must exist relative to the current directory.

Exactly which directory is the current directory is complicated by the fact

that Windows-based applications all share the same environment and the same

current directory. For example, if you change the current directory in

Microsoft Excel by choosing Open from the File menu and changing

directories to open a file, you also change the current directory for

Microsoft Access.

Therefore, to fix the problem, you need to find out what path statements

are included in FILE.DDF. You can do this by opening FILE.DDF in Microsoft

Write, the word processor provided with Windows. When Microsoft Write asks

if you want to convert this file to Microsoft Write format, specify No

Conversion.

WARNING: do NOT save the file after you finish viewing it with Microsoft

Write. If you do, you will corrupt FILE.DDF beyond possible repair.

After opening FILE.DDF in Microsoft Write, you will see several characters

that look like a box. Scroll to the end of the file. There you will see the

MS-DOS file names of the Btrieve data files. The extension is usually .DAT,

but it does not have to be. Once you have noted the names and paths, close

FILE.DDF taking care to NOT save the changes.

Now that you have the file names, here are two things you can do

to fix the problem:

1. Move the files into the correct location(s). This is the easiest method

   and the one Microsoft recommends.

2. Use Btrieve or a third-party tool to modify the FILE.DDF file so that

   the paths are correct. This method is much more complicated. Microsoft

   recommends you do not attempt them unless you are a Btrieve expert.

References


INF: Btrieve 6.0 Data Type Does Not Work with Access

 Article Number: Q93687

 CREATED: 17-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access was not tested with Btrieve version 6.0. Therefore,

new data types introduced with this version of Btrieve may not be

compatible with Microsoft Access.

More Information:

Btrieve 6.0 introduced a new data type: Negative Sign Trailing Numeric

Field. Microsoft Access does not explicitly translate this data type.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 4, page 66

References


INF: Export Btrieve Table Without Existing Xtrieve FILE.DDF

 Article Number: Q93688

 CREATED: 17-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

To export a Btrieve table by using the Microsoft Access user interface, you

must ensure that an Xtrieve dictionary file (FILE.DDF) exists. If the

FILE.DDF file does not exist, use the macro action Transfer Database to

export the table.

More Information:

Multiple Btrieve tables can exist in Xtrieve databases just as Microsoft

Access databases can have multiple tables. The FILE.DDF file describes the

structure of the Xtrieve database.

Example

-------

The following sample macro (TransBtrieve) transfers the NWIND Customers

table to a Btrieve Table named Customers in an Xtrieve database named

C:\ACCESS\BTV00000.DAT. If C:\ACCESS is a valid directory, the export

occurs even if BTV00000.DAT does not exist.

Use the following as a guide to create the sample macro. Note that the

database name can be any complete file specification.

   Macro Name      Action

   ----------------------------------------

   TransBtrieve    TransferDatabase

   TransferDatabase Action

   -----------------------------------------

       Transfer Type: Export

       Database Type: Btrieve

       Database Name: C:\ACCESS\BTV00000.DAT

         Object Type: Table

              Source: Customers

         Destination: Customers

      Structure Only: No

Microsoft Access creates the following four files if they do not exist:

   FILE.DDF

   INDEX.DDF

   FIELD.DDF

   BTV00000.DAT

Transferring more than one table adds data to the existing files, but does

not create more files -- as long as the database name is not changed.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," page 86.

References


INF: How To Update a Table Based on Values in a Second Table

 Article Number: Q93690

 CREATED: 17-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

To transfer data between two different tables, create an additional

column in one of the tables which contains data that the two tables

have in common, then use an Update query to initiate the transfer.

More Information:

This can be illustrated by an example using the sample database

Northwind Traders (NWIND.MDB). This example adds a product name column

to the order details table, and then copies the product name from the

products table based on the product ID column.

Note: normally you would not duplicate the product name field because it

would result in duplicate data, which is not good database design. It is

done here as a simple illustration of an Update query involving two tables.

1. Modify the order details table:

   a. Open the order details table in design view.

   b. Add a column named product name, using the default data type of Text.

   c. Close the order details table, saving the changes.

2. Create the query:

   a. Create a new update query.

   b. Add the order details and product tables to the query. (The tables are

      automatically joined on product ID because there is a relationship

      already defined. If your tables are not joined, you need to join them

      on the original linking column.)

   c. From the Query menu, choose Update.

   d. (Optional)  From the View menu, choose Table Names. This is to ensure

      that the product name field in the Field cell is from the correct table,

      order details, which is critical.

   e. Drag the product name field from the order details table to the first

      field cell.

   f. In the Update To cell, type [Products].[Product Name].

   g. Run the query by clicking the Run button on the tool bar.

   h. Close the query.

A more realistic situation where this might be useful would be where a

database contained a table of products and prices. If the database user

was sent an ascii file containing product ID and new price for some of the

products, they could import the file, and then create an Update query as

described above to update the price field in the existing products table.

For more information about using an Update Query with two tables,

query on the following words in the Microsoft Knowledge Base:

   UPDATE and COUNTER and QUERY.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 7

References


INF: Additions to User's Guide Appendix A Specifications

 Article Number: Q93691

 CREATED: 17-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

This article includes additions to the "Microsoft Access User's Guide,"

version 1.0, Appendix A, "Microsoft Access Specifications," pages 633-635.

More Information:

                      Tables

                      -------

Attribute                                          Maximum

----------------------------------------------------------

Number of Primary Key fields and Matching Fields

  when defining a Relationship between tables       5

                      Queries

                      -------

Attribute                                          Maximum

----------------------------------------------------------

Number of characters in a cell                      255

Number of GROUP BY fields in a Totals query         10

Number of fields allowed when query property

  UniqueValuesOnly is selected (SELECT DISTINCT)    10

Number of ANDs in a WHERE clause (Criteria)         40

Number of ANDs in a HAVING clause                   40

References


PRACC9211: Unique Values Only Select Query Shows Duplicates

 Article Number: Q93692

 CREATED: 17-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: PRACC9211

SYMPTOMS

   The result of a query includes duplicate values even though you

   selected the Unique Values Only check box (SELECT DISTINCT) in the

   Query Properties dialog box.

CAUSE

   Duplicate values occur when both of the following conditions are met:

   1. The query input data set contains more than approximately 64K of data

      and the duplicate values are widely scattered in the input data.

      For example, a SELECT DISTINCT query on a text column with an average

      length of 20 characters will not display duplicate values unless the

      query input data set included more than 3,300 values (65536 / 20 =

      3276.8. Note that if the query is based on a table that has 10,000

      rows, but the specified criteria retrieves only 20 rows, it is the

      set of 20 rows that determines the size of the query input data set.

      In other words, it is the WHERE clause that determines the size of

      the query input data set.

   2. The values that have duplicates appear close (maybe in the first

      dozen values) to what would normally be the beginning of the query

      output. By default, a SELECT DISTINCT query displays data sorted

      implicitly. For example, the following displays the result sorted by

      Order ID:

         SELECT DISTINCT [Order Details].[Order ID]

         FROM [Order Details];

      However, in a SELECT DISTINCT query that uses more than one column

      and sorts by a column other than the first one, the duplicates could

      appear anywhere in the output. To see if there are duplicates, you

      need to remove the sort.

RESOLUTION

   In addition to SELECT DISTINCT queries, you can use GROUP BYs in a

   totals query to eliminate duplicates in the output. Both SELECT

   DISTINCT queries and GROUP BYs in a totals query are limited to

   10 columns. Usually, GROUP BY is faster when the resulting data set

   is much smaller than the input data set, and SELECT DISTINCT is

   faster when there are only a few duplicates.

   To ensure the correct results, use GROUP BYs in a totals query instead

   of using the Unique Values Only query property. For example, the

   following two select queries give identical results:

      SELECT DISTINCT [Order Details].[Order ID]

      FROM [Order Details];

      SELECT DISTINCTROW [Order Details].[Order ID]

      FROM [Order Details]

      GROUP BY [Order Details].[Order ID];

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access version

   1.0. We are researching this problem and will post new information here

   in the Microsoft Knowledge Base as it becomes available.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 6, "Designing Select

Queries," pages 128-130 and pages 142-148.

For more information, search for "DISTINCT," then "ALL, DISTINCT,

DISTINCTROW Predicates (SQL)" using the Help menu.

References


PRB: Outdated COMMDLG.DLL Error Message During Setup

 Article Number: Q93694

 CREATED: 17-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You may see the following error message dialog when you try to open a

   database:

      Outdated 'COMMDLG.DLL' Please Re-install Microsoft Access.

CAUSES & RESOLUTIONS

   1.  Check to see if you have more than one version of COMMDLG.DLL on

       your computer. Rename the duplicate versions of COMMDLG.DLL.

   2.  Make sure the COMMDLG.DLL file in the Windows system subdirectory is

       newer than:

         3/10/92   for version 3.1 of Microsoft Windows or

         10/01/92  for Microsoft Windows for Workgroups or

         10/25/92  for Microsoft Access

   3.  If you have a third-party COMMDLG.DLL, make sure it is compatible

       with Microsoft Access.

CC:Mail

confirmed.

More Information:

To search for all occurrences of COMMDLG.DLL, follow these steps:

1.  Exit Windows.

2.  Search for any other copies of COMMDLG.DLL on the current drive by

    entering the following commands at the DOS prompt:

      CD\

      DIR COMMDLG.DLL /s

    Repeat these commands on all other drives and rename or delete any

    copies of COMMDLG.DLL that you find. When you finish, there should

    be a single copy of COMMDLG.DLL on your computer in the Windows

    system directory.

How to install a new COMMDLG.DLL

--------------------------------

If you delete or rename all the duplicates of COMMDLG.DLL and continue to

get the error in Microsoft Access, copy COMMDLG.DL_ from Disk 1 of

Microsoft Access and EXPAND.EXE from Disk 3 of Windows 3.1. Then use

EXPAND.EXE to expand COMMDLG.DL_ as follows:

   c:\<path>\EXPAND <path>\COMMDLG.DL_ c:\windows\system\COMMDLG.DLL

Do not copy COMMDLG.DL$ from the Microsoft Access disks. Microsoft Access

Setup is required to decompress COMMDLG.DL$.

Other problems

--------------

When Microsoft Access Setup tries to update COMMDLG.DLL, it may give you an

error saying it was unable to access the file. In most cases, this means

another application is using COMMDLG.DLL.

To ensure that no other applications are running when you run Microsoft

Access Setup, add a new Program Group in Program Manager giving it a

Description of Temporary. Move all the icons from the StartUp Program Group

to the Temporary Program Group. Then edit the WIN.INI file to make the RUN=

and LOAD= lines in the [Windows] section look like this:

   [Windows]

   RUN=

   LOAD=

Then restart Windows and run Microsoft Access Setup.

If you continue to have trouble, edit the AUTOEXEC.BAT file to look for

conflicting terminate-and-stay-resident (TSR) programs.

Reference(s):

References


INF: Passing Values from a Form to a Parameter Query

 Article Number: Q93695

 CREATED: 17-DEC-1992

 MODIFIED: 22-APR-1993

Summary:

When you run a parameter query, Microsoft Access prompts you to enter

each parameter in a separate dialog box. This article explains how to

create a form that will collect all the values for a parameter query.

More Information:

The following step-by-step example uses a table (Orders) from the Northwind

Traders sample database (NWIND.MDB) supplied with Microsoft Access. The

example shows you two things: how to create a form that prompts for a date

value and how to add a command button to the form to execute the query.

1. Open the sample NWIND.MDB database.

2. Create a query based on the Orders table. Add the following field

   names with the specified criteria and save the query as MyQuery.

      Field             Criteria

      ---------------------------------------------

      Customer ID

      Order ID

      Order Date        > [Forms]![MyForm]![MyDate]

3. Create a new macro with the following action argument, and save it

   as MyMacro.

      Action       Action Argument    Value

      ---------------------------------------

      OpenQuery    Query Name         MyQuery

4. Create an unbound, blank form by leaving the Select A Table/Query box

   empty and clicking the Blank Form button.

5. Place a text box control on the form and set the following

   properties:

      Text Box

      --------

      ControlName: MyDate

      Format: Short Date

6. Bring the Database window to the front by pressing F11.

7. Select the Macro button with the mouse, and drag MyMacro onto the

   form. This will generate a command button with the OnPush property set

   to call MyMacro.

8. Click in the Form window to bring it to the front, and then save the

   form as MyForm.

9. Switch to Form view, enter a date such as 1/1/91, and then click the

   MyMacro button. This will execute the macro MyMacro that runs the

   query MyQuery using the date entered in the MyDate text box as the

   query parameter.

References


INF: How to Dial a Phone Number in MS Access

 Article Number: Q93696

 CREATED: 17-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

There are no built-in commands or functions in Microsoft Access that

allow you to dial a phone number through a serial port. However, it

can be accomplished programmatically. This article discusses a method

that uses Microsoft Windows Application Programmer Interface (API)

function calls to dial a phone number in Microsoft Access. Using this

information, you can dial a number by creating a new form and module,

or apply the code to an existing form and module.

This article assumes that you are familiar with Access Basic and

Microsoft Windows APIs. In this article the use of error trapping and

the use of the communication APIs has been minimized to keep the

information as clear and concise as possible.

More Information:

To dial a phone number in Microsoft Access, you utilize the Microsoft

Windows APIs in the Dynamic Link Library (DLL) USER.EXE. There are

seventeen communications APIs that are available in the USER library;

of these, three particular communication APIs are necessary to dial

phone numbers: OpenComm(), CloseComm(), and WriteComm().

Listed below are instructions for creating a simple form and module

that dial a phone number through a modem based on the contents of

two controls on a form. A more elegant solution can be created by

passing arguments to the function and using CASE statements to deal

with the potential errors that can be returned by the APIs.

To run this example:

1. Create a form called fDialer.

2. Place two unbound Text Box controls on the form. One Text box will

   be for identifying the serial port the modem is attached to, and the

   other text Box will hold the phone number to dial.

      Object: Text Box

      ------------------------

      Control Name: CommPort

      Object: Text Box

      ------------------------

      Control Name: PhoneNumber

3. Place a command button on the form and assign the OnPush property

   to a function you will create later named DialNumber().

      Object: Command Button

      --------------------------------

      OnPush: =DialNumber()

4. Create a new module, enter the code below, and save it as Comm DLL.

   ' Note: Each command should be entered on one line. The line

   ' continuation character '_' improves the readability of the code.

   '********************************************************

   'Declarations section of the module

   '********************************************************

   Option Compare Database

   Option Explicit

   Declare Function OpenComm% Lib "User" (ByVal lpComName$, _

                       ByVal wInQueue%, ByVal wOutQueue%)

   Declare Function CloseComm% Lib "User" (ByVal nCid%)

   Declare Function WriteComm% Lib "User" (ByVal nCid%, ByVal lpBuf$,_

                       ByVal nSize%)

   Const ID_CANCEL = 2

   '===============================================================

   ' The following function is named DialNumber().

   ' The variables in this function are local to the function since

   ' they have been DIMed in the function.

   '

   ' The following function will initialize the variables:

   '

   ' - sCommPort$ to the value entered in the control on the form

   ' - sPhoneNumber$ to the value entered in the control on the form

   ' - sDial$ to the dial command and the phone number to dial

   ' - iWritePort% to the return value of the API WriteComm function

   ' - iOpenPort% to the return value of the API OpenComm function

   ' - iClosePort% to the return value of the API CloseComm function

   ' - iCharCount% to the length of sDial$ variable

   ' - iStart% to the number of seconds since midnight

   '

   ' - Comm port is entered on the form fDialer!CommPort

   '================================================================

   Function DialNumber ()

      Dim sCommPort$

      Dim sPhoneNumber$

      Dim sDial$

      Dim iWritePort%

      Dim iOpenPort%

      Dim iClosePort%

      Dim iCharCount%

      Dim iStart#

      Dim Response%

      sCommPort$ = Forms!fDialer!CommPort

      sPhoneNumber$ = Forms!fDialer!PhoneNumber

      sDial$ = "ATDT" & sPhoneNumber$ & Chr$(13)+ Chr$(10)

      iCharCount% = Len(sDial)

      iOpenPort% = OpenComm(sCommPort$, 1024, 128)

      If (iOpenPort% < 0) Then

         MsgBox "Unable to Dial Number: Make sure no other devices_

                 are using the Communications Port.", 16, "Error Dial_

                 Failed"

      End If

      '===============================================================

      ' - iWritePort% sends the phone number to the modem

      '

      ' If this is successful, the start time is returned and a loop

      ' for 3 seconds is started to allow time for the modem to dial

      ' before displaying a message box.

      ' The user can cancel the operation and the modem hangs up.

      ' If the modem cannot dial, there may be a problem writing to the

      ' port.

      ' The comm port is closed at the end of the module to make it

      ' available to other applications.

      '===============================================================

      iWritePort% = WriteComm(iOpenPort%, sDial, iCharCount%)

      If (iWritePort% > 0) Then

         iStart# = Timer

         Do

         Loop Until Timer >= iStart# + 3

         Response% = MsgBox("Pick up the Phone and Press OK or Cancel_

                             to Quit and Hang up.", 65, "Dialing_

                             Successful")

         If Response% = ID_CANCEL Then

            'Reset the modem and take it off line.

            iWritePort% = WriteComm(iOpenPort%, Chr$(13), 1)

         End If

      Else  'Otherwise Writing to Port must have failed.

         MsgBox "Unable to Dial Number: Make sure no other devices_

                 are using the Communications Port.", 16, "Error Dial_

                 Failed"

      End If

      iClosePort% = CloseComm(iOpenPort%)

   End Function

10. Save the Module.

11. Open the form fDialer and enter the serial port (example: COM1 or

    COM2) in the CommPort control that your modem is attached to.

    Enter a phone number in the PhoneNumber control. Click on the Dial

    button. The modem should dial the phone number specified.

References


INF: How To Get Microsoft Works Files into Access

 Article Number: Q93698

 CREATED: 17-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access does not directly import the Microsoft Works for

Windows or Microsoft Works for MS-DOS database (.WDB) file format.

Microsoft Access does, however, import any version of Microsoft Works

spreadsheet (.WKS) files. This article explains how you can transfer

your database and spreadsheet files from Microsoft Works into

Microsoft Access tables.

More Information:

You can import spreadsheet files (.WKS) directly into Microsoft

Access. To import database files you should save them as dBase III or

IV files, or convert them to Works spreadsheet files first.

Microsoft Works for Windows Database files

------------------------------------------

Database files created in Microsoft Works can be imported by Microsoft

Access if they are converted to a dBase III or IV file format. The

conversion retains field names and most data types, with these

exceptions:

 - Currency fields are converted to Number fields.

 - Fields defined as formulas are converted to Number fields with

   values.

Conversion process:

1. Start Microsoft Works and open your Works database file.

2. From the File menu choose Save As.

3. Using the "Save File as Type" combo box, change the format to dBase

   III or dBase IV.

4. Change the name of the file so it has a .DBF extension and choose

   OK.

5. Start Microsoft Access and open the .MDB file you want to import

   to.

6. From the File menu choose Import.

7. Select dBase III or dBase IV from the format list.

8. Select the name of your .DBF file from the list. If it does not

   appear in the list you may need to change the drive and directory

   to the correct location.

9. Select the Import button. The file is imported as a Microsoft

   Access table with the same name as the .DBF file.

Microsoft Works for MS-DOS Database files

-----------------------------------------

Save your Microsoft Works 2.0 database files in the format "Text &

Commas". Microsoft Access imports this file type as Text (delimited)

files.

Save your Microsoft Works 3.0 database files in dBase III or dBase IV

format following the method outlined above.

Microsoft Works spreadsheet files (either version)

--------------------------------------------------

Spreadsheet files, created in either the MS-DOS or Windows version of

Works, can be imported by Microsoft Access with little effort. If the

first row of the spreadsheet contains a name for each column this can

be recognized as the name of each field in the new Microsoft Access

table. If there is only data in the spreadsheet Microsoft Access

creates default field names for the table. Most data types are

retained, with these exceptions:

 - Fields formatted as TRUE or FALSE are converted to Number fields.

   A FALSE value is converted to 0 and a TRUE value is converted

   to 1.

 - Formula fields are converted to Number fields with values.

Conversion process:

1. Start Microsoft Access and open the .MDB file you want to import

   the Microsoft Works spreadsheet file to.

2. From the File menu, choose Import.

3. Select Lotus (WKS) from the format list.

4. Select the name of the .WKS file from the list. If it does not

   appear, you may need to change the drive and directory to the

   correct location.

5. If the first row of the spreadsheet contains the column names,

   select the option "First Row Contains Field Names".

6. Select the Import button. The file will be imported as a Microsoft

   Access table with the same name as the .WKS file.

Depending upon the type of data in your Microsoft Works files, you may

choose either method to convert files to Microsoft Access tables.

For more information about sharing Microsoft Works data with other

progams, see the "Microsoft Works User's Guide".

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 64-65, pages 72-75

References


INF: Access Cannot Attach or Import Paradox 4.0 Tables

 Article Number: Q93699

 CREATED: 17-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

Version 1.0 of Microsoft Access supports attaching to and importing from

Paradox 3.x tables. Microsoft Access does not support attaching to Paradox

4.0 tables. If you attempt to attach to a version 4.0 table, you will be

prompted for a password.

More Information:

If you are prompted to enter a password when you attach to a Paradox

table, and you know that there is no password for the table, it is

possible the table is a Paradox 4.0 file.

To use data created in Paradox 4.0, use Paradox to restructure the table in

version 3.5 format. Paradox provides the capability to create files in

Compatible format; this will create files in version 3.5 format.

In Paradox, you can save a Paradox 4.0 table in version 3.5 format by

following these steps:

1. Copy the Paradox 4.0 table.

2. In Paradox, run the Modify/Restructure menu command.

3. Enter the name of the table.

4. Choose FileFormat/Compatible from the menu.

5. Press F2 to save the file in the restructured format.

For more information on restructuring Paradox tables, see the Paradox 4.0

documentation.

Paradox is manufactured by Borland International, a vendor independent of

Microsoft. Microsoft makes no warranty, implied or otherwise, regarding

this product's performance or reliability.

References


PRB: Microsoft Access Appears to Hang During Database Compact

 Article Number: Q93717

 CREATED: 20-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When Microsoft Access performs a database compact operation, the

   status bar indicates the percentage of the task that is complete.

   At times, the status bar may remain on one value for a very long

   time and it may appear that Microsoft Access has hung. However, in

   most cases when this occurs, Microsoft Access continues to work on

   the compact operation.

CAUSE

   When Microsoft Access performs a database compact operation, it

   copies each object in the database into a new database. Because

   different objects have different sizes, some objects require more

   time to copy into the new database. The value displayed in the

   status bar indicates the percentage of the number of objects

   copied, not the percentage of the total size of all objects copied.

RESOLUTION

   This behavior is by design.

More Information:

For example, if your database contains a very large table, the

displayed percentage could go up to 90% rather quickly and then remain

static while Microsoft Access copies the table. While Microsoft Access

copies the table, it may appear to be hung. The 90% value indicates

that 90% of the objects have been copied; it does not indicate that

90% of the processing is complete.

Reference(s):

"Microsoft Access User's Guide", version 1.0, page 627.

References


PRB: Unable to Change Permissions (Security)

 Article Number: Q93718

 CREATED: 20-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you try to open an object or change permissions for an account,

   you receive one of the following error messages:

      You can't view this object's permissions.

     -or-

      No permission for <object name>.

CAUSE

   Only the database creator, or a member of the Admins group, has full

   permissions to all database objects. This person is also the only user

   who can assign or unassign security permissions.

STATUS

   This behavior is by design.

RESOLUTION

   Contact your database administrator. If you are the database

   administrator, check to make sure you are logged in as a user who is a

   member of the Admins group. If you still have the original user Admin,

   make sure it is a member of the Admins group and try again.

For more information search for "Error Messages: Reference" using the

Help menu.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 25,

"Administering a Database System," pages 609-629

References


PRB: Changes to Shared Module Are Kept Local Until MDB Closed

 Article Number: Q93719

 CREATED: 20-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Two or more workstations open a shared Database (MDB) that has at

   least one module. Changes are made to the module by workstation A.

   The module is then saved by workstation A. Workstation B opens the

   same module and does not see the changes made on workstation A.

STATUS

   This behavior is by design.

More Information:

The only way to update modules is to close and reopen the database.

Microsoft Access loads all modules once when the database is opened.

Changes made by one workstation will not affect any other

workstation(s) until the database is closed and then reopened.

References


PRB: DDE Statements Invalid in List Box or Combo Box Control

 Article Number: Q93720

 CREATED: 20-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 13993

SYMPTOMS

   If you place a dynamic data exchange (DDE) function as the

   ControlSource of a list box or combo box, you will receive a #Error

   in the list box when viewed in Browse mode. However, if you view

   the form in Datasheet mode, the first object in the DDE data will

   show up.

   Placing a DDE function in the RowSource property causes an error

   message in both Browse and Datasheet modes of the form.

STATUS

   This behavior is by design.

More Information:

The ControlSource property of a list box or combo box may be blank if

the control is unbound, or may contain the name of the field that the

control is bound to; it may not contain a function.

The RowSource property of a list box or combo box may contain a list

of values, the name of a table or query, or an SQL string. This

property provides the list of values the user may select from.

Steps to Reproduce Behavior

---------------------------

1. Open an Excel spreadsheet and enter some text in Row 1, Column 1.

   Save the spreadsheet as TEST.XLS.

2. Create a new form in Microsoft Access and place a list box on the

   form.

      Object: Listbox

      ---------------

      ControlSource: =DDE("Excel","Test.xls","R1C1")

3. Make sure TEST.XLS in Excel is open.

4. View the form in Browse mode. Notice that there is a #Error in

   the list box.

5. View the form in Datasheet mode. Notice the data from Excel is now

   there.

Workaround

----------

Using Access Basic, you can create a list function that returns to a

list box or combo box. You may use any Access Basic routine to obtain

the information used in the list, including DDE commands. The list

function is documented on pages 83 through 85 of the "Microsoft Access

Introduction to Programming" manual. Coding dynamic data exchange is

documented in chapter 9 of the same manual.

References


PRB: Column in QBE Grid Keeps Focus After Clicking Field List

 Article Number: Q93721

 CREATED: 20-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   After you select a column in the QBE grid, the column doesn't lose

   focus when you click a field list in the upper-portion of the Query

   window.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new query and add a table to it.

2. Drag a few columns to the query grid.

3. Select a column in the query grid by clicking the column selector

   above the field box.

4. Click the field list for the table.

The query grid column does not lose the focus.

Pressing the DEL key at this point removes the table and all the

information in the query grid.

References


PRB: Microsoft Access Cannot Paste Entire Column in Query Grid

 Article Number: Q93722

 CREATED: 20-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you use the Query Grid, an attempt to cut and paste (or to

   copy and paste) an entire column places incorrect results into the

   target column.

RESOLUTION

   Before you paste information from the clipboard, select an object

   that has the same size as the information in the clipboard. In this

   example, select the entire column when you paste the information

   into the query grid.

STATUS

   This behavior is by design.

More Information:

Perform the following four steps to demonstrate this behavior.

Steps to Reproduce Behavior

---------------------------

1. Create a query.

2. Select an entire column in the Query Gird (click the mouse once at

   the top of a column when the mouse cursor changes to a down arrow).

3. From the Edit menu, choose either Cut or Copy.

4. Select a cell (to paste the copied column into) and choose Paste

   from the Edit menu.

The pasted values are not correct. This behavior occurs pasting into

any object in Microsoft Access.

References


PRB: Hourglass May Not Change After Illegal Function Call

 Article Number: Q93723

 CREATED: 20-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A user can change the mouse pointer from an arrow to an hourglass

   cursor with a user-defined function in Access Basic. If the user

   encounters an illegal function, or halts the code after setting the

   pointer to an hourglass, the hourglass cursor does not change back

   to the arrow pointer. However, you can still open and close items

   by clicking on them.

STATUS

   This behavior is by design. Access Basic will never reset Echo,

   Warnings, or Hourglass when run from Access Basic. These are only

   reset when the last script runs.

RESOLUTION

   You can type "DoCmd Hourglass False" in the Immediate window to

   get the pointer back while in design of the module.

More Information:

Microsoft Access does not reset Echo, Warnings, or Hourglass when run

from Access Basic code. Access only resets them when the last script

runs. Because an illegal function call stopped the execution of the

function before the command to reset the mouse pointer from an

hourglass to an arrow, the mouse pointer remains in the hourglass

state.

Reference(s):

"Microsoft Access Basic: An Introduction to Programming," chapters 1-5

"Microsoft Access Language Reference," version 1.0, Part 1

References


PRB: 'Generic/Text Only' Driver Print Quality List in Error

 Article Number: Q93724

 CREATED: 20-DEC-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   When you select "Generic/Text Only" as your printer, the Print

   Quality list in the Print dialog box contains only four options:

   High, Medium, Low, and Draft.

CAUSE

   This behavior occurs because each printer driver, regardless of its

   capabilities, has all four options built in. In some cases, as in

   the "Generic/Text Only" driver, all four options perform the same

   function. In other drivers, the Print Quality list shows only valid

   options.

STATUS

   This behavior is by design in Microsoft Access.

References


PRACC9301: Non-TrueType Fonts with 8514.DRV Causes GP Fault

 Article Number: Q93725

 CREATED: 20-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 14023

SYMPTOMS

   Using fonts other than TrueType fonts with the Windows 8514.DRV video

   driver may cause a general protection (GP) fault or other problems.

RESOLUTION

   Use TrueType fonts with the Windows 8514 driver.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access version

   1.0. We are researching this problem and will post new information here

   in the Microsoft Knowledge Base as it becomes available.

More information:

Steps to Reproduce Problem

--------------------------

Scenario 1

----------

1.  Design a new form. Make it about eight inches wide.

2.  Drop in a label.

3.  Set the font to MS Sans Serif 8pt if it isn't already.

4.  Type a long text line that spans about five inches.

5.  Size the box to fit the entire line of text on one line.

6.  Type 127 for the point size.

7.  Choose Size to fit from the Layout menu.

8.  Note the interesting overlapping text at the beginning.

9.  Set bold on.

10. Set italics on -- this takes a while.

Notice the interesting racing lines. This only happens when you use fonts

other than TrueType fonts. For example, if you use Arial, everything looks

fine.

Scenario 2

----------

1. Design a new form and make it 22 inches wide.

2. Drop in a label.

3. Set the font to Arial 8pt Bold if it isn't already.

4. Type a long text line that spans about 18 inches.

5. Size the box to fit the entire text line on one line.

6. From the toolbar, select MS Sans-Serif for the font.

What happens varies, but in the end you always receive a message saying

Microsoft Access caused a GP Fault in 8514.DRV.

References


PRB: Overlapped Printing an Access Query Using TTY.DRV

 Article Number: Q93726

 CREATED: 20-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you print a query using the Windows Generic Text Only printer

   driver (TTY.DRV), the print overlaps on every sixth or seventh line.

RESOLUTION

   The TTY.DRV driver can print only six lines per inch. You must set the

   row height to 12 point to make the line spacing to work correctly with

   this printer driver. To change the row height, choose the Row Height

   from the Layout menu, and type "12" (without the quotation marks).

   This allows the TTY.DRV to print your query without overlapping text.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Problem

--------------------------

1. Open a query.

2. From the File menu, choose Print Setup.

3. Select the Specific Printer option button, and select Generic Text

   Only from the list of printers. (This driver must be installed on your

   machine for this to option to appear.) Choose the OK button.

4. From the Query menu, choose Run.

5. From the File menu, choose Print, then choose the OK button.

Approximately every sixth line of print is overlapped.

References


PRB: Cannot Import YYMMDD Dates in Fixed-Width Text Files

 Article Number: Q93727

 CREATED: 20-DEC-1992

 MODIFIED: 25-APR-1993

Summary:

SYMPTOMS

   Microsoft Access will not import fixed-width text files if there

   is a date field in the text file formatted as YYMMDD.

CAUSE

   Microsoft Access does not recognize the YYMMDD date format in text

   files, and will generate an error log when trying to import a text

   file that includes a date in this format. The error log will show a

   "Type Conversion Failure." The file will not import.

RESOLUTION

   One workaround is to format the date as MMDDYY.

   Another workaround is to import the YYMMDD field as a six-character

   text field. Next, create a new field in the table called, for

   example, NewDate, with a data type of Date/Time. Then run an

   update query to derive the NewDate field from the OldDate field

   as follows:

   Note: In the following sample code, an underscore(_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Microsoft Access.

   Query: ReformatDate

   -------------------------------------------------------

   Field Name: NewDate

   Update to: Mid([OldDate],3,2) & "/" & Right([OldDate],2) & _

                  "/" & Left([OldDate],2)

STATUS

   This behavior is by design.

More Information:

When importing a fixed-width text file with a date field formatted as

YYMMDD, Microsoft Access generates an Import Error log table, but

does not import the data. If you try to import the text file as

delimited the data is imported, but Microsoft Access changes the

format from date to number or text, depending upon the date delimiter.

References


PRACC9301: HPPCL5A Printer in DEBUG Windows Causes GP Fault

 Article Number: Q93728

 CREATED: 20-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 12785

SYMPTOMS

   Printing on a HPPCL5A printer while using the DEBUG version of Windows

   3.1 causes a general protection (GP) fault and generates the following

   error message:

      err ACCESS->HPPCL5A GLOBALSIZE+C: Invalid global handle: 0x000

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. Microsoft is researching this problem and will post

   new information here as it becomes available.

More Information:

Steps to Reproduce Problem

--------------------------

1. Use DEBUG Windows.

2. Open a database.

3. Create a new report.

4. Place two labels that overlap on the report.

5. Set the printer to the HPPLC5A printer. Then choose Print from the

   File menu.

References


PRB: Microsoft Access Can't Recognize SQL Server Double Index

 Article Number: Q93925

 CREATED: 21-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Microsoft Access does not recognize a SQL Server table index if the

   index has a DOUBLE data type.

STATUS

   This behavior is by design.

More Information:

Microsoft Access requires a unique index on any SQL Server table for

updates (editing), and it cannot use the data type DOUBLE as a unique

index. After reading the DOUBLE index value on the server, Microsoft Access

converts the value from binary to decimal and back to binary, causing

rounding errors, before storing it in a Microsoft Access virtual table

(VT). The same conversion process occurs when Microsoft Access sends the

value back to the server for an update. Microsoft Access uses the index

value to find the row in the table where the update is needed. Because of

the rounding errors, Microsoft Access cannot find the correct row to make

the update, so the update fails. Because updates cannot be made on this

type of index, even though it may be unique, Microsoft Access ignores the

index.

Reference(s):

References


INF: Copying and Pasting Text in a Property Sheet

 Article Number: Q93926

 CREATED: 21-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

You cannot use the Edit menu's Copy or Paste command to edit text in a

property sheet.

Instead, use the equivalent keystroke combinations for the Copy and

Paste commands. CTRL+C copies information to the clipboard, while

CTRL+V pastes information from the clipboard.

References


INF: Repeat Group Name at the Top of New Column or Page

 Article Number: Q93927

 CREATED: 21-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes how to create a report that prints "continued" or

"Group Name continued" at the top of each new column or page when grouped

information flows from one column or page to another. At the end of this

article, you'll find sources for additional information on multiple-page

and multiple-column report formats.

More Information:

Microsoft Access prints a single group header at the beginning of a group

to identify the beginning of the group. It does not repeat the header at

the top of subsequent columns or pages. However, you can use the procedure

described below to force a report to repeat the group name if the detail

records in a group span several columns or pages.

Three-step Process

------------------

The report uses macros to identify the group. It uses the Top property to

determine whether a detail section is being formatted at the top

of a column or page. If it is, the report shows the contents of the text

box that contains the group name and "continued," and it hides the other

controls in the detail section. It is a three-step process.

Step One: Create a New Macro Group Containing Three Macros

----------------------------------------------------------

You need a macro group (Continued) containing three macros (Page Reset, Set

Top1, and Print) to check for certain conditions and perform specific

actions based on those conditions. By setting conditions, you give the

macro the branching characteristics of a program without using a

programming language.

The Page Reset macro sets the value of the Top1 text box to the value of

the Top property if the current value of Top1 is 0 when Microsoft Access

formats the group header.

The Set Top1 macro sets the value of the Top1 text box to 0 when

Microsoft Access formats the page header.

The Print macro sets the value of the Top1 text box to the value of the Top

property if the value of Top1 is 0 when Microsoft Access formats a detail

section. Or if the Top property is equal to the value of the Top1 text box,

it sets the Visible property of the Continued text box to Yes and the

Visible property for each of the controls in the detail section to No. It

also sets the NextRecord property to False. Otherwise, it hides the message

and prints the detail record.

To create the macro group:

1. Choose to create a new macro.

2. From the View menu, choose Macro Names or click the Macro Names button

   on the tool bar.

3. From the View menu, choose Conditions or click the Conditions button

   on the tool bar.

Microsoft Access displays the complete grid in the Macro window including

the Macro Name, Condition, and Action columns.

4. Enter the macro names, conditions, actions, and action arguments using

   the following two tables as a guide. Use the first table to fill the

   grid and use the second to add action arguments to each action. Do not

   enter the reference letters: [a], [b], [c], and so on. These reference

   letters are there to help you associate the actions shown in the first

   table with the action arguments shown in the second table.

      Macro Name   Condition    Action

      -----------------------------------

      Page Reset                SetValue     [a]

      Set Top1     [Top1]=0     SetValue     [b]

      Print        [Top1]=0     SetValue     [c]

                   Top=[Top1]   SetValue     [d]

                   ...          SetValue     [e] -- repeat for each control

                   ...          SetValue     [f]

                   ...          StopMacro    [g]

                                SetValue     [h]

                                SetValue     [i] -- repeat for each control

   The ellipses in the Condition column are required for lines e, f, and g;

   enter them exactly as shown. Microsoft Access evaluates macro conditions

   as true or false. If the expression is true, Microsoft Access performs

   the action. If it's false, Microsoft Access ignores the action. The

   ellipses in the Condition column force Microsoft Access to perform the

   action on that line if the condition on the preceding line is true.

   Here's the second table. It gives the action arguments for each action:

            Action       Action Arguments

            -----------------------------------------

      [a]   SetValue     Item: [Top1]

                         Expression: 0

      [b]   SetValue     Item: [Top1]

                         Expression: Top

      [c]   SetValue     Item: [Top1]

                         Expression: Top

      [d]   SetValue     Item: [Continued].Visible

                         Expression: Yes

      [e]   SetValue     Item: [Fieldx].Visible

                         Expression: No

      [f]   SetValue     Item: NextRecord

                         Expression: False

      [g]   StopMacro

      [h]   SetValue     Item: [Continued].Visible

                         Expression: No

      [i]   SetValue     Item: [Fieldx].Visible

                         Expression: Yes

5. Replace Fieldx in SetValue action lines e and i with the actual name of

   the control. For each additional control, add another action line e and

   another action line i to the grid. Place the additional action e lines

   with the original action e line, and the additional i lines with the

   original i line.

6. Save the macro group, and specify Continued as the name. This makes

   Continued the name of the macro group. It now appears in the list of

   macros and macro groups in the Database window. Use the following syntax

   to specify each macro in the macro group when you attach a macro to a

   property on the report:

      macrogroupname.macroname

   For example, the following specifies the Print macro: continued.print

Step Two: Attach the Macros to the Report

-----------------------------------------

1. Open the desired report in Design view.

2. Set the following properties for the specified sections by selecting

   each section with the mouse and viewing its properties:

      Section Name     Property     Expression

      --------------------------------------------------

      Page Header      OnFormat     Continued.Page Reset

      Group Header     OnFormat     Continued.Set Top1

      Detail           OnFormat     Continued.Print

                       CanShrink    Yes

      Group Footer     OnFormat     Continued.Set Top1

   This sets the Top1 control to the current value of the Top expression

   to keep track of the current twip value (position) of the top.

Step Three: Add Controls to the Report and Set Properties

---------------------------------------------------------

1. Open the report in Design view.

2. Create an unbound text box control named Top1.

3. Place the Top1 text box control in the first group header section.

4. Assign the following property values to the Top1 text box control:

      Property         Expression

      ---------------------------

      ControlName:     Top1

      Visible:         No

5. In the detail section, create a text box bound to an expression. Locate

   it near the top in the same vertical location as that of the group

   header label. Assign the following property values to the text box:

      Property         Expression

      ----------------------------------------------------------------

      ControlName:     Continued

      ControlSource:   =[Control Name being grouped] & " continued"

      Visible:         No

      CanShrink:       Yes

6. Save and run the report.

The approach described here works well for both single-column and

multiple- column reports, but there is a simpler method you can use

for a single- column, multiple-page report. For more information,

query on Continued and Groups here in the Microsoft Knowledge Base.

For more information on how to make the page header span the full

width of a multiple-column report, query on Span and Width here in the

Microsoft Knowledge Base.

For more information, search for "multiple-column reports," then "Creating

Snaking Columns on a Report" using the Microsoft Access Help menu.

Also, see the "Microsoft Access User's Guide," version 1.0, Chapter 19,

"Sorting and Grouping Data."

References


PRB: Exporting Table with OLE Object or Memo Field to Paradox

 Article Number: Q93928

 CREATED: 21-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you export a table from Microsoft Access that contains a field

   with an OLE Object or Memo data type in Paradox 3.x format, the

   resulting Paradox table contains one entry that says m_i_c_r_o_s_o_f_t.

   You can see this result by importing the Paradox table you just exported

   and then opening the table.

More Information:

Steps to Reproduce Behavior

---------------------------

1. In Microsoft Access, copy any existing table to a new name.

2. In Design view, add an OLE Object field or Memo field to the copied

   table.

3. After saving and closing the table, export it choosing Paradox 3.x as

   the data destination and TESTFLD.DB as the name. You will get this

   error: "Invalid Data Type." However, the TESTFLD.DB file is created.

4. Import TESTFLD.DB using Paradox 3.x as the Data Source.

5. Open the resulting table. You will see a table consisting of one field

   with the field name m_i_c_r_o_s_o_f_t and the data type Number, but

   there is no data in the table.

Paradox is manufactured by Borland International, a vendor independent of

Microsoft; we make no warranty, implied or otherwise, regarding this

product's performance or reliability.

References


INF: How to Open UTILITY.MDA

 Article Number: Q93929

 CREATED: 21-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

If you try to open UTILITY.MDA, you will receive the following error

message:

   The database 'UTILITY.MDA' is already open as a library database.

To open UTILITY.MDA, you must create a copy of UTILITY.MDA with a

different name and then open this copy within Microsoft Access.

More Information:

To open UTILITY.MDA:

1. Copy UTILITY.MDA to UTILITY.SAV.

2. Within Microsoft Access, open UTILITY.SAV by choosing the Open

   command from the File menu.

3. Choose OK when the following error messages are displayed:

   Tried to load module with duplicate procedure definition: BuilderZoom

   Tried to load module with duplicate procedure definition: DDB

UTILITY.MDA is a collections of tables, forms, and modules used by

Microsoft Access. You should always have a backup copy of UTILITY.MDA

because this is a vital database needed by Microsoft Access, and any

changes could result in unexpected behavior.

References


PRACC9301: Finance Function in Crosstab Query Causes GP Fault

 Article Number: Q94002

 CREATED: 22-DEC-1992

 MODIFIED: 24-JUN-1993

Summary:

PROBLEM ID: PRACC9302

SYMPTOMS

   When using a FormWizard to create a form based on a Crosstab query,

   you get a general protection (GP) fault if the query contains a

   financial function. The following error message is displayed:

      GPF in MSABC100.DLL at 0004:7BBC (retail)

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. Microsoft is researching this problem and will post

   new information here as it becomes available.

More Information:

Steps to Reproduce Problem

--------------------------

1. Create the following query:

   Query: Mortgage Analysis

      TRANSFORM First(CCur(PV([Rate]/12,[NPer],-[Pmt],[FV],[Due])))

      AS LoanAmount

      SELECT Format([Rate],"Percent") AS IntRate

      FROM PV

      GROUP BY Format([Rate],"Percent")

      PIVOT Format([Pmt],"$#,#00")

      WITH OWNERACCESS OPTION;

2. Select the query called 'Mortgage Analysis' and push the NewForm

   button on the Toolbar, then choose Form Wizards.

3. Select Single-column and push OK.

Note: If you add Fixed-Column Headings, things work until you press

Open.

References


INF: How to Use DDE to Fill a List Box

 Article Number: Q94003

 CREATED: 22-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

This article contains an example of an Access Basic list function

that uses dynamic data exchange (DDE) to populate a list box.

The example assumes that you are familiar with DDE, how to create

modules in Access Basic, and how to create list boxes on forms.

More Information:

The function below will use DDE to retrieve a list of countries from

Microsoft Excel. The list will be used to populate a list box bound to

the Country field of the Suppliers table in the sample database

Northwind Traders (NWIND.MDB).

 1. In a new worksheet in Excel, enter the following in the first

    column:

       A1  Australia

       A2  China

       A3  Scotland

 2. Save the worksheet as COUNTRY.XLS.

 3. Open NWIND.MDB in Microsoft Access and open a new module.

 4. Place the following in the Declarations section:

       Option Explicit

       Dim Countries(10) As String

       Dim CountryData As String

 5. Create the following subroutine:

      Sub DDEFillCountries ()

         Dim EndString%, i%

         Dim Chan

         EndString% = 0

         i% = 0

         Chan = DDEInitiate("Excel", "COUNTRY.XLS")

         CountryData$ = DDERequest(Chan, "R1C1:R10C1")

         DDETerminate Chan

         EndString% = InStr(1, CountryData, Chr(10))

         Do Until Len(CountryData$) = 0

            Countries(i%) = Left(CountryData, EndString% - 1)

            EndString% = InStr(1, CountryData, Chr(10))

            CountryData$ = Right(CountryData, _

                         Len(CountryData) - EndString% - 1)

            i% = i% + 1

         Loop

      End Sub

 6. Create the following function:

      Function DDEFillList (fld As Control, id, row, col, code)

         Static MonthNum

         Select Case code

            Case 0

               Call DDEFillCountries

               DDEFillList = True

            Case 1

               DDEFillList = id

            Case 3

               DDEFillList = 12

            Case 4

               DDEFillList = 1

            Case 5

               DDEFillList = -1

            Case 6

               DDEFillList = Countries(row)

         End Select

      End Function

 7. Save the module as DDE Fill List Box.

 8. Create a new form based on the Suppliers table.

 9. Add a list box bound to the Country field and set the following

    properties:

      RowSourceType: DDEFillList

10. Verify that Excel is running and the worksheet COUNTRY.XLS is

    open. Switch to browse mode. The list box should now be populated

    with the countries that you entered into Excel.

Note: This article demonstrates a simple example and is not a complete

robust function. If you intend to use this with a form, there are

several things that you may want to add to your code:

 - Error checking for the DDE portion to handle cases where Excel is

   not running or is busy.

 - The example assumes that there are ten countries listed in Excel.

 - This list function does not return the number of rows in the data

   to Microsoft Access.

 - The form may need to be refreshed to show updated data.

Reference(s):

Microsoft Access "User's Guide," version 1.0, chapter 9

"Microsoft Access Basic: An Introduction to Programming," version 1.0,

page 82

References


INF: Installing Microsoft Access on a Diskless Workstation

 Article Number: Q94010

 CREATED: 22-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

The third paragraph on page 658 of the "Microsoft Access User's guide,"

version 1.0, states that a workstation that runs Microsoft Access from the

network requires 1 megabyte. This means that a workstation that has a hard

disk requires 1 megabyte of hard disk space, and a diskless workstation

requires 1 megabyte of space in the user's directory on the network -- not

on the local workstation.

More Information:

You can install and run Microsoft Access from a diskless workstation

as long as your workstation meets the basic requirements for running

Microsoft Access.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Appendix D, "Setting up

Microsoft Access on a Network," page 658.

References


INF: Converting Null Criteria for a Query by Form

 Article Number: Q94025

 CREATED: 22-DEC-1992

 MODIFIED: 22-DEC-1992

Summary:

A potential problem you my have when attempting to implement query is

that empty criteria fields are likely to include NULL data.  This

would return incorrect results upon executing the underlying query.

This article describes how to deal with these NULL fields in such a

case.

More Information:

Queries can reference form fields through implicit parameters, making

query by form very feasible.  For example, you might have the

following criteria on the 'CustomerName' column:

   Like Forms!CriteriaDialog!CustomerName

where CriteriaDialog is a dialog (form) containing your criteria fields.

If however, the end user doesn't supply a customer name in the criteria

dialog (perhaps expecting to see *all* the rows), the query will actually

return no rows, since the WHERE clause will be reduced to:

   Like NULL

which is always FALSE (NULL Like ANYTHING is FALSE).  To get around this,

add the following function to a module:

The following function converts NULL values to a given value.

Essentially, if the first argument to this function is NULL, then the

second argument will be returned.  Otherwise, the first argument will be

returned (unchanged).

   Function CNulls (v As Variant, subs As Variant) As Variant

      If (IsNull(v)) Then

         CNulls = subs

      Else

         CNulls = v

      End If

   End Function

Once this function has been added to a module, you can change the query's

where clause to read:

   Like CNulls( Forms!CriteriaDialog!CustomerName, "*"  )

In this case, if the user does not supply a customer name,  the CNulls

function will return the asterisk, and all of the rows with data in them

will be returned.

References


PRACC9212: Datasheet Form Saved as a Report Causes a GP Fault

 Article Number: Q94026

 CREATED: 22-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 328

SYMPTOMS

   A report that contains a subreport created from a form causes a general

   protection (GP) fault in Microsoft Windows if the Default View property

   of the original form was set to Datasheet.

   The following GP fault occurs immediately after you attempt to view the

   report in Print Preview mode or to print it:

      MSACCESS caused a General Protection Fault in module MSACCESS.EXE

      at 006A:0A26

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access version

   1.0. Microsoft is researching this problem and will post new information

   here as it becomes available.

More Information:

Steps to Reproduce Problem

--------------------------

1. Open the Categories subform in design view.

2. From the File menu choose Save As Report.

3. Create a new report based on the Categories table.

   Note: The GP Fault will not occur if the main report is not bound.

4. Drag the Categories subform report you created in step 2 to the

   main report you created in step 3.

Result: MSACCESS caused a General Protection Fault in module MSACCESS.EXE

at 006A:0A26

Workaround

----------

You can use a form as a subreport by embedding it directly in the main

report. You do not need to use the Save As Report option. A form with

a Default View of Datasheet will not cause a GP Fault when embedded

in a report.

1. Create a new report.

2. Drag the Categories Subform from the database container to the main

   report you created in step 1.

-Or-

1. Open the original form in Design mode.

2. Change the Default View property to either Single or Continuous Form.

3. Choose Save As Report from the File menu.

4. Embed the new form in your report.

Note: The Main form/subform wizard creates the subform with Datasheet

as the default view. If you save a subform created by this wizard as a

report and then embed the subreport you will encounter this.

References


PRB: Query by Form Returns No Rows When All Rows Expected

 Article Number: Q94027

 CREATED: 22-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   While specifying criteria for a query in a previously designed form, you

   leave one of the fields empty because you want all the records, not just

   the ones that match a certain value. But instead of getting all the

   records, as you expected, you get none at all.

CAUSE

   Queries that contain empty criteria fields may return unexpected results

   because an empty criteria field results in the following condition in

   the WHERE clause:

      Like Null

   This condition is always false because any operation that includes a

   null value returns a null result.

   Queries can reference form fields through implicit parameters -- making

   a query by form. For example, an application developer might put the

   following criteria on the CustomerName field:

      Like Forms!CriteriaDialog!CustomerName

   Here CriteriaDialog is a form that holds the criteria fields. Someone

   using the application might omit a customer name entry in the

   CriteriaDialog form in the hopes of seeing all the rows. However, the

   query actually returns no rows because of the null reference in the

   resulting WHERE clause.

RESOLUTION

   Application developers can work around this potential problem by adding

   the following function to a module:

      Function CNulls (v As Variant, subs As Variant) As Variant

         If (IsNull(v)) Then

            CNulls = subs

         Else

            CNulls = v

         End If

      End Function

   The CNulls function converts null values to a given value. Essentially,

   if the first argument to the function is null, the second argument is

   returned. Otherwise, the first argument is returned unchanged.

   After you add the function to a module, change the criteria to read like

   this:

      Like CNulls( Forms!CriteriaDialog!CustomerName, "*"  )

   Now, if the user does not supply a customer name,  the CNulls function

   will return the asterisk, and the condition will return all rows that

   contain data.

References


PRB: Can't Check to See If Database Was Opened Exclusively

 Article Number: Q94035

 CREATED: 22-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 13779

SYMPTOMS

   In a multiuser environment, you cannot use the OpenDatabase command to

   find out if the current database was opened exclusively. If you attempt

   to open the current database with the OpenDatabase command in Access

   Basic and the current database was originally opened exclusively,

   the database will open and no error will be returned.

CAUSE

   JetOpenDatabase ignores the option flags for all opens except the

   first for a given window's task, so a system administrator can't use

   this to test if a database has been opened exclusively. The technique

   doesn't work because JetOpenDatabase doesn't check the option flags.

STATUS

   This behavior is by design.

More Information:

The following Access Basic subroutine successfully opens the current

database, even if the current database has been opened exclusively.

Steps to Reproduce Behavior

---------------------------

1. Open a database called DB1.MDB.

2. Enter the Access Basic sub shown below in a new module:

   ' Note: Each command should be entered on a single line. The line

   ' continuation character '_' shown at the end of some lines is

   ' there to improve readability of the code. Remove it when you enter

   ' the code in Microsoft Access, and enter all continued lines as one

   ' single long line.

   '********************************************************

   'Declarations section of the module

   '********************************************************

   Option Compare Database

   '===============================================================

   ' The following sub is named Test().

   '===============================================================

   Sub Test ()

      On Error GoTo ErrorHandler

      Dim db As Database

      Set db = OpenDatabase("db1.mdb", False)

      db.Close

      Exit Sub

   ErrorHandler:

         If Err = errCantOpenDbShared Then

           MsgBox "You opened the database exclusively. Please_

              re-open it non-exclusively!"

           DoCmd SelectObject A_TABLE, "", True

           DoCmd Close

         Else

           Resume Next

         End If

   End Sub

3. Run the subroutine from the Immediate Window by typing Test.

As a result, you will see that you do not receive an error message.

References


PRB: Can't Perform OpenTable on an Attached Table

 Article Number: Q94036

 CREATED: 22-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 13836

SYMPTOMS

   If you try to use an OpenTable method on an attached table, you

   will receive the following error message:

      Can't perform operation; it is illegal.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Attach any valid table. From the File menu, choose Attach.

2. Create the following module:

   '***********************************************************

   'Declarations section of the module

   '***********************************************************

   Option Explicit

   '===========================================================

   'The following will set the database to the current database and

   'attempt to open the attached SQL table. Name equals the attached

   'tables name.

   '===========================================================

   Sub Test

      Dim db as Database

      Dim t as Table

      Set db = CurrentDB()

      Set t = db.OpenTable("dbo_name")

   End Sub

3. Compile the module, then run the module. You will receive the

   following message:

      Can't perform operation; it is illegal.

References


INF: Attach R:BASE Table by Exporting dBASE Format in R:BASE

 Article Number: Q94037

 CREATED: 22-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access does not ship with an ISAM driver that supports attaching

R:BASE tables to Microsoft Access databases. However, R:BASE can export

tables into several different formats that Microsoft Access can import.

To retain column names and data type definitions, export R:BASE tables in

R:BASE using the dBASE format.

More Information:

R:BASE can export the following data types:

ASCII delimited

ASCII fixed width

DIF (VisiCalc or other program)

SYLK (Multiplan or other program)

dBASE II, dBASE III, or dBASE III Plus (DBF)

Lotus 1-2-3 (version 1.0 and 2.0) or Symphony (WKS,WK1, or WRK)

The products included here are manufactured by vendors independent of

Microsoft; we make no warranty, implied or otherwise, regarding these

products' performance or reliability.

References


INF: Importing Fixed Width Text Files

 Article Number: Q94038

 CREATED: 22-DEC-1992

 MODIFIED: 22-DEC-1992

Summary:

In Microsoft Access Fixed-Width Text means that the file contains

records of a fixed, consistent width and that data fields within each

record begin at fixed offsets from the beginning of the record. Files

with variable length records and which have no field separator, such

as commas or tabs, are not importable 'as-is'. They can be imported if

first run through a preprocessor which either inserts field separators

or pads each record with spaces out to a constant width.

More Information:

Microsoft Access imports Fixed-Width files by essentially casting a

record template into the file at calculable offsets. These offsets are

presumed to be the logical beginning of records. The logical record

length is determined by Microsoft Access by scanning the first data

row of the file and locating the first CR/LF. This is assumed to mark

the end of the first record (see point 3 below). The actual data

fields defined in the template come from the info supplied in the

Import/Export Spec that was setup by the user. Once the template is

cast into the file, individual field values are extracted and entered

into the database table. The template is then advanced to the next

record's position.

To be successful importing Fixed-Width files the following must be

observed:

1. The file must be truly Fixed-Width. All records of the same width

   and all fields beginning at consistent offsets from the beginning of

   the record.

2. The Import/Export spec should match the physical file. This spec

   information is used to create the template of fields while the overall

   record size is determined by inspecting the physical file. If the

   field template and actual record size differ you may get undesirable

   results. Make sure that the greatest (Offset + Width - 1) in your

   Import/Export spec is not bigger than the physical record length in

   your file (CR/LF at the end of the record is not counted). In other

   words if you have an Import/Export spec which defines two fields ID

   starting at offset 1 for a width of 8 and DATA starting at offset 11

   for a width of 50, then your physical file must contain records of no

   less than 60 bytes (11+50-1) in length (not counting the CR/LF).

   Longer records are allowed,  as long as all records are the same size.

   The extra data beyond the last byte defined in the Import/Export spec

   will simply be ignored.

3. No embedded CR/LF characters in the first row of data. If you have

   embedded CR/LFs in your first row of data, Microsoft Access' record

   size calculation will be wrong and your import will fail to give you

   desirable results.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 75-81

References


PRACC9301: Memo Field with Format Property Truncates Data

 Article Number: Q94039

 CREATED: 22-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 2168

SYMPTOMS

   If you apply formatting to a Memo field by using the Format field

   property, Microsoft Access truncates the data at 255 characters. The

   field retains its Memo data type, but data after the first 255

   characters disappears. This happens to existing data in the Memo field

   as well as any new data you enter.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.00. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


INF: Using Sendkeys to Change an OLE Link

 Article Number: Q94040

 CREATED: 22-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

To change the source of a linked OLE (Object Linking and Embedding)

object, you must choose Object, Change Link from the Edit menu.

The text below describes the three steps required to create a macro

that automatically changes the link based on a filename stored in a

table.

More Information:

Step 1: Create the Sample Table

-------------------------------

Perform the following three steps.

a. Create a table with the following fields:

      Table: Table1

      =============

         FieldName: Key

            DataType: Counter

         FieldName: File Name

            DataType: Text

         FieldName: Linked Object

            DataType: OLE Object

b. Save the table as Linked References.

c. In Browse mode, add the following records to the table. The bitmaps

   used in this example are stored in the Microsoft Windows directory

   (by default, C:\WINDOWS). To embed the objects, open each bitmap in

   Microsoft Windows Paintbrush, choose Copy from the Edit menu,

   switch to Microsoft Access, place the cursor in the Linked Object

   field, and choose Paste Link from the Edit menu.

      Key           Filename      Linked Object

      ---           --------      -------------

      (counter)     ARCADE.BMP     Paste Link ARCADE.BMP

      (counter)     ARCHES.BMP     Paste Link ARCHES.BMP

      (counter)     ARGYLE.BMP     Paste Link ARGYLE.BMP

Step 2: Create the Form

-----------------------

Perform the following three steps.

a. Create a new form based on the table (Linked References).

b. Drag all three fields from the field list to the form.

c. Save the form as "OLE Test" (without the quotation marks).

Step 3: Create the Macro

------------------------

Perform the following four steps.

a. Create a new macro and add the following actions:

      Action           Arguments

      ------           ---------

      GoToControl      Linked Object

      SendKeys         %eol

      SendKeys         =Forms![OLE Test]![File Name]

      SendKeys         ~

   Note: There are three SendKeys actions to make troubleshooting the

   macro simple.

b. Save the Macro as "Update OLE Link" (without the quotation marks).

c. Open the form [OLE Test] and select the control [File Name].

d. Set the property After Update to the macro [Update OLE Link].

To test the form, switch to Browse mode. Change the field [File Name]

in the first record to LEAVES.BMP. The OLE object should update to

display the bitmap LEAVES.BMP, which is also in your Windows

directory.

For more information on embedding OLE objects, see Chapter 13, "Using

Pictures, Graphs, and Other Objects," of the "Microsoft Access User's

Guide" for version 1.0.

References


PRB: Grid Lines Not Visible In Table Datasheet View

 Article Number: Q94041

 CREATED: 22-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Grid lines between records and fields are not visible when you open

   tables.

CAUSE

   The color palette has been changed and now the colors for the

   background and the grid lines are the same or very close in color.

RESOLUTION

   Change the Windows Background setting to the default color palette or to

   a new color in the color section of the Microsoft Windows Control Panel

   and the grid lines will reappear when you open a table in Access.

References


INF: Function Deletes Table Without Using DoMenuItem

 Article Number: Q94042

 CREATED: 22-DEC-1992

 MODIFIED: 17-JUN-1993

Summary:

You can create and use the DeleteTable() function, described below, to

delete a table without using the DoMenuItem or SendKeys functions.

More Information:

Microsoft Access stores all references to objects (tables, queries,

forms, reports, macros, and modules) in a system table called

MSysObjects. You can delete an object from the MSysObjects table if

you have permission to do so. To assign yourself permission to delete

objects from the MSysObjects table, select Permissions from the

Security menu and select the appropriate Modify rights for the table.

For more information on security, please refer to Chapter 25 in the

"Microsoft Access User's Guide" for version 1.0.

The DeleteTable() function accepts the name of a table as its

parameter. It finds the record in MSysObjects that corresponds to that

table name and deletes that record. The function returns True if it

successfully deletes the table you specified. It returns False if it

cannot find a table with the specified name.

Modifying data in any system table can have serious ramifications. Do

not attempt this unless you are thoroughly familiar with the database

and know exactly, where, when, and how the table you want to delete is

used elsewhere in the database. It is best to limit the use of the

DeleteTable() function to temporary tables.

Here's the Access Basic code for the DeleteTable() function:

   'NOTE: In the following sample code, an underscore (_) is used as a

   'line-continuation character. Remove the underscore when re-creating

   'this code in Access Basic.

   Option Explicit

   Function DeleteTable (TableName$)

      Dim SQL$

      'Suppress the "Do you want to delete these records?" message

      DoCmd SetWarnings False

      SQL$ = "DELETE DISTINCTROW MSysObjects.Name, MSysColumns.*"

      SQL$ = SQL$ & " FROM MsysObjects, MSysColumns,"

      SQL$ = SQL$ & " MSysColumns INNER JOIN MSysObjects ON"

      SQL$ = SQL$ & " MSysColumns.ObjectId = MSysObjects.Id"

      SQL$ = SQL$ & " WHERE ((MSysObjects.Name = _

                      '" & TableName$ & "'));"

      DoCmd RunSQL SQL$

      SQL$ = "DELETE DISTINCTROW MSysObjects.Name "

      SQL$ = SQL$ & " FROM MSysObjects"

      SQL$ = SQL$ & " WHERE ((MSysObjects.Name = _

                      '" & TableName$ & "'));"

      DoCmd RunSQL SQL$

      'You may decide that you want to update the Database window;

      'if so, include the following command

      SendKeys "{F11} %VQ%VT"'

   End Function

References


INF: Northwind 'Sales Totals by Amount' Report Is Incorrect

 Article Number: Q94043

 CREATED: 22-DEC-1992

 MODIFIED: 25-APR-1993

Summary:

The report named "Sales Totals by Amount" included in the sample

database Northwind Traders (NWIND.MDB) does not work correctly. The

report uses the Conditional Page Break macro to print 10 lines on each

page of the report. This works properly for only the first page

because the counter on the report is not being reset. To enable this

to work correctly, you must change the Conditional Page Break macro.

In the macro named Show Break within the macro Conditional Page Break,

you must change the Condition to read as follows:

   [COUNTER] MOD 10 = 0

This will now perform a page break after every 10 lines of the report

for every page.

References


PRB: Err Msg: 'Couldn't Update: Currently Locked by User...'

 Article Number: Q94080

 CREATED: 23-DEC-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   The following message appears either when two users simultaneously

   try to update a similar object in a shared database or on a

   single-user system if the system runs out of locks:

      Couldn't update; currently locked by user '<user name>' on machine

      '<machine name>'

CAUSE

   On a multiuser system, a conflict exists with the SYSTEM.MDA file.

   By design, Microsoft Access cannot simultaneously update the

   MsysObjects table in the SYSTEM.MDA file for multiple users.

   On a single-user system, there are not enough locks specified in the

   AUTOEXEC.BAT file.

RESOLUTION

   On a multiuser system, try saving the object again. If no one is

   updating a similar object at the same time, the Save command should

   work. This error can occur in Access Basic code also, so you will need

   to handle error trapping for this.

   On a Single-User System

   -----------------------

   1. Exit Windows.

   2. Change to the Access directory and delete all *.LDB files.

   3. Change to the Windows directory and the Temp subdirectory. Delete

      all ~*.TMP files.

   4. Edit the AUTOEXEC.BAT file. Look for the line, C:\DOS\SHARE.EXE.

      Change this line to C:\DOS\SHARE.EXE /L:500. You will not find

      this line if you are running VSHARE.EXE, OS/2, or you are currently

      running on a network.

   5. Restart the computer.

More Information:

The SYSTEM.MDA file conflict is likely to occur only on systems with

many (100+) users.

Steps to Reproduce Behavior

---------------------------

1. User A and user B open the same database on a shared drive.

2. Both users create a new object of similar type (such as a table,

   form, report, query, or macro.)

3. Both users choose Save from the File menu and enter a unique filename.

4. Simultaneously, user A and user B press ENTER to update the object.

5. Microsoft Access presents the error message listed above. Choose OK

   to dismiss the message and try again.

References


PRB: Append Query Results in Duplicate Counter Numbers

 Article Number: Q94105

 CREATED: 28-DEC-1992

 MODIFIED: 22-APR-1993

Summary:

SYMPTOMS

   A table that you append data to using an Append Query now has

   duplicated numbers in a field defined as a Counter data type. The

   expected result was appended data with incremented numbers in the

   Counter field.

CAUSE

   Your Append Query is explicitly referencing the field with the

   Counter data type. You are, in essence, overriding the automatic

   counter function that you specified in your table design. This may

   result in duplicate numbers.

STATUS

   This behavior is by design.

RESOLUTION

   Do not include a field with a Counter data type in the Append To

   row of the QBE grid in your Append Query. By omitting this field in

   your Append Query, Microsoft Access will automatically generate

   incremental numbers in the appended table's Counter field.

More Information:

You will only get duplicates if there is not a Primary Key or an Index

(No Duplicates) defined on the Counter field in the table that you are

appending to. By definition, primary keys are unique.

Including fields with Counter data types in your Append Query might

also result in non-contiguous numbers in the table that you are

appending to. For example, if the table you are appending to has

values of 1 to 20 in the Counter field, and the table you are

appending from has values of 20, 34, and 55, you will end up with one

duplicate value. The next time you add a new row to the appended to

table, the Counter field will be assigned a value of 56.

References


PRB: Access Adds Date Delimiters When Importing Text

 Article Number: Q94106

 CREATED: 28-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When importing a text file that contains date values that do not

   contain a date delimiter such as a '/' into Microsoft Access version

   1.0, the '/' date delimiter will be added to the date field in the Table.

   An example date would be 112192.  This date value would be loaded into

   Microsoft Access as 11/21/92.

CAUSE

   Microsoft Access will automatically separate the month, day, and year

   with a '/' date delimiter when importing a text file, regardless of whether

   the text file is formatted with a date delimiter.  This only occurs when

   you import the file to an existing table only.  If the import created the

   table then the 112192 date value would be loaded as 111292 with a Number

   datatype.

STATUS

  This behavior is by design.

References


INF: Importing Fixed-Width Text Files

 Article Number: Q94107

 CREATED: 28-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

This article describes the fixed-width text file format and explains how to

import this type of file.

More Information:

A fixed-width text file in Microsoft Access is a file that contains records

of a fixed, consistent width. The data fields in each record begin at fixed

offsets from the beginning of the record.

You cannot import files that have variable length records that do not

contain field separators (for example, commas or tabs). These files are not

fixed-width text files. To import this kind of file, you need to first

process the file using an editor to insert field separators or to turn the

file into a true fixed-width text file by, for example, adding spaces to

each record to make all records the same width (number of characters).

Microsoft Access imports fixed-width text files by casting a record

template into the file at calculable offsets. It uses the offsets to

determine the logical beginning of each new record. Microsoft Access

determines the logical record width by scanning the first data record of

the file to locate the first carriage return and line feed (CR/LF). It

assumes that the first CR/LF marks the end of the first record (see point

three later in this article).

The data fields defined in the template come from the information

you supplied when you set up the import/export specification. Microsoft

Access uses the template to extract the individual field values. Then it

enters the field values into table and advances the template to the next

record.

To import fixed-width text files successfully, you must meet the following

conditions:

1. The file must be truly fixed-width. That is all records have the same

   width with all fields in the records beginning at consistent offsets.

2. The import/export specification you set up must match the physical

   file. Microsoft Access uses the specification to create the template

   of fields after inspecting the physical file to determine the overall

   record size. If the field template differs from the actual record size,

   you may get bad results.

   Ensure that the greatest (Offset + Width - 1) in your import/export

   specification is less than or equal to the physical record width

   excluding the CR/LF at the end of the record. In other words, an

   import/export specification that defines two fields -- ID beginning at

   offset 1 for a width and of 8 and DATA beginning at offset 11 for a

   width of 50 -- then your physical file must contain records of no less

   than 60 bytes (11 + 50 - 1) not counting the CR/LF. Microsoft Access

   will ignore records that have extra data beyond the last byte defined in

   the import/export specification.

3. The first record in the file must not contain embedded CR/LF characters.

   Otherwise, the Microsoft Access record size calculation will be wrong.

Reference(s):

For more information, search for "Fixed-width text files" using the

Microsoft Access Help menu. Also, see the "Microsoft Access User's Guide,"

version 1.0, Chapter 4, "Importing, Exporting, and Attaching," pages 72-85.

References


INF: MS Access Does Not Support Parameter Querys as DDE Topics

 Article Number: Q94108

 CREATED: 28-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access does not support Parameter Queries through dynamic

data exchange (DDE). To perform a parameter driven query, Microsoft

Access must receive parameters in a manner that DDE does not support.

More Information:

An attempt to initiate a DDE channel with a parameter query fails. The

resulting error message depends on the DDE client application

involved. When the DDE client is Microsoft Visual Basic, it displays

the following message:

   No foreign application responded to DDE Initiate

Microsoft Excel displays the following message:

   Remote Data not Accessible. Start "MSACCESS.EXE"?

One method to work around this situation links a Microsoft Access form

to the DDE client. This link transfers the parameter to Microsoft

Access. Then modify the query to retrieve the parameter from the form.

To implement this method in Microsoft Excel, perform the following

five steps.

1. Create the DDE Link

----------------------

Perform the following eleven steps to create the DDE link.

a. Start Microsoft Excel and open a new Macro sheet.

b. In cell A1, enter "DAIR" (without quotation marks).

c. Save the macro sheet as DDETEST.XLM.

d. Select cell A1 and choose Copy from the Edit menu.

e. Start Microsoft Access and open the sample database NWIND.MDB.

f. Create a new, unbound form.

g. Choose Paste Special from the Edit menu.

h. In the Data Type list box, select Text, then choose Paste Link.

   This step creates a Text box that contains the following formula:

      =DDE("Excel","C:\ACCESS\DDETEST.XLM","R1C1")

i. If the Properties box is not available, choose Properties from the

   View menu.

j. Select the text box created in step g. Change the Control Name

   property to "DDE Parameter" (no quotation marks).

k. Save the form as [DDE Link Form].

2. Modify the Query

-------------------

Perform the following four steps to modify the database query.

a. Open the [Products By Category (Parameter)] query in design mode.

b. Choose Parameters from the Query menu. Delete the [Enter a Category

   ID] criteria from the query.

c. In the [Category ID] field in the query grid, replace the existing

   query with the following:

      =Forms![DDE Link Form]![DDE Parameter]

d. Test the query. Verify that the DDETEST.XLM macro sheet is open in

   Microsoft Excel and that the [DDE Link Form] is open in Microsoft

   Access in Browse mode. Run the query and verify that the products

   displayed are in the "DAIR" category.

3. Create a Macro to Open the Form

----------------------------------

Perform the following three steps to create a macro to open the form.

a. Create a new macro.

b. Add the following action to the macro:

      OpenForm

         Form Name:  DDE Link Form

         View:       Form

c. Save this macro as "Open Form" (without quotation marks).

4. Create a Macro to Run the Query

----------------------------------

Perform the following three steps to create a macro to run the query.

a. Create a new macro.

b. Add the following action to the macro:

      OpenQuery

         Query Name:  Products by Categories (Parameter)

         View:        Datasheet

c. Save this macro as "Run Query" (without quotation marks).

5. Create the DDE Macro

-----------------------

Perform the following four steps to create the DDE macro in Microsoft

Excel.

a. In the DDETEXT.XLM macro sheet, enter the following macro:

      Cell    Command

      --------------------------------------------

      A1      DAIR

      A2

      A3      chan=INITIATE("MSAccess","System")

      A4      =EXECUTE(chan,"Open Form")

      A5      =APP.ACTIVATE("Microsoft Access")

      A6      =SEND.KEYS("{F9}")

      A7      =TERMINATE(chan)

      A8      =ON.TIME(0.010,Run_Query)

      A9

      A10     chan=INITIATE("MSAccess","System")

      A11     =EXECUTE(chan,"Run Query")

      A12     =TERMINATE(chan)

      A13     =RETURN()

b. Select cell A10. Choose Define Name from the Formula menu. In the

   Define Name dialog box, enter Run_Query in the Name field. Choose

   Command in the Macro group box, then choose OK. This step assigns

   the name Run_Query to the macro that begins in cell A10.

c. In Microsoft Access, close all forms, macros, and queries.

d. To run the macro, make DDETEXT.XLM the active macro sheet and

   select cell A3. Then choose Run from the Macro menu and choose OK.

   The Excel macro runs much more quickly if you set the DDE TimeOut

   option in Microsoft Access to 1 second.

Notes:

Q. Why does the Microsoft Excel macro use SendKeys?

A. Microsoft Excel instructs Microsoft Access to open the form [DDE

   Link Form]. When it opens this form, Microsoft Access attempts to

   update the DDE link in the [DDE Parameter] control. However,

   Microsoft Excel does not process any requests until it receives

   notification that Microsoft Access has successfully completed the

   macro. Microsoft Access does not complete executing the macro until

   it successfully updates the link to Microsoft Excel. Eventually,

   Microsoft Access times-out and displays #Error. The SendKeys

   command sends the F9 key sequence to Microsoft Access to refresh

   the form.

Q. How can I send this information to Microsoft Excel?

A. To transfer the results of a query to Microsoft Excel, change the

   query to a Make Table query. Then use the DDE Request function to

   retrieve the data in the table from Microsoft Excel.

References:

The DDE Server Topics that Microsoft Access supports are documented in

the README.TXT file which is installed in your Microsoft Access

directory.

For more information on parameter queries, please refer to the

"Microsoft Access User's Guide," version 1.0, Chapter 7, "Designing

Action Queries and Parameter Queries," pages 178-181.

For more information on creating DDE links in forms and reports,

please refer to the "Microsoft Access User's Guide," version 1.0,

Chapter 13, "Using Pictures, Graphs, and Other Objects," pages

337-339.

References


PRB: Trailing CR/LF's Stripped From Text Box When Retrieved

 Article Number: Q94109

 CREATED: 28-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Trailing CR/LF's are stripped out when retrieving data from a text

   box. Although it is possible to stuff CR/LF's into a text box, when

   attempting to retrieve the data, the trailing CR/LF's are truncated.

STATUS

   This is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open the Customers Form in the sample database Northwind Traders

   (NWIND.MDB).

2. Open the Immediate window and position it on the screen so that it

   and the Customers Form are both in view.

3. Type the following command in the Immediate window:

      Forms!Customers.[Contact Name] = "Chris" & chr(13) & chr(10)

   At this point the Contact Name control on the form should be

   updated and should contain the text 'Chris' with a blank line below

   it. This shows that the CR/LF is in the text box.

4. Type the following command in the Immediate window.

      MyValue = Forms!Customers.[Contact Name]

   The variable MyValue will contain the text 'Chris', but there will

   be no CR/LF at the end of the text. This can be tested by executing

   the following command from the Immediate window:

      Print MyValue & "*"

   This will return the value 'Chris*' which shows that there is no CR/LF

   at the end of MyValue.

References


PRB: Full Path Causes Endless Loop in StartApp() Example

 Article Number: Q94110

 CREATED: 28-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

Passing the full path of a DDE server to the StartApp() function will

cause an endless loop. The function will continue to run, starting up

new copies of the specified  DDE server until the user stops the code,

or the workstation runs out of memory and the code fails.

The function works correctly if the name of the DDE server without

the path is used.

More Information:

The sample database Northwind Traders (NWIND.MDB) contains a module

called Introduction to Programming. Many of the Access Basic codes

used as examples in the "Microsoft Access Basic: An Introduction to

Programming" manual are included in this module. The example function

StartApp() from page 142 contains a routine that can be used to

initiate a DDE channel.

If the DDEInitiate() in the StartApp() function fails, the error

handling routine StartApp: attempts to start the server. The error

routine then passes control back to the main body of code, where the

DDEInitiate is tried again.

If the full path to the DDE server is used when the StartApp()

function is called, the DDEInitiate() function will fail, but the

Shell() function in the error routine will be successful.

The following is an example of using StartApp() that will cause an

endless loop:

   =StartApp("c:\winword\winword.exe","system")

The following is an example that will work correctly:

   =StartApp("winword","system")

References


PRB: Hewlett-Packard Dashboard GP Faults in Microsoft Access

 Article Number: Q94111

 CREATED: 28-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You get a General Protection (GP) Fault when using Microsoft Access with

   the Hewlett-Packard Dashboard 1.0.

RESOLUTION

   This is a known problem. Hewlett-Packard Company has released a patch

   that fixes this problem. Download the patch from the CompuServe HPSYS

   forum. The file you want is DB101U.EXE in Library 11.

More Information:

To obtain the file, sign on to CompuServe and follow this procedure:

1. Type GO HPSYS at the ! prompt in CompuServe, and press ENTER. CompuServe

   will give you general information about the forum and ask you to join.

2. Press ENTER until you reach the Forum! prompt.

3. Type LIB, and press ENTER. When CompuServe prompts you for a library

   number, type 11, and press ENTER.

4. Type DOWN DB101U.EXE, and press ENTER. CompuServe will ask you for a

   local file name. Enter DB101U.EXE along with the path indicating where

   you want to store the file, and press ENTER. For example, you might

   enter this:.

      C:\WINDOWS\DB101U.EXE

At this point, CompuServe will begin to download the file.

5. When the download process is complete, you are ready to run the patch.

   When you run it, it will expand into more than one file, so create a

   subdirectory and copy DB101U.EXE into it. Then change to that

   subdirectory and enter DB101U at the MS-DOS command prompt.

   DB101U.EXE will automatically extract and expand the patch and a

   readme file. Hewlett-Packard Company recommends that you follow the

   instructions in that readme file.

Dashboard is a trademark of Hewlett-Packard Company. Dashboard is

manufactured by a vendor independent of Microsoft; we make no warranty,

implied or otherwise, regarding this product's performance or reliability.

References


INF: Microsoft Access 1.0 Disks 1-4 Contents (5.25 Inch 1.2MB)

 Article Number: Q94112

 CREATED: 28-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

The following lists the directory contents of disks 1-4 shipped with

Microsoft Access version 1.0 [5.25 inch, 1.2 megabytes (MB)].

Disk 1

Volume Label: DISK1

1        WMF      4470 10-25-92  12:00a

1E       WMF      4022 10-25-92  12:00a

COMMDLG  DL$     46406 10-09-92  10:02a

COMMDLG  DL_     89248 10-25-92  12:00a

CTL3D    DL$      7524 08-16-92   7:35p

DDEML    DL$     20305 03-10-92   3:10a

DETCMD   DL_     24128 10-25-92  12:00a

MSACCESS IN$       519 10-25-92  12:00a

MSACCESS RE$       552 10-25-92  12:00a

MSAIN100 DL$     71625 10-25-92  12:00a

OLECLI   DL$     41083 10-09-92  10:02a

OLESVR   DL$     13129 10-09-92  10:02a

ORDENTRY TX$      2281 10-25-92  12:00a

ORDENTRY HL$     14224 10-25-92  12:00a

ORDENTRY MD$    200396 10-25-92  12:00a

PIM      HL$      8119 10-25-92  12:00a

SETUP    EXE     21472 10-25-92  12:00a

SETUP    INI       149 10-25-92  12:00a

SHARE    EX$      8112 10-09-92  10:02a

SHELL    DL$     23296 10-09-92  10:02a

SMALLB   FO$      9687 03-06-92   7:16p

SMALLE   FO$     11236 03-06-92   7:16p

SMALLF   FO$      9376 03-06-92   7:16p

STFSETUP EX_    477376 10-25-92  12:00a

STFSETUP IN_     56600 10-25-92  12:00a

VER      DL_      9008 10-25-92  12:00a

VER      DL$      5653 10-09-92  10:02a

WORKGRP  IN_      1393 10-25-92  12:00a

       28 file(s)    1181389 bytes

Disk 2

Volume Label: DISK2

2        WMF      8022 10-25-92  12:00a

2E       WMF      6870 10-25-92  12:00a

MSACCESS HL$   1189376 10-25-92  12:00a

        3 file(s)    1204268 bytes

Disk 3

Volume Label: DISK3

3        WMF      8950 10-25-92  12:00a

3E       WMF      8470 10-25-92  12:00a

MSABC100 DL$    187802 10-25-92  12:00a

MSAES100 DL$     16899 10-25-92  12:00a

MSAFIN   DL$     18553 10-25-92  12:00a

WIZARD   MD$    174297 10-25-92  12:00a

MSACCESS EX$    790199 10-25-92  12:00a

        7 file(s)    1205170 bytes

Disk 4

Volume Label: DISK4

4        WMF      8246 10-25-92  12:00a

4E       WMF      7766 10-25-92  12:00a

ANALYZER MD$     49740 10-25-92  12:00a

NEWCUST  DB$      1212 10-25-92  12:00a

NWIND    MD$    555226 10-25-92  12:00a

PIM      MD$    109267 10-25-92  12:00a

SYSTEM   MD$     98863 10-25-92  12:00a

UTILITY  MD$     47055 10-25-92  12:00a

WINHELP  EX$    147911 10-09-92  10:02a

WINHELP  HL$     28161 10-09-92  10:02a

       10 file(s)    1053447 bytes

Reference(s):

References


INF: Microsoft Access 1.0 Disks 5-9 (5.25 inch, 1.2 MB)

 Article Number: Q94113

 CREATED: 28-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

The following lists give the directory contents for disks five through nine

including the ODBC Setup disk and the Windows for Workgroups Driver disk

shipped with Microsoft Access version 1.0 (5.25 inch, 1.2 MB).

More Information:

Disk 5

Volume Label: DISK5

5        WMF      4662 10-25-92  12:00a

5E       WMF      4150 10-25-92  12:00a

CBTLIB4  DL$     11179 10-25-92  12:00a

CUECARD  EX$     60269 10-25-92  12:00a

CUECARDS DL$      2047 10-25-92  12:00a

CUECARDS LE$    887544 10-25-92  12:00a

        6 file(s)     969851 bytes

Disk 6

Volume Label: DISK6

6        WMF      3702 10-25-92  12:00a

6E       WMF      3222 10-25-92  12:00a

BTRVISAM DL$     57918 10-25-92  12:00a

DBSISAM  DL$    135919 10-25-92  12:00a

GRAPH    EX$    364877 10-09-92  10:02a

MSAJT100 DL$    338672 10-25-92  12:00a

MSAJU100 DL$     38945 10-25-92  12:00a

MSGRAPH  HL$    110291 10-09-92  10:02a

PDXISAM  DL$    106830 10-25-92  12:00a

REGEDIT  EX$     18176 10-09-92  10:02a

WBTRCALL DL$     30679 10-25-92  12:00a

       11 file(s)    1209231 bytes

Disk 7

Volume Label: DISK7

7        WMF      5846 10-25-92  12:00a

7E       WMF      5366 10-25-92  12:00a

MSACCES2 HL$   1133393 10-25-92  12:00a

PSSKB    TX$      7951 10-25-92  12:00a

README   TX$      9465 10-25-92  12:00a

ERRATA   TX$      9805 10-25-92  12:00a

        6 file(s)    1171826 bytes

ODBC Setup Disk

Volume Label: ODBC

DBNMP3   DLL      8241 10-22-92   3:06p

INSTCAT  SQL     93796 10-25-92  12:00a

MSCOMSTF DLL     74528 10-25-92  12:00a

MSDETSTF DLL     24544 10-25-92  12:00a

MSINSSTF DLL     65440 10-25-92  12:00a

MSSHLSTF DLL     14928 10-25-92  12:00a

MSUILSTF DLL      6144 10-25-92  12:00a

ODBC     DLL     44736 10-25-92  12:00a

ODBC     INF      1226 10-25-92  12:00a

ODBCADM  EXE      9136 10-25-92  12:00a

ODBCADM  HLP      4942 10-25-92  12:00a

ODBCINST DLL      6016 10-25-92  12:00a

SETUP    EXE     54464 10-25-92  12:00a

SETUPI   DLL     44032 10-25-92  12:00a

SQLSETUP DLL     11024 10-25-92  12:00a

SQLSRVR  DLL    135792 10-25-92  12:00a

VER      DLL      9008 10-22-92   3:06p

LANMAN21     <DIR>     10-25-92  12:00a

       18 file(s)     607997 bytes

Windows for Workgroups Driver Disk

Volume Label: WFWDRV

WFWDRV   EXE     23581 11-02-92   3:11a

WFWNET   DR_    165600 11-02-92   3:11a

        2 file(s)     189181 bytes

References


INF: Microsoft Access 1.0 Disk Contents (3.5 inch, 1.44 MB)

 Article Number: Q94114

 CREATED: 28-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

The following lists give the directory contents for each disk shipped

with Microsoft Access version 1.0 (3.5 inch, 1.44 MB).

More Information:

Disk 1

Volume Label: DISK1

1        WMF      4470 10-25-92  12:00a

1E       WMF      4022 10-25-92  12:00a

BTRVISAM DL$     57918 10-25-92  12:00a

COMMDLG  DL$     46406 10-09-92  10:02a

COMMDLG  DL_     89248 10-25-92  12:00a

CTL3D    DL$      7524 08-16-92   7:35p

DBSISAM  DL$    135919 10-25-92  12:00a

DDEML    DL$     20305 03-10-92   3:10a

DETCMD   DL_     24128 10-25-92  12:00a

MSACCESS IN$       519 10-25-92  12:00a

MSACCESS RE$       552 10-25-92  12:00a

MSAIN100 DL$     71625 10-25-92  12:00a

MSAJU100 DL$     38945 10-25-92  12:00a

OLECLI   DL$     41083 10-09-92  10:02a

OLESVR   DL$     13129 10-09-92  10:02a

ORDENTRY TX$      2281 10-25-92  12:00a

ORDENTRY HL$     14224 10-25-92  12:00a

ORDENTRY MD$    200396 10-25-92  12:00a

PIM      HL$      8119 10-25-92  12:00a

SETUP    EXE     21472 10-25-92  12:00a

SETUP    INI       149 11-25-92  10:51a

SHARE    EX$      8112 10-09-92  10:02a

SHELL    DL$     23296 10-09-92  10:02a

SMALLB   FO$      9687 03-06-92   7:16p

SMALLE   FO$     11236 03-06-92   7:16p

SMALLF   FO$      9376 03-06-92   7:16p

STFSETUP EX_    477376 10-25-92  12:00a

STFSETUP IN_     56427 10-25-92  12:00a

VER      DL$      5653 10-09-92  10:02a

VER      DL_      9008 10-25-92  12:00a

WORKGRP  IN_      1393 10-25-92  12:00a

       31 file(s)    1413998 bytes

Disk 2

Volume Label: DISK2

2        WMF      8022 10-25-92  12:00a

2E       WMF      6870 10-25-92  12:00a

MSACCESS HL$   1189376 10-25-92  12:00a

PDXISAM  DL$    106830 10-25-92  12:00a

REGEDIT  EX$     18176 10-09-92  10:02a

WBTRCALL DL$     30679 10-25-92  12:00a

        6 file(s)    1359953 bytes

Disk 3

Volume Label: DISK3

3        WMF      8950 10-25-92  12:00a

3E       WMF      8470 10-25-92  12:00a

MSABC100 DL$    187802 10-25-92  12:00a

MSAES100 DL$     16899 10-25-92  12:00a

MSAFIN   DL$     18553 10-25-92  12:00a

WIZARD   MD$    174297 10-25-92  12:00a

MSACCESS EX$    790199 10-25-92  12:00a

        7 file(s)    1205170 bytes

Disk 4

Volume Label: DISK4

4        WMF      8246 10-25-92  12:00a

4E       WMF      7766 10-25-92  12:00a

ANALYZER MD$     49740 10-25-92  12:00a

MSAJT100 DL$    338672 10-25-92  12:00a

NEWCUST  DB$      1212 10-25-92  12:00a

NWIND    MD$    555226 10-25-92  12:00a

PIM      MD$    109267 10-25-92  12:00a

SYSTEM   MD$     98863 10-25-92  12:00a

UTILITY  MD$     47055 10-25-92  12:00a

WINHELP  EX$    147911 10-09-92  10:02a

WINHELP  HL$     28161 10-09-92  10:02a

       11 file(s)    1392119 bytes

Disk 5

Volume Label: DISK5

5        WMF      4662 10-25-92  12:00a

5E       WMF      4150 10-25-92  12:00a

CBTLIB4  DL$     11179 10-25-92  12:00a

CUECARD  EX$     60269 10-25-92  12:00a

CUECARDS DL$      2047 10-25-92  12:00a

CUECARDS LE$    887544 10-25-92  12:00a

GRAPH    EX$    364877 10-09-92  10:02a

MSGRAPH  HL$    110291 10-09-92  10:02a

        8 file(s)    1445019 bytes

Disk 6

Volume Label: DISK6

6        WMF      5846 10-25-92  12:00a

6E       WMF      5366 10-25-92  12:00a

MSACCES2 HL$   1133393 10-25-92  12:00a

PSSKB    TX$      7951 10-25-92  12:00a

README   TX$      9465 10-25-92  12:00a

ERRATA   TX$      9805 10-25-92  12:00a

        6 file(s)    1171826 bytes

ODBC Installation Diskette

Volume Label:  ODBC

DBNMP3   DLL      8241 10-22-92   3:06p

INSTCAT  SQL     93796 10-25-92  12:00a

MSCOMSTF DLL     74528 10-25-92  12:00a

MSDETSTF DLL     24544 10-25-92  12:00a

MSINSSTF DLL     65440 10-25-92  12:00a

MSSHLSTF DLL     14928 10-25-92  12:00a

MSUILSTF DLL      6144 10-25-92  12:00a

ODBC     DLL     44736 10-25-92  12:00a

ODBC     INF      1226 10-25-92  12:00a

ODBCADM  EXE      9136 10-25-92  12:00a

ODBCADM  HLP      4942 10-25-92  12:00a

ODBCINST DLL      6016 10-25-92  12:00a

SETUP    EXE     54464 10-25-92  12:00a

SETUPI   DLL     44032 10-25-92  12:00a

SQLSETUP DLL     11024 10-25-92  12:00a

SQLSRVR  DLL    135792 10-25-92  12:00a

VER      DLL      9008 10-22-92   3:06p

LANMAN21     <DIR>     10-25-92  12:00a

       18 file(s)     607997 bytes

Windows For Workgroups Driver Diskette

Volume Label: WFWDRV

WFWDRV   EXE     23581 11-02-92   3:11a

WFWNET   DR_    165600 11-02-92   3:11a

        2 file(s)     189181 bytes

References


INF: How to Retrieve Information from the Clipboard

 Article Number: Q94162

 CREATED: 29-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

There is no inherent command within Microsoft Access to retrieve

information from the clipboard. To retrieve information from the clipboard,

you need to define an Access Basic function that calls several Windows API

functions. This article defines a function that retrieves text from the

clipboard.

More Information:

Add the code defined below to an Access Basic module. Make sure that the

declare functions are all listed on one line and that the MsgBox procedure

is also defined on one line. Since you may have some of the Windows API

functions defined in an underlying library, some of them might not be

needed. If this is the case, remove or comment the declarations from your

code.

To call the function you can make a string assignment to the returned

value, such as:

   ReturnString$ = ClipBoard_GetData ()

Sample Code:

   Option Explicit

   ' Note: Each command should be entered on one line. The line

   ' continuation character '_' only improves the readability of the code.

   Declare Function OpenClipBoard% Lib "User" (ByVal hwnd%)

   Declare Function GetClipboardData% Lib "User" (ByVal wFormat%)

   Declare Function GlobalAlloc% Lib "Kernel" (_

      ByVal wFlags%, ByVal dwBytes&)

   Declare Function GlobalLock& Lib "Kernel" (ByVal hMem%)

   Declare Function lstrcpy& Lib "Kernel" (_

      ByVal lpString1 As Any, ByVal lpString2 As Any)

   Declare Function GlobalUnlock% Lib "Kernel" (ByVal hMem%)

   Declare Function CloseClipBoard% Lib "User" ()

   Declare Function GlobalSize& Lib "Kernel" (ByVal hMem%)

   Global Const GHND = &H42

   Global Const CF_TEXT = 1

   Global Const MAXSIZE = 4096

   Function ClipBoard_GetData()

      Dim hClipMemory%

      Dim lpClipMemory&

      Dim MyString$

      Dim Junk&

      Dim X%

      If OpenClipBoard(0&) = 0 Then

         MsgBox "Could not open the clipboard. Another _

            application could have it open"

         Exit Function

      End If

      '-------------------------------------------

      ' Obtain the handle to the global memory

      ' block that is referencing the text.

      '-------------------------------------------

      hClipMemory% = GetClipboardData(CF_TEXT)

      If IsNull(hClipMemory%) Then

         MsgBox "Could not allocate memory"

         GoTo OutOfHere

      End If

      '-------------------------------------------

      ' Lock clipboard memory so we can reference

      ' the actual data string

      '-------------------------------------------

      lpClipMemory& = GlobalLock(hClipMemory)

      If Not IsNull(lpClipMemory&) Then

         MyString$ = Space$(MAXSIZE)

         Junk& = lstrcpy(MyString$, lpClipMemory)

         X% = GlobalUnlock(hClipMemory)

         'peel off the null terminating character

         MyString$ = Mid(MyString$, 1, InStr(MyString$, Chr$(0)) - 1)

      Else

         MsgBox "Could not lock memory to copy string from."

      End If

   OutOfHere:

      X% = CloseClipBoard()

      ClipBoard_GetData = MyString$

   End Function

Reference(s):

"Programming Windows by Charles Petzold", Second Edition, pg 780-781.

References


PRB: 'FastForward' Button Is Unavailable in Graph FormWizard

 Article Number: Q94174

 CREATED: 29-DEC-1992

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   When you use the Graph FormWizard to create a form, the "Fast Forward"

   button (>>|) is unavailable if you use the button labeled "Back" to

   move back one or more screens.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new form using the Graph FormWizard.

2. Proceed to the last Graph FormWizard screen. (This screen gives you

   the option to open or design your form.)

3. Choose the button labeled "Back" to go back any number of screens.

The "Fast Forward" button is now unavailable. This button should be

available to move you to the last screen of the Graph FormWizard.

References


PRB: Date/Time Formats Not Used In List or Combo Box Controls

 Article Number: Q94175

 CREATED: 29-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A list or combo box based on a Date/Time field does not display the date

   or time format assigned to the underlying field. This is particularly

   noticeable in list or combo box control on a form.

CAUSE

   Microsoft Access does not yet provide a Format property for a list or

   combo box even though the underlying table field has a defined Format

   property.

RESOLUTION

   Use the Format() function in an expression in a query to format the

   data. Then base the list or combo box on the query field instead of the

   underlying table field. In other words, in Query Design view, assign an

   expression to a field in the QBE (Query by Example) grid. Use the

   Format() function in the expression to format the Date/Time field.

   For example, define a query named QueryTest. Then instead of entering

   the name of the underlying Time/Date field ([Event Date]) as the field

   on the QBE grid, enter this expression:

      Event Day: Format([event date],"mmmm d"", ""yyyy")

   Base the list or combo box on this query field to display [Event Date]

   with the desired format.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

----------------------------

1. Create a new table containing these two fields:

      Field Name         Data Type

      ----------------------------

      Event ID           Counter

      Event Date         Date/Time

2. Assign a Format property to [Event Date] as follows:

      Event Date         Field Properties

      -----------------------------------

      Format             mmmm d, yyyy

3. Save the table naming it Events. Switch to Datasheet view. In the

   first record enter 8/11/92 in the Event Date field. Add a few more

   records with any valid dates.

   At this point the first record's date displays correctly as

   August 11, 1992.

4. Create a new form, and base it on the Events table. Add a list box

   control to the form. Set the properties for the list box as follows:

     Object:Listbox

     -------------------------------------

       Control Name:    Event ID

       Control Source:  Event ID

       Row Source Type: Table/Query

       Row Source:      Events

       Column Count:    2

       Column Heads:    Yes

       Column Widths:   0;1

       Bound Column:    1

5. Switch to Form view. As you can see, the date in the list box control is

   8/11/92 not August 11, 1992. Microsoft Access ignores the Format

   property set on the underlying field. The same thing happens with time

   formats.

References


PRB: Form Objects Not Placed on Grid by Wizard

 Article Number: Q94176

 CREATED: 29-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 7779

SYMPTOMS

   When using the Form Wizard, objects are not aligned to the grid

   even though Snap To Grid is on.

CAUSE

   Wizards are designed to place objects on the form and position them

   in the appropriate manner. Snap To Grid is a feature to help the user

   place controls on forms. Since the user is not positioning the objects

   manually, there is no need for Wizards to use the Snap To Grid feature.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open NWIND.MDB.

2. Use Form Wizard to create a new Single Column form based on the Employee

   table.

3. Place all fields on the form.

4. Pick Standard style.

5. Open in design mode.

   Results: The form objects are NOT aligned to the grid, even though

   the Snap To Grid option is checked.

References


PRB: Can't Create Two Relationships Between Same Tables

 Article Number: Q94189

 CREATED: 29-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 13376

SYMPTOMS

   If you try to create two relationships between the same two tables,

   Microsoft Access will automatically delete the first relationship.

STATUS

   This behavior is by design.

More Information:

Steps To Reproduce Behavior

---------------------------

1. Create two tables that share a common field:

   Table: Table1

   -------------

      Field Name: Test [Primary key]

      Date Type: Text

   Table: Table2

   -------------

      Field Name: Test

      Date Type: Text

2. From the Edit Menu choose Relationships and create a relationship

   between the Table1 and Table2 on the Test field with the Enforce

   Referential Integrity option checked. Choose Add.

3. Create another relationship between the two tables. Choose Add.

   Creating the second relationship deletes the first relationship.

References


PRB: Arrow Keys Inconsistent Between Forms and Datasheets

 Article Number: Q94190

 CREATED: 29-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you set ARROW key behavior to Next Field, pressing an ARROW key

   at the end of a field in Datasheet view will move you to the next

   field. However, in Form view, pressing an ARROW key at the end of a

   control has no effect (that is, it will not move the focus to the

   next control).

CAUSE

   This behavior is by design.

More Information:

You can set certain keyboard attributes, such as ARROW key behavior

(from the View menu choose Options, then select Keyboard). You can set

the ARROW key behavior to either Next Field or Next Character. When

set to Next Field, the ARROW key behavior will vary between Datasheet

view and Form view. The difference in behavior depends on the mode of

the Microsoft Access text editor. For more information on text editor,

query in the Microsoft Knowledge Base on the following key words:

   key AND behavior AND edit AND box

If the editor is in "enter" mode (the entire field or control is

selected), pressing an ARROW key in either Datasheet view or Form

view moves you to the next field or control and remains in enter mode.

When you reach the last field or control, you will move to the next

record.

If the editor is in "edit" mode (text has been entered), pressing an

ARROW key at the end of a field in Datasheet view will move you to the

next field and return to enter mode. However, in Form view, pressing

an ARROW key at the end of a control has no effect. This behavior is

by design, and is meant to ensure that pressing an ARROW key on the

last control in edit mode does not move to the next record.

References


INF: Query Error Caused by Colon in Field Name

 Article Number: Q94191

 CREATED: 29-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A query results in one of the following error messages:

      Query must have at least one output field.

   or

      Can't set criteria unless you've specified a field.

CAUSE

   The query criteria includes a field name that ends in a colon (for

   example, FieldName:).

RESOLUTION

   When a field name includes a colon, you must enclose the field name in

   brackets (for example, [FieldName:]).

STATUS

   This behavior is by design.

More Information:

In a query's Design view, you can rename a field to be more descriptive.

Place the insertion point in front of the first letter of the field name in

the QBE grid. Then type the new name followed by a colon. Do not delete the

underlying field name. Now, in Datasheet view, you will see the descriptive

label instead of the underlying field name.

Using this technique to change a field name in a query's Design view

automatically changes the heading in the query's Datasheet view, and it

changes the field name in a form or report based on the query. But the

underlying field name in the table does not change.

The error messages shown in SYMPTOMS occur because without brackets around

the field name, Microsoft Access interprets the colon in the field name as

a request to add a label (rename) that field.

Steps to Reproduce Behavior

---------------------------

1. Create a new table named Test with one field named FullName:.

2. Save the table as Table1.

3. Create a query based on Table1.

4. Drag the field FullName: to the query grid.

5. Run or view the results of the query.

6. You will receive this error:

      Query must have at least one output field.

7. Set the criteria for FullName: to a* or any other criteria.

8. You will receive this error:

      Can't set criteria unless you've specified a field.

You can prevent the error messages in steps six and eight by enclosing the

field name and colon in brackets (for example, [FullName:]).

Reference(s):

For more information, search for "Renaming a Field in a Query" using the

Microsoft Access Help menu.

References


PRB: Incorrect Characters in Crosstab Query Column Headings

 Article Number: Q94192

 CREATED: 29-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If the data in a field used as a column heading in a crosstab query

   contains a decimal, an exclamation mark, or a square bracket

   character, this character will be changed to an underscore

   character in the column heading. This does not happen if the same

   data is used as a row heading.

CAUSE

   Queries can be used as input to other queries, forms, or reports,

   and therefore column headings must be formatted as field names.

   Because field names cannot contain decimals (.), exclamation marks

   (!), or square bracket characters ([ or ]), these characters are

   converted to underscore characters in the column headings of the

   crosstab query.

STATUS

   This behavior is by design.

References


INF: Attaching to FoxPro Data in Microsoft Access

 Article Number: Q94193

 CREATED: 29-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

According to the marketing literature, Microsoft Access cannot attach

to FoxPro data, but it is able to import FoxPro data. There is an

exception to this rule, which allows a user to attach to, rather than

import, FoxPro data.

More Information:

FoxPro uses a DBF file structure, similar to the structure that dBASE

uses. However, Microsoft Access cannot attach to most FoxPro files

because the memo and index structures are different. Consequently, you

can attach a FoxPro table as a dBASE IV table if it meets the

following two conditions:

 - The FoxPro table does not contain any memo fields

 - The FoxPro table is attached without any FoxPro index files

If either of these conditions is not met, then you must import the

data from the FoxPro table instead of attaching to it.

References


INF: Importing DataEase Data Files

 Article Number: Q94194

 CREATED: 29-DEC-1992

 MODIFIED: 29-APR-1993

Summary:

Microsoft Access does not import DataEase data files directly, but you

can export your DataEase data to a formatted disk file that Microsoft

Access can import. The information is this article applies to DataEase

versions 4.2, 4.5 and 4.53 a character based relational database system.

To export DataEase data in DataEase, create a DQL report, specify the

Format as export, and set the Print Style to print to a disk file. Choose

one of the following export formats to create a file Microsoft Access can

import:

   Lotus           (creates a .WKS file)

   Variable Length (creates a delimited ASCII text file)

   Fixed Length    (creates a fixed-width ASCII text file)

More Information:

Export the DataEase data in DataEase. Then import that file in Microsoft

Access.

Export Using DataEase

---------------------

To create a formatted disk file in DataEase 4.x, create a DQL report using

the following steps. For more detailed information about creating reports,

please refer to the DataEase documentation.

1. Define the report specifying the fields you want to include in the

   output.

2. Specify the report Format as Export by choosing either Define Format or

   Modify Format under either DQL Advanced Processing or Query by Example -

   Quick Reports.

   Select 7. Export under Define Format or Modify Format. You should see

   the following list of the export formats DataEase supports.

      * 1. Lotus (wks)

        2. GrafTalk

        3. MultiMate

        4. WordPerfect

        5. Mail-Merge

      * 6. Variable Length

      * 7. Fixed Length

        8. DIF

   Choose 1, 2, or 6. Depending on your choice, DataEase may ask you if you

   want to include field names in the exported file.

3. Specify the Print Style for the report. Enter the Report Destination as

   option #3 Disk to print to a disk file. Then enter a valid file name in

   the Filename field.

Import Using Microsoft Access

-----------------------------

1. Open the database.

2. From the File menu, choose Import.

3. In the Data Source box, select the import format that matches the export

   format you chose in DataEase.

Choosing Export/Import Format

-----------------------------

Here are some things to consider when choosing an export/import format.

Microsoft Access can import Lotus (.WKS) files and create a table with

field names if you included the field names when exporting in DataEase.

During the import process, Microsoft Access asks you if the first row

contains field names. Most DataEase data types should convert to

appropriate Microsoft Access field types.

If you choose the Variable Length format when exporting, DataEase will ask

you to enter the field separator. Enter a comma (,). Microsoft Access

recognizes the comma as the default field separator.

If you choose the Fixed Length format when exporting in DataEase, you will

need to create an Import Specification file in Microsoft Access prior to

importing the file.

For additional information registered DataEase users can contact DataEase

International HotLine Support at 1-203-374-2825.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 72-81

References


PRB: Unable to Paste Information into Property Sheet

 Article Number: Q94218

 CREATED: 30-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 11252

SYMPTOMS

   You are unable to paste information into a property sheet using the

   Edit menu's Paste command. Instead, you keep creating a new label

   control on your form or report.

CAUSE

   You are using menu commands that do not apply to pop-up windows.

STATUS

   This behavior is by design.

RESOLUTION

   Use equivalent keyboard actions rather than selecting commands from

   the Microsoft Access menu bar. In this case, use CTRL+V or

   SHIFT+INSERT to paste information into a pop-up window.

More Information:

Property sheets are actually pop-up windows. When you use menu

commands, Microsoft Access returns focus (from the pop-up window) to

the parent window. When you use equivalent keyboard actions, Microsoft

Access retains focus on the current edit control (in this case the

property sheet).

Therefore, selecting the Paste command from the Edit menu will paste a

new label in the "parent" form or Report window.

Steps to reproduce behavior:

----------------------------

1. In the sample database Northwind Traders (NWIND.MDB), create a

   form based on the Orders table.

2. In this form, create a combo box bound to the Customer ID.

3. Go to the Customer List query, and copy the SQL statement to the

   Clipboard.

4. Return to the form and select the RowSource property for the combo

   box.

5. Try to paste the SQL code into the RowSource property.

If you use CTRL+V or SHIFT+INSERT, Microsoft Access pastes the

information from the Clipboard into the property sheet. If you choose

Paste from the Edit menu, Microsoft Access creates a new label on the

form.

Reference(s):

Search for keyword "pop-up forms" then "keyboard: editing keys" using

the Help menu.

References


PRB: GP Fault Using an Out of Date ODBC Driver

 Article Number: Q94219

 CREATED: 30-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 12781

SYMPTOMS

   Microsoft Access displays the following error message when

   using an out of date ODBC.DLL driver.  :

      General Protection Fault (GPF) in ODBC.DLL

CAUSE

   When Microsoft Access initiates an ODBC connection, ODBC does not check

   the version of the ODBC driver. The ODBC setup program will only replace

   an older version of the ODBC.DLL with a newer version if the file

   resides in the \WINDOWS\SYSTEM subdirectory. If the file is found

   elsewhere, ODBC setup places a copy of ODBC.DLL in the \WINDOWS\SYSTEM

   subdirectory. This can cause a problem if the directory that contains

   the older .dll is in the path, and is found first.

RESOLUTION

   Rename or delete the old ODBC.DLL and run the ODBC setup program

   from the setup disks that come with Microsfot Access. This will

   install a correct version of ODBC.DLL.

References


INF: Back Button Disabled After Selecting Wizard Type

 Article Number: Q94220

 CREATED: 30-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

When you use either the FormWizard or ReportWizard in Microsoft Access

after you select the type of Wizard to use (Single Column, Tabular,

Graph, and so on), and then choose OK to continue, the Back button is

disabled. This means that you cannot go back to reselect a different

type of Wizard. The only thing you can do is to choose Cancel and

start the Wizard process over again.

This behavior is by design.

References


INF: Access Table Structure Is Variable Length

 Article Number: Q94221

 CREATED: 30-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access will set the field length of a text field to the

length of the entered text if the text entered is shorter than the

maximum field size.

More Information:

When you set Field Size in the Field Properties of a table in design

mode, you are setting the maximum length for the field. If text

entered into that field is shorter than the specified maximum length,

then the length of that field equals the length of the text that has

been entered. This means whether you design a text column as 20

characters or 255 characters, it will only take up the amount needed

to store the field. The difference between the two is that one is

limited to 20 characters on entry while the other will allow up to 255

characters.

Reference(s):

Microsoft Access "User's Guide," version 1.0, chapter 3, page 38

References


PRACC9301: Selecting Options in Find... Dialog Box under Edit

 Article Number: Q94222

 CREATED: 30-DEC-1992

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 6459

SYMPTOMS

   There are three known problems with the Find... dialog box under

   the Edit menu in Microsoft Access:

   1. The check boxes for Match Case and Search Fields as Formatted

      work correctly when selected with a mouse, but mistakenly allow

      both boxes to be selected when using the plus (+) and minus (-) keys

      to select or clear the check boxes.

   2. There is a slight painting problem when you select the All Fields

      option button under Search In. The default value is false for the

      Match Case and Search Fields as Formatted check boxes, but after

      you select the All Fields option button, Microsoft Access dims the

      Search Fields as Formatted check box caption and selects it.

   3. After experiencing the painting problem and seeing the dimmed X in

      the Search Fields as Formatted check box, if you again select

      Current Field under Search In, Microsoft Access incorrectly selects

      the Search Fields as Formatted check box. This occurs whether you use

      the mouse or the keyboard to select Current Field.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRB: Design Error Can Occur While Machine Is Attempting Browse

 Article Number: Q94389

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 11534

SYMPTOMS

   If you open a table in Microsoft Access in Datasheet view and enter

   data, you may receive the following error message:

      Control bound to unknown column <controlname>.

CAUSE

   The only way this error can occur is if another user opens the

   table in Design view at the same time you open the table in

   Datasheet view. The other user would have to delete the field or

   control and save the modification to the table before the table is

   opened on your machine.

RESOLUTION

   This behavior is by design.

More Information:

This behavior is very hard to reproduce. The timing with opening the

table on two machines is critical.

Steps to Reproduce Behavior

---------------------------

1. Simultaneously open a table in Design view on one machine and

   Datasheet view on a second machine.

2. If timed correctly, the table will open in Design view first.

   Delete one of the fields in the table and close the table before the

   table opens in Datasheet view on the second machine.

3. On the machine that opens the table in Datasheet view, the deleted

   field should be listed. Attempt to enter data in that field. The error

   message will be displayed.

References


PRB: Press ENTER when Database Window is Minimized Opens a Doc

 Article Number: Q94390

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 12997

SYMPTOMS

   If no documents are open and you have the Database window minimized

   when you press ENTER, the object highlighted in the Database window

   will open. However, if there is an open object (minimized or not),

   nothing happens when you press ENTER on the Database window icon.

RESOLUTION

   To restore the Database window, do one of the following:

    - Double-click on the icon with the mouse.

    - Press ALT+minus sign (-) to access the Control menu, then press

      ENTER.

References


PRB: Cannot Use 'y' 'n' 't' or 'f' in Yes/No Field

 Article Number: Q94391

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The following error message is displayed:

      The value you entered isn't appropriate for this field.

CAUSE

   You may be entering a lowercase "y" or "n" into a Yes/No Boolean

   field.

RESOLUTION

   Use uppercase "Y" or "N".

References


PRB: Border Properties Ignored with SpecialEffect

 Article Number: Q94392

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The following properties are ignored when you set the SpecialEffects

   control to Sunken or Raised:

      BorderColor

      BorderWidth

      BorderStyle

STATUS

   This is behavior by design.

References


PRB: 'Welcome to Microsoft Access' Screen Disables Status Bar

 Article Number: Q94393

 CREATED: 06-JAN-1993

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   When you start Microsoft Access with the "Welcome to Microsoft

   Access" screen, the status bar will not show whether the CAPS LOCK

   and NUM LOCK keys are on or off.

RESOLUTION

   If you turn off the "Welcome to Microsoft Access" screen, the

   status bar functions normally. Another workaround is to close the

   screen, then switch the NUM LOCK and CAP LOCK keys off then on.

   This will reinitialize the status bar.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Turn on the CAPS LOCK and NUM LOCK keys.

2. Start Microsoft Access with the "Welcome to Microsoft Access"

   screen enabled.

   Notice that the status bar doesn't show that the CAPS LOCK and NUM

   LOCK keys are on.

References


PRB: Control Menu Move Command Requires Keyboard Input

 Article Number: Q94394

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   After choosing the Move command from the Control menu of any non-

   standard window, you are unable to move the window's location by

   using the mouse.

CAUSE

   There are two non-standard Microsoft Access windows: the Palette

   and Toolbox windows. Like other windows, you can move the window

   location by dragging the title bar of the window to the new

   location. But unlike other windows, dragging the title bar will

   have no effect if you choose the Move command from the window's

   Control menu.

RESOLUTION

   After choosing the Move command from the Control menu of any non-

   standard window, you must use the ARROW keys on the keyboard to

   complete moving the window.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open the sample database Northwind Traders (NWIND.MDB).

2. Using the mouse, drag the title bar of the Database window to a new

   location on your screen.

3. Release the mouse button. You will have successfully moved the

   Database window.

4. Press ALT+minus sign (-) to open the Database window's Control

   menu.

5. Choose Move.

6. Repeat steps 2 and 3 above.

7. In order to move this Window, you need to use the ARROW keys on

   your keyboard.

8. Open the Categories form in Design view. Repeat steps 2-7

   above on either the Toolbox window or the Palette window (available

   from the form's View menu).

Additional Reference(s):

Microsoft Access "Getting Started," version 1.0, page 78

References


PRB: Trailing CR/LFs Stripped from Text Box when Retrieved

 Article Number: Q94395

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Trailing carriage returns/linefeeds (CR/LFs) are stripped out when

   retrieving data from a text box. Although it is possible to stuff

   CR/LFs into a text box, when attempting to retrieve the data, the

   trailing CR/LFs are truncated.

STATUS

   We are considering modifying this behavior in a future release of

   Access.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open the Customers form in the sample database Northwind

   Traders (NWIND.MDB).

2. Open the Immediate window and position it on the screen so that it

   and the Customers form are both in view.

3. Type the following command in the Immediate window:

      Forms!Customers.[Contact Name] = "Chris" & Chr$(13) & Chr$(10)

   At this point, the Contact Name control on the form should be

   updated and should contain the text "Chris" with a blank line below

   it. This shows that the CR/LF is in the text box.

4. Type the following command in the Immediate window.

      MyValue = Forms!Customers.[Contact Name]

   The variable MyValue will contain the text "Chris", but there will

   be no CR/LF at the end of the text. This can be tested by executing

   the following command from the Immediate window:

      Print MyValue & "*"

   This will return the value "Chris*", which shows that there is no

   CR/LF at the end of MyValue.

References


INF: How to Show Field in Datasheet View But Not Form View

 Article Number: Q94396

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

There is no inherent command to display a field in Datasheet view that

is invisible in Form view. By changing the color characteristics and

the size, you can create a control that will literally be invisible in

Form view yet visible in Datasheet view.

More Information:

To create a control that is visible in Datasheet view and invisible

in Form view, you need to set the following properties of the control:

   BorderStyle: Clear

   Width: 0

   Height: 0

You will also have to remove the caption box if one exists with the

control.

Note: The drawback of this method is that although you cannot see the

control, the control still has a tab order.  Because of this, a user

can have the focus set to the control immediately before the invisible

control and press TAB. The focus will move to the control, yet the

user will not see anything, making it look as though the cursor has

disappeared. Pressing TAB again or setting focus to another control

with the mouse will cause the cursor to reappear.

References


INF: Adding a Dynamic Counter to a Query to Count Records

 Article Number: Q94397

 CREATED: 06-JAN-1993

 MODIFIED: 22-JUN-1993

Summary:

You can identify the position of a record by using a dynamic counter value

in a query field. Microsoft Access has no intrinsic function to do this,

but you can do it by using the user-defined function.

More Information:

There are two steps to the process:

1. Create a user-defined function named QCntr() to increment the counter

   for each new record. Make the function look something like this:

      Declarations:

      Global Cntr

      Function QCntr(x)

         Cntr = Cntr + 1

         QCntr = Cntr

      End Function

2. Create the following user-defined function named SetToZero to reset

   the Cntr value each time the query is run:

      Function SetToZero()

         Cntr = 0

      End Function

3. Call the function in the query field by putting QCntr() in an

   expression. Use the following as a guide:

      Field: Expr: QCntr([Field])

   Here [Field] is any field from the underlying table or query. [Field]

   is passed to the function to force evaluation of the function for

   every record in the query's dynaset. It doesn't matter which field you

   use as long as it has a valid field name.

4. Run the query from a macro with the following actions:

   Macro       Action

   ---------------------------------

   [Macroname] Run Code

               Open Query

   Macro Action Arguments

   ---------------------------------

   Run Code

      Function Name: SetToZero()

   Open Query

      Query Name: [Query Name]

      View: Datasheet

      Data Mode: Edit

   Running the query from this macro resets the function QCntr to zero

   in each iteration to provide accurate results.

References


PRB: Unable to Import Portion of Fixed-Width Text Files

 Article Number: Q94417

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You cannot import any portion of a fixed-width text file.

CAUSE

   By design, each record in a fixed-width text file must be separated from

   the next by a carriage return and line feed and all records must contain

   the same number of characters.

RESOLUTION

   Modify the text file to ensure that all records meet these requirements:

   1.  Each record is on a different line.

   2.  Each record contains the same number of characters.

More Information:

Microsoft Access cannot import fixed-width text records that are not

delimited by a carriage return or line feed.

Mainframe users may be familiar with long strings of data where the first x

number of characters are the first record, the next x number of characters

are the second record, and so on. In order to import these records into

Microsoft Access, you must ensure that each record is on its own line with

a carriage return and line feed at the end of each record.

For example, consider the following string of characters:

   lastnamefirstnameagelastnamefirstnameagelastnamefirstnameage

You cannot import these records into Microsoft Access without modification.

If you try to import the above string as a fixed-width text file, you will

either create an empty table or you will be unsuccessful and need to repair

your database.

To modify the file, use Access Basic and follow these steps:

1.  Read in the file in Binary mode with a fixed length string that is the

    same length as the record.

2.  Write each string to a new file that is opened for sequential output.

3.  Repeat steps 1 and 2 until you reach the end of file.

Microsoft Access can import the following records:

   lastnamefirstnameage

   lastnamefirstnameage

   lastnamefirstnameage

To import a file containing records like these, follow these steps:

1.  Choose Imp/Exp Setup from the File menu.

2.  Change the Text Delimiter from " to {none}.

3.  Input the following settings for Field Information:

    Field Name   Data Type   Start   Width

    --------------------------------------

    Last         Text        1       8

    First        Text        9       9

    Age          Number      17      3

4.  Choose OK, and save this specification as TEST.

5.  From the File menu, choose Import.

6.  Select Text (Fixed-Width). Then choose OK.

7.  Select the text file you want to import. Then choose Import.

8.  In the Import Text Options dialog box, select the TEST specification.

    Then choose OK.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 75-81.

References


INF: Printing Microsoft Access Reports on HP Laserjet

 Article Number: Q94418

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

When you print to an Hewlett-Packard Laserjet II, set the option Print

TrueType As Graphics in Print Setup. This is necessary because mixing

TrueType (TT) fonts and graphical objects on the HP Laserjet printer

can cause inconsistent results (that is, not true WYSIWYG). To set the

option, choose Print Setup from the File menu. Choose the Options

button. Then choose the box in the bottom left hand corner, Print True

Type as Graphics.

More Information:

Before setting the Print Option, you might see the following problems when

printing Microsoft Access reports on a Hewlett-Packard Laserjet II:

1.  Microsoft Access displays white text on a black line in the report

    preview, but it prints a solid black line.

2.  Microsoft Access begins to print reports containing lines (graphics)

    with the text aligned correctly, but subsequently prints the line and

    then prints the text shifted to the far right.

For additional information, query on the following words in the Microsoft

Knowledge Base:

   TRUETYPE and GRAPHICS and LASERJET

References


PRB: Exclusively Locked Error When Attaching to Btrieve Table

 Article Number: Q94419

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When attaching a Btrieve table, you get the following error message when

   you choose FILE.DDF:

      Table <tablename> is exclusively locked.

   or

      Couldn't open file <filename>.

CAUSE

   When attaching a table, Microsoft Access needs to open the target

   Btrieve table exclusively for a moment. If any other user has the target

   table open at the same time Microsoft Access is attempting to attach it,

   you will see one of these error messages.

RESOLUTION

   Find an available time when no other user is using the target Btrieve

   table. Once Microsoft Access attaches the Btrieve table successfully,

   you will no longer receive the error messages.

References


PRB: Corrupt Error Message When Attaching Btrieve Table

 Article Number: Q94420

 CREATED: 06-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 207

SYMPTOMS

   When trying to attach to a Btrieve table, you receive this error:

      <tablename> is corrupted or isn't a Microsoft Access database.

CAUSE

   When Microsoft Access attaches a Btrieve table, it compares information

   in the Xtrieve dictionary file (FILE.DDF) with information in the

   TBLNAME.DAT file. The most common cause of the above error message is

   a difference in the index information.

RESOLUTION

   To prevent the error message, redefine the Btrieve index to make it

   exactly the same length as the length of the field it indexes.

More Information:

In the Btrieve file format, the length of the index may not match the

length of the field. This is valid in the Btrieve file format. The Xtrieve

dictionary file (FILE.DDF) ignores these indexes, but Microsoft Access

interprets them as invalid and returns the error message.

You can correct the problem by turning the invalid indexes into valid

indexes by using one of these options:

1. Ask the vendor who created the Btrieve files to change the index so

   that the length of index matches the length of the indexed field.

2. Use Btrieve to redefine the index so that its length matches that of

   the indexed field.

3. Use Xtrieve to redefine the index so that its length matches that of

   the indexed field.

4. Use any third party utility that is available to modify the Btrieve

   index so that its length matches that of the indexed field.

Here are four examples that require a change to the Btrieve index:

Example #1:

-----------

The TBLNAME.DAT file is defined with three columns:

    Column name   Field Length    Index Length

    ------------------------------------------

    Firstname     10              <= Combined length of

    Lastname      10              <= 20 characters

    Company       25

Index1 is defined with a length of 20 characters, the combined length of

the Firstname and Lastname fields.

Resolution: redefine the Btrieve index into one multiple-segment index

giving each segment a defined length of 10 characters.

Example #2:

-----------

The TBLNAME.DAT file is defined with three columns:

    Column name   Field Length    Index Length

    ------------------------------------------

    Firstname     10              4 characters

    Lastname      10

    Company       25

Index2 is defined with a length of 4 characters -- shorter than the defined

length of the Firstname field.

Resolution: redefine the Btrieve index on Firstname. Give it a 10-character

length to match the size of the Firstname field.

Example #3:

-----------

The TBLNAME.DAT file is defined with three columns:

    Column name   Field Length    Index Length

    ------------------------------------------

    Firstname     10              12 characters

    Lastname      10

    Company       25

Index3 is defined with a length of 12 characters -- slightly longer than

the defined length of the Firstname field.

Resolution: redefine the Btrieve index on Firstname. Give it a 10-character

length to match the size of the Firstname field.

Example #4:

-----------

The TBLNAME.DAT file is defined with three columns:

    Column name   Length

    --------------------

    Firstname -   10

    Lastname  -   10

    Company   -   25

Index4 is defined on a numeric byte range index. There is no index defined

on any field in the table.

Resolution: remove the numeric-byte-range index completely. Then redefine

the index on an existing field ensuring that the length of the index

matches the length of the indexed field.

References


INF: System Objects Retain System Object Properties

 Article Number: Q94597

 CREATED: 11-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

A system object always retains the original system object attributes.

Operations performed on system objects such as Import, Rename, and

Copy all preserve the flags in MSysObjects.

More Information:

Operations such as Import, Rename, Copy, and Paste do not change the

flags in MSysObjects. In order to get a copy of a system table without

retaining the system settings, you should use a Make Table query.

Steps to Reproduce Behavior

---------------------------

1. From the View menu, choose Options. Set the argument for Show

   System Objects to Yes.

2. Import the MSysAccounts table from the SYSTEM.MDA database.

3. Rename the imported table to Tablefoo.

4. From the View menu, choose Options. Set the argument for Show

   System Objects to No.

The table Tablefoo disappears from the database container list because

it has the attributes of a system object.

References


PRB: Incorrect Action Query Message Box Text

 Article Number: Q94598

 CREATED: 11-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   An error message generated by an action query (that is, a delete,

   make-table, update, or append query) may contain the following

   incorrect message box text:

      Errors were encountered: The contents of fields in <number>

      record(s) were deleted, <number> record(s) were lost due to

      key violations and <number> record(s) were locked and couldn't

      be modified. Proceed anyway?

CAUSE

   This problem is caused by the way Microsoft Access handles errors for

   action queries. Microsoft Access uses the same error message for every

   action query instead of using a separate error message for each type

   of action query.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. Microsoft is researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

Steps to Reproduce Problem

--------------------------

1. Create the following two tables:

      Table: Table1

      -------------

      FieldName: ID  [PrimaryKey]

         DataType: Text

      FieldName: Name

         DataType: Text

      Table: Table2

      -------------

      FieldName: ID

         DataType: Text

      FieldName: Hobby

         DataType: Text

2. Create a one-to-many relationship between Table1 and Table2, with

   ID as the matching field. Enforce referential integrity rules.

3. Add two records to each table.

4. Create the following query based on Table1:

      Query: Query1

      -------------

      Field: ID

      Field: Name

5. Change Query1 from a Select query to a Delete query by choosing

   Delete from the Query menu.

6. Run Query1 by choosing Run from the Query menu.

7. Choose the OK button to delete the records.

The following error message is displayed:

   Errors were encountered: The contents of fields in 0 record(s) were

   deleted, 2 record(s) were lost due to key violations and 0 record(s)

   were locked and couldn't be modified. Proceed anyway?

This message correctly identifies that there were key violations

(because of referential integrity), but it incorrectly indicates the

loss of two records. In actuality, the records were not modified and

therefore not lost.

References


INF: Placing the User Login Name on a Form or in the Title Bar

 Article Number: Q94599

 CREATED: 11-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

This article explains how to use the User() function to display the current

user name in a control on a Form or in the title bar of the Microsoft

Access window.

More Information:

In Microsoft Access, you can implement security to control user access to

the different objects in your database. Then you can use the User()

function to display the current user.

How to Display User Name in a Control on a Form

-----------------------------------------------

Use the following procedure to display a user name in a control on a form:

1. Create a form and place an unbound text box control on the form.

2. Enter =User() in the text box ControlSource property.

3. Change to Form view to see the current user name displayed in

   the control.

Display user name in Microsoft Access Window Title Bar

------------------------------------------------------

Use the following procedure to display a user name in the title bar of the

Microsoft Access window:

1. Create a new module.

2. Enter the following Access Basic code, but do not enter the underline

   character (_) that appears on the end of a line; the underline

   character indicates line continuation. Enter the entire continued line

   as one line of text -- without the underline continuation character.

   '=====================================================================

   'Declarations section of the module

   '=====================================================================

   Option Explicit

   Declare Function SendMessage& Lib "User" (_

                ByVal hw%, ByVal message%, ByVal wParam%, LParam As Any)

   Declare Function GetActiveWindow% Lib "User" ()

   Const WM_SETTEXT = &HC

   DIM stTitle$

   DIM x%

   '=====================================================================

   'The following function places the user name in the title bar.

   '=====================================================================

   Function SetDatabase windowWindowTitle ()

      stTitle$ = "User = " + User()

      x% = SendMessage(GetActiveWindow(), WM_SETTEXT, 0, ByVal stTitle$)

   End Function

   '=====================================================================

   'End of code section

   '=====================================================================

4. Save the module.

5. Create a new macro (ShowUser). Give it the RunCode action with the

   following function name as the action argument:

      SetDatabase windowWindowTitle()

   Save the macro and name it ShowUser.

6. From the Run menu, choose Compile All.

7. Restart Microsoft Access and run the ShowUser macro. You should see the

   window title change from Microsoft Access to User = username

Reference(s):

For more information, search for "User," then "User Function" using the

Microsoft Access Help menu.

References


PRB: 'Invalid Database Object' Occurs Inexplicably

 Article Number: Q94600

 CREATED: 11-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you are trying to use a database object (Database, QueryDef,

   Table, Dynaset, Snapshot) within Access Basic, you may receive the

   following error:

      Invalid Database Object.

CAUSE

   The problem occurs if you are within a transaction, you call

   another function or procedure which dimensions the database, and

   then leave the function or procedure which implicitly close the

   object that was opened within the transaction.

   In this case Microsoft Access will try to close it and since it was

   opened within a transaction, Microsoft Access will roll back ALL

   levels of  nested transactions.

   If any other database objects were opened within the transaction,

   rolling back has the effect of closing them. This means that any

   references to an object opened within a transaction after another

   object was forced to be implicitly closed will result in 'Invalid

   database object'.

   This problem will not occur if you always close database objects

   before they go out of scope. The problem only occurs if you

   Microsoft Access implicitly close them.

RESOLUTION

    - You should always try to open database objects outside of

      transactions.

    - You should always explicitly close database objects.

More Information:

Steps to Reproduce Behavior

---------------------------

The following code fragment will illustrate the problem.

   Sub One()

      Dim MyDB As Database, MyTable As Table

      Set MyDB = CurrentDB()

      BeginTrans

         Set MyTable = MyDB.OpenTable("Table1")

         Call Bar

         Debug.Print MyTable.RecordCount '"Invalid database object."

         MyTable.Close

      CommitTrans

      MyDB.Close

   End Sub

   Sub Two()

      Dim MyDB2 as Database

      Set MyDB2 = CurrentDB()

   End Sub

MyDB looses scope, implicitly does roll back and close of MyDB with

effect of also closing MyDB in the One function.

To circumvent the problem, change the procedure Two to:

   Sub Two()

      Dim MyDB2 as Database

      Set MyDB2 = CurrentDB()

      MyDB2.Close

   End Sub

References


PRB: GraphWizard Does Not Run or 'Syntax Error' Is Displayed

 Article Number: Q94601

 CREATED: 11-JAN-1993

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   If you choose the Graph icon from the toolbox, the GraphWizard does

   not run, or the following error message is displayed:

      Syntax Error

CAUSE

   This error is caused by an incorrect List Separator entry in the

   [International] section of your WIN.INI file.

RESOLUTION

   In Control Panel, select the International icon. In the List

   Separator box, enter the default value, a comma (,). Microsoft

   Graph should now run correctly. Note that different List Separator

   entries will cause different results.

More Information:

Steps to Reproduce Behavior

---------------------------

1. In Control Panel, select the International icon.

2. Change the List Separator.

   Different settings will cause different results. For example, a

   minus sign (-) will not open Graph or give an error message. A

   space will generate a "Syntax Error" message.

3. Create a new form.

4. Choose the graph icon from the toolbox.

5. Select an area on your form and click the mouse to insert the

   graph. The border will briefly appear, but then disappear without

   opening the GraphWizard, or the "Syntax Error" message will be

   displayed.

References


INF: Use Append Query to Set Initial Value of Counter Field

 Article Number: Q94821

 CREATED: 19-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

You can change the starting value of a Counter field to a number other than

one by using the append action query.

More Information:

By design, Microsoft Access always begins a Counter field with the number

one. You cannot edit a Counter field or change its starting value unless

you use this procedure:

1. Create a new table containing a single Number field. Give the Number

   field a name identical to the name of the Counter field in the original

   table.

   For example, say the name of the original table is Receiving, and it

   contains two fields with this structure:

      Table: Receiving

      ----------------

      FieldName: ID Number

      Data Type: Counter

      FieldName: Name

      Date Type: Text

   You need to create a new table containing a single Number field. Save it

   and name the new table Sending. Here is the structure:

      Table: Sending

      --------------

      FieldName: ID Number

      Data Type: Number

      FieldSize: Long Integer

2. Open the new table (Sending) and add a record by inserting a value in

   the Number field. The value you enter needs to be one less than the

   starting value you want for the Counter field. For example, if you want

   to start the counter at 100, enter 99 in the Number field.

3. Create an append action query to append the single record from the new

   table (Sending) to the original table (Receiving) using the following as

   a guide:

      Query: AppendCounter

      --------------------

      FieldName: ID Number

          Table: Sending

       AppendTo: ID Number

4. After you append the single record, delete the new table (Sending). Then

   delete the appended row from the original table (Receiving). Now you are

   ready to add a new record to the original table.

   NOTE: Do not compact the database before adding a new record to the

         original table, or Microsoft Access will reset the Counter value

         to one.

Reference(s):

For more information on append action queries and Counter fields, search on

the following words here in the Microsoft Knowledge Base:

   counter and append

For more information on customizing Counter fields, search on the following

words here in the Microsoft Knowledge Base:

   counter and custom

Also see the "Microsoft Access User's Guide," version 1.0, Chapter 7,

"Designing Action Queries and Parameter Queries," page 174.

References


INF: How to Install the Database Analyzer on the Help Menu

 Article Number: Q94822

 CREATED: 19-JAN-1993

 MODIFIED: 23-APR-1993

Summary:

To add the Database Analyzer to your menu bar, add the following lines

the MSACCESS.INI file in the Windows directory:

   [Menu Add-ins]

   &Database Analyzer==StartAnalyzer()

   [Libraries]

   Analyzer.MDA=

Restart Microsoft Access. Now, Database Analyzer appears as a choice on the

Help menu. When you choose Database Analyzer from the Help menu, Database

Analyzer automatically starts. Now, it will appear as a menu option when

you open any database.

For information on adding other items to the Help Menu, query on the

following words in the Microsoft Knowledge Base:

   MSACCESS.INI and MENU

For additional information on the Database Analyzer, review the PSSKB.TXT

text file in the Access directory. The answer to the last question (23) in

the PSSKB.TXT file describes the Database Analyzer utility.

References


INF: Error Messages May Be Caused by International Setting

 Article Number: Q94825

 CREATED: 19-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   An attempt to enter an expression that requires a list separator

   into the QBE grid field or criteria cells, or as the ControlSource

   for a text box in a Form or Report fails and Microsoft Access

   generates the following message:

      Syntax error.

   An attempt to enter an expression that requires a list separator

   into an Action Argument for a Macro action fails and Microsoft

   Access generates the following message:

      Can't parse expression: 'Expression that was entered.'

CAUSE

   These errors can be caused by an incorrect setting for the "slist"

   parameter in the [intl] section of your WIN.INI file. This setting

   specifies the character used to separate items in a list. In United

   States English, the most common list separator is a comma (,).

RESOLUTION

   There are three methods to address this situation, as follows:

    - Use the Microsoft Windows Control Panel to modify the list

      separator in your WIN.INI file. Choose International from the

      Settings menu. Specify the correct separator in the List

      Separator field.

    - Use a text editor to modify the list separator in your WIN.INI

      file.

    - Modify the expression to use the list character specified in

      your WIN.INI file.

More Information:

When this error occurs, the WIN.INI file might appear as follows:

   [intl]

   slist=;

The default United States English settings are as follows:

   [intl]

   slist=,

References


PRACC9301: Wrong RowSourceType for Combo Box Causes GP Fault

 Article Number: Q94826

 CREATED: 19-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you set the RowSourceType for a combo box or list box to an invalid

   value, when you switch from Form Design view to Form Browse view, a

   general protection (GP) fault may occur.

CAUSE

   Valid values for the RowSourceType property are Table/Query, Value

   List, and Field List. If RowSourceType is set to Table/Query, an SQL

   SELECT statement is a valid value for the RowSource property.

   If an SQL statement is incorrectly entered into RowSourceType, a GP

   fault may occur. This problem may also occur if the RowSourceType

   information includes random characters.

RESOLUTION

   Be sure that RowSouceType is set to a valid value: Table/Query, Value

   List, or Field List.

STATUS

   We are researching this problem and will post new information here

   in the Microsoft Knowledge Base as it becomes available.

More Information:

Steps to Reproduce Problem

--------------------------

1. In the sample database NWIND.MDB, create a new, unbound blank form,

   and place a combo box on the form.

2. If RowSourceType is set to

      Select [employee id] from employees;

   when you switch from Form Design view to Form Browse view, a dialog

   box with the following text is displayed:

      'select [employee id] from employees;' isn't a valid setting for

       RowSourceType property.

   Choosing OK at this point would switch you to Form Browse view. (If

   you are using a list box, #Error is displayed in the list box.)

3. If the WHERE clause [employee id] = 7 is added to the SQL statement

   in RowSourceType, the result is the same.

   If the WHERE clause is changed to [employee id] = forms!form10!xx,

   a GP fault occurs, and the following message is displayed:

      Application Error  MSACCESS caused a General Protection

      Fault in module MSACCESS.EXE at 009A:09F6.

   Note: xx, as referred to in the WHERE clause, is not a control on

   the form.

For more information, search for "RowSource," then "Filling a List Box

or Combo Box Using an SQL Statement" using the Help menu.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 9, "Designing

Forms," pages 242-244

References


INF: Definitions for Settings in WIN.INI Btrieve Section

 Article Number: Q94827

 CREATED: 19-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access uses the Btrieve section of the WIN.INI file when it

uses Btrieve files. After you install Microsoft Access, the WIN.INI file

contains the following default settings in the [btrieve] section:

[btrieve]

options=/m:64 /p:4096 /b:16 /f:20 /l:40 /n:12 /t:C:\ACCESS\BTRIEVE.TRN

More Information:

Although these are the recommended option settings, you can change

these options in your WIN.INI file using the following table as a

guide. If the option you want to set is not on the line, add the

option and desired setting at the end.

Option   Description                 Required Value

------   -----------                 --------------

/m       Memory Size                 At least 38

/p       Page Size                   4096

/b       Pre-Image Buffer Size       16

/f       Open Files                  At least 4

/l       Multiple Locks              At least double the setting for

                                     the Open Files option (/f)

/n       Files in a Transaction      At least 4

/t       Transaction Filename        Valid path to a .TRN file;

                                     in a multiuser environment, the

                                     network path to the .TRN file is

                                     shared by all users

/u       Compression Buffer Size     If your Btrieve data files are

                                     compressed, at least the length

                                     (in kilobytes) of the longest

                                     record in your data files

/i       Pre-image File Drive

/c       Index Compaction

/a       Activate Logging

/s       Discard Unneeded Segments

For more information on these options, see Novell's manual "Btrieve for

Windows Installation and Operation."

References


PRB: Empty Table List When Attaching Btrieve Table

 Article Number: Q94828

 CREATED: 19-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   While attaching a Btrieve table, you select the Xtrieve dictionary file

   (FILE.DDF) in the Select File dialog box. When you choose OK, Microsoft

   Access should open the dictionary file and display the tables you can

   import or attach, but the list is empty.

CAUSE

   The most likely cause is that you are missing the FIELD.DDF that

   Microsoft Access requires to attach a Btrieve table.

RESOLUTION

   Microsoft Access requires the following .DDF files in order to be able

   to attach a Btrieve table: FILE.DDF, INDEX.DDF, and FIELD.DDF. Make sure

   you have all three of .DDF files before attempting to attach a Btrieve

   table.

More Information:

When Microsoft Access cannot find the FIELD.DDF file, it creates a new

dummy FIELD.DDF in the same directory as the FILE.DDF and gives it a size

of 6144 bytes (6K). Check for this file. If you find a 6144-byte FIELD.DDF

file, you will know for sure that you are indeed missing the required

FIELD.DDF file. Use Xtrieve or a third party utility to create the required

.DDF files.

References


PRB: Btrieve Files Created with Btrieve 6.0 NLM Not Supported

 Article Number: Q94829

 CREATED: 19-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you attempt to attach to a Btrieve FILE.DDF file, the

   following error message is displayed:

      Disk or Network error

RESOLUTION

   The above error message will be returned if you are attempting to

   attach to a Btrieve file created with the Btrieve 6.0 NLM version.

   Microsoft Access does not support Btrieve files created with this

   networked version of Btrieve. Microsoft Access only supports

   Btrieve files created with Btrieve 5.x.

References


INF: Creating Result Equivalent to SQL UNION Operator Result

 Article Number: Q94830

 CREATED: 19-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

The SQL UNION operator is not supported in Microsoft Access. However,

you can obtain an equivalent result (a UNION product) by using the

following two-step process to create two queries, a make-table query

and an append query.

More Information:

The product of a UNION includes all records from two related tables --

those that match on the related key field and those that don't match

on the related key field.

For example, say you have two tables, Table A and Table B. Table A

contains the following fields and records:

   Key1    Field A

   ------------------

   1       Seattle

   2       Portland

   4       Chicago

Table B contains the following fields and records:

   Key2    Field B

   -----------------

   1       Washington

   3       Oregon

   5       Illinois

The UNION product of the two tables would look like this:

   Key     Field A     Field B

   ---------------------------------

   1       Seattle      Washington

   2       Portland

   3                    Oregon

   4       Chicago

   5                    Illinois

Use the following two-step process to obtain a UNION product in Microsoft

Access:

Step One: Collect the Records that Have a Matching Key Value

------------------------------------------------------------

1. Create a query, and add the two tables (Table A and Table B) to the

   query grid.

2. Join the two tables by using the mouse to connect Key1 in Table A to

   Key2 in Table B.

3. Double-click the join line between the two tables to bring up the Join

   Properties dialog box. Select the second option, "Include ALL records

   from 'Table A' and only those records from 'Table B' where the joined

   fields are equal."

4. Add three fields to the query grid: Key1 from Table A, Field A from

   Table A, and Field B from Table B. You can use the mouse to drag these

   fields onto the query grid.

5. Choose Make Table... from the Query menu. The Query Properties

   dialog box appears. The default selection is Current Database under

   Make New Table. Enter an appropriate table name (for example,

   UNION Result) for the result table, and choose the OK button.

6. Run the query to create the new table (UNION Result). It will contain

   the following fields and records:

      Key1       Field A      Field B

      ------------------------------------

      1          Seattle      Washington

      2          Portland

      4          Chicago

Step Two: Add the Rest of the Records to the Result

---------------------------------------------------

To complete the UNION, you need to add the records in Table B that do not

have a matching key field value in Table A.

1. Create another new query. Add two tables (Table B and UNION Result) to

   the query grid.

2. Join the two tables by using the mouse to connect Key2 in Table B to

   Key1 in the UNION Result table.

3. Double-click the join line between the two tables to bring up the Join

   Properties dialog box. Select the second option, "Include ALL records

   from 'Table B' and only those records from 'UNION Result' where the

   joined fields are equal."

4. Add three fields to the query grid: Key2 from Table B, Field B from

   Table B, and Key1 from UNION Result. You can use the mouse to drag

   the fields onto the query grid. You don't need Field A from UNION

   Result because UNION Result already contains all the rows from Table A.

5. Choose Append... from the Query menu. The Query Properties dialog box

   appears. Ensure that UNION Result is in the Table Name field under

   Append To. Then click the OK button.

6. Verify that the query grid how has a line labeled Append To. Choose

   Table Names from the View menu to show table names on the query grid.

   Now the query grid should look something like this:

          Field:   Key2       Field B      Key1

          Table:   Table B    Table B      UNION Result

           Sort:

      Append To:   Key1       Field B

       Criteria:                           Is Null

   Note that the Key1 field from the UNION Result table is not appended

   to anything and it has an Is Null restriction on it. This ensures that

   no records from UNION Result are duplicated and appended to it when you

   run the append query.

7. Run the append query. then the UNION Result table will look like this:

      Key1    Field A         Field B

      ---------------------------------------

      1       Seattle         Washington

      2       Portland

      3                       Oregon

      4       Chicago

      5                       Illinois

   As you can see, record 1 has a match on the joined fields, but all the

   other records are represented only once. This is the correct UNION

   product. If the Key1 values in UNION Result are not in ascending order,

   it is because there is no primary key on that column.

References


PRB: Cannot Process Close Action in Report's OnOpen Property

 Article Number: Q94926

 CREATED: 25-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You receive the following error message when you attempt to process

   a Close Action in a macro that is assigned to the OnOpen property

   of a report:

      Can't run this action while processing a report event.

STATUS

   This behavior is by design.

RESOLUTION

   Do not assign a Close action in a macro that is assigned to the

   OnOpen property of a report.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new macro called CloseForm:

      Macro Name    Action

      --------------------

      CloseForm     Beep

                    Close

         CloseForm Actions

         -----------------

         Close

            Object Type: Form

            Object Name: Form1

2. Create another new macro called CloseReport:

      Macro Name    Action

      ------------------

      CloseReport   Beep

                    Close

         CloseReport Actions

         -----------------

         Close

            Object Type: Report

            Object Name: Report1

3. Create a new form, and assign the CloseForm macro to the form's

   OnOpen property. Save this form as Form1.

4. Switch to Form view.

5. Create a new report, and assign the CloseReport macro to the

   report's OnOpen property. Save this report as Report1.

6. Switch to Print Preview.

7. The computer will beep, and the following error message will be

   displayed:

      Can't run this action while processing a report event.

   Notice that you received this error message with the report, but not

   when using the Close action with the OnOpen property of a form.

References


INF: How to Convert Twips to Pixels

 Article Number: Q94927

 CREATED: 25-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

Because Access stores dimension/location properties as twips, it may

be necessary to convert to pixels in certain cases, such as when

calling a Windows API function. This article describes how to do this.

This article assumes that you are familiar with Access Basic and

how to create and use Access Basic procedures.

More Information:

The ConvertTwipsToPixels() function below can be used to convert twips

to pixels. Note that pixels are not always square (the height and

width are not the same), so it is necessary to pass in the desired

"direction" to use (horizontal or vertical).

To add this function to your application, do the following:

1. Create a new module and enter the following Windows API declarations

   and constants into the Declarations section:

   Note: An underscore (_) is used as a line continuation character.

   You need to combine the lines containing an underscore so that they

   are entered as one line of text.

      Option Explicit

      Declare Function GetDC% Lib "User" (ByVal hw%)

      Declare Function ReleaseDC% Lib "User" (ByVal hw%, ByVal hDC%)

      Declare Function GetDeviceCaps% Lib "GDI" (ByVal hDC%, _

                                                 ByVal iCapability%)

      Const WU_LOGPIXELSX = 88

      Const WU_LOGPIXELSY = 90

2. Add the following function:

      Function ConvertTwipsToPixels (nTwips%, nDirection%) As Integer

         Dim hDC%                        'Handle to device

         Dim nPixelsPerInch%

         Const nTwipsPerInch = 1440

         hDC% = GetDC(0)

         If (nDirection% = 0) Then       'Horizontal

            nPixelsPerInch% = GetDeviceCaps(hDC%, WU_LOGPIXELSX)

         Else                            'Vertical

            nPixelsPerInch% = GetDeviceCaps(hDC%, WU_LOGPIXELSY)

         End If

         hDC% = ReleaseDC(0, hDC%)

         ConvertTwipsToPixels = (nTwips% / nTwipsPerInch%) * nPixelsPerInch

      End Function

3. To call this function, pass the number of twips you want to convert,

   and another parameter indicating whether the horizontal or vertical

   measurement (0 for horizontal, non-zero for vertical). The following

   is a sample call:

      OldTwips = 2377

      NewPixels = ConvertTwipsToPixels(OldTwips, 0)

References


PRB: 'Not Enough Memory to Run SETUP.EXE' Error

 Article Number: Q94928

 CREATED: 25-JAN-1993

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   An attempt to run the Microsoft Access Setup program fails and

   Setup displays one of the following out-of-memory error messages:

      Insufficient Memory

  -or-

      Not enough memory to run SETUP.EXE

   When this error occurs, sufficient space is available on the disk

   you are installing Microsoft Access to and your AUTOEXEC.BAT file

   contains a valid SET TEMP statement that specifies a directory that

   has free disk space.

CAUSE

   One cause of this error relates to an incorrect CMOS setting for

   the floppy disk drive from which Microsoft Access is installed.

RESOLUTION

   Modify the CMOS setting to correctly configure the disk drive. If

   you need assistance to change the settings appropriately, contact

   your dealer or hardware manufacturer.

More Information:

The error messages above can occur when you install Microsoft Access

from a 1.2 MB disk drive and the CMOS setting for that drive indicates

that it is a 360 KB disk drive.

References


INF: Exporting Queries to ASCII

 Article Number: Q94929

 CREATED: 25-JAN-1993

 MODIFIED: 25-APR-1993

Summary:

Microsoft Access does not have a documented feature to export the

results of a query to ASCII text files. However, this feature is

available through the use of the TransferText macro action.

More Information:

The TransferText macro action does not specify the use of query names

in the TableName parameter of the action. The parameter does not use a

combo box for table name choices, so the user is not limited to using

table names. By using the name of a query in the TableName parameter

of a TransferText action, the results of a query can be exported to

text files. This feature is undocumented. For specific instructions on

using the TransferText macro action, search for TransferText using the

Help menu.

References


INF: How to Manipulate the Microsoft  Window
INF: How to Manipulate the Microsoft Access Window

 Article Number: Q94930

 CREATED: 25-JAN-1993

 MODIFIED: 25-JAN-1993

Summary:

To manipulte the Microsoft Access window, you must call two Windows

API functions, FindWindow and ShowWindow.

More Information:

The sample code below described how to size the Microsoft Access

window using the ShowWindow API function.

For more information about the FindWindow function, query on the

Microsoft Knowledge Base for the following key words:

        FINDWINDOW and WACCESS

The function ShowWindow requires two arguments, the handle(hWnd%) of

the window that you would like to manipulate, and a

constant(nCmdShow%) specifying how to you would like to show this

specific window. The constants for the functions are defined as:

   SW_HIDE.............Hides the window and passes activation to

                       another window.

   SW_MINIMIZE.........Minimizes the specified window and activates

                       the top-level window in the system's list.

   SW_RESTORE..........Activates and displays a window. If the window

                       is minimized or maximized, Windows restores it

                       to its original size and position (same as

                       SW_SHOWNORMAL).

   SW_SHOW.............Activates a window and displays it in its

                       current size and position.

   SW_SHOWMAXIMIZED....Activates a window and displays it as a

                       maximized window.

   SW_SHOWMINIMIZED....Activates a window and displays it as an icon.

   SW_SHOWMINNOACTIVE..Displays a window as an icon. The window that

                       is currently active remains active.

   SW_SHOWNA...........Displays a window in its current state. The

                       window that is currently active remains active.

   SW_SHOWNOACTIVATE...Displays a window in its most recent size and

                       position. The window that is currently active

                       remains active.

   SW_SHOWNORMAL.......Activates and displays a window. If the windows

                       minimized or maximized, Windows restores it to

                       its original size and position (same as

                       SW_RESTORE).

To duplicate the example below, create a new module and paste the

Option, Declare and Global statements into the Global Declaration

section window. Add the MaxAccess function. Show Microsoft Access as

a restored window. In the Immediate window, type:

   ?MaxAccess()

At this point, Microsoft Access should be maximized.

Code Example

------------

The '_' is a line continuation character only for this editor.

You need to combine the lines so that they are entered as one line of

text.

Option Compare Database   'Use database order for string comparisons

Option Explicit

Declare Function FindWindow% Lib "User" (ByVal lpClassName As Any,

                    ByVal lpWindowName As Any)

Declare Function ShowWindow% Lib "User" (ByVal hWnd%, ByVal nCmdShow%)

Global Const SW_HIDE = 0

Global Const SW_MINIMIZE = 6

Global Const SW_RESTORE = 9

Global Const SW_SHOW = 5

Global Const SW_SHOWMAXIMIZED = 3

Global Const SW_MINIMIZE = 6

Global Const SW_SHOWMINNOACTIVE = 7

Global Const SW_SHOWNA = 8

Global Const SW_SHOWNOACTIVATE = 4

Global Const SW_SHOWNORMAL = 1

Function MaxAccess ()

   Dim AccessClassName$

   Dim AccessHwnd%

   Dim X%

   AccessClassName$ = "OMain"

   AccessHwnd% = FindWindow(AccessClassName$, 0&)

   X% = ShowWindow%(AccessHwnd%, SW_SHOWMAXIMIZED)

End Function

Reference(s):

"Microsoft Windows 3.1 Programmer's Reference", Volume 2, page 908

References


INF: Creating Custom Navigation (VCR) Buttons on a Form

 Article Number: Q94931

 CREATED: 25-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

You can use the Go To command on the Records menu, the Up and Down Arrow

keys, Page Up and Page Down, or the vertical scroll bar to move between

records in a datasheet or form. However, the most efficient way to move

between records in large databases is with the navigation buttons in the

horizontal scroll bar lower-left corner of the window. These navigation

buttons are also known as VCR buttons.

You can replace the VCR buttons with custom navigation buttons. This

article describes how to add command buttons to the form that to go to

the first, last, next, and previous actions.

This article assumes that you are familiar with Access Basic and how

to create and use Access Basic procedures.

More Information:

Use the following steps to create custom first, last, next, and previous

buttons on a form to replace the VCR buttons:

1. Create four command buttons. Place them on the form in an appropriate

   place. Make the following changes to the command button properties:

      Object: command button

      ----------------------

      ControlName: First

      Caption: First

      OnPush: =GotoRecord("First")

      Object: command button

      ----------------------

      ControlName: Last

      Caption: Last

      OnPush: =GotoRecord("Last")

      Object: command button

      ----------------------

      ControlName: Next

      Caption: Next

      OnPush: =GotoRecord("Next")

      Object: command button

      -----------------------

      ControlName: Previous

      Caption: Previous

      OnPush: =GotoRecord("Previous")

3. Open a new module or a previously created module and enter this code:

' Note: Enter each command on one line. The underline (_) is a line

' continuation character used to improve readability of the code. Do not

' enter it when entering the command.

'*************************************************************

'Declarations section of the module.

'*************************************************************

Option Explicit

'=============================================================

' Create the following GotoRecord() function in the Module

'=============================================================

   Function GotoRecord (ByVal Direction As String) As Variant

      Dim Choice, HoldChoice As Integer

      Dim MyForm As Form

      Direction = UCase(Direction)

      Select Case Direction

         Case "FIRST":

            Choice = 1

            Forms(Screen.Activeform.Formname)!Next.Enabled = -1

            Forms(Screen.Activeform.Formname)!Previous.Enabled = -1

         Case "LAST":

            Choice = 2

            Forms(Screen.Activeform.Formname)!Next.Enabled = -1

            Forms(Screen.Activeform.Formname)!Previous.Enabled = -1

         Case "PREVIOUS":

            Choice = 3

            Forms(Screen.Activeform.Formname)!Next.Enabled = -1

         Case "NEXT":

            Choice = 4

            Forms(Screen.Activeform.Formname)!Previous.Enabled = -1

         Case Else

      End Select

      If Choice <> 0 Then

         HoldChoice = Choice

         Choice = Choose(Choice, A_FIRST, A_LAST, A_PREVIOUS, A_NEXT,_

                            A_NEWREC)

         On Error GoTo ErrorTrap

         DoCmd GoToRecord A_FORM, Screen.Activeform.Formname, Choice

         Exit Function

      End If

   ErrorTrap:

      If HoldChoice = 3 Then

         DoCmd GoToControl "Next"

         Forms(Screen.Activeform.Formname)!Previous.Enabled = 0

      ElseIf HoldChoice = 4 Then

         DoCmd GoToControl "Previous"

         Forms(Screen.Activeform.Formname)!Next.Enabled = 0

      End If

      Resume Next

   End Function

4. Save the function in the module.

Now you can port the four buttons and the function to any form by using

the Screen.ActiveForm.Formname property, which returns the name of the

active form. This makes the GotoRecord() function universal. For the

function to work correctly, you need to ensure that the control names

of the buttons are identical to what is specified in this article.

Reference(s):

"Microsoft Access Introduction to Programming," version 1.0.

References


PRB: Apply Default Doesn't Change Height or Width of Labels

 Article Number: Q95003

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 11719

SYMPTOMS

   An existing label control's Height and Width property settings are

   not affected when you select the control in the Form or Report window's

   Design view and choose Apply Default from the Layout menu. Instead, the

   size of the label adjusts to fit the text in that control.

STATUS

   This behavior is by design. The default height and width only affects

   the size of a box created for a new label. Labels that already contain

   text are not affected.

More Information:

When creating a new report or form or modifying an existing one, you can

change the default properties for any type of control. Default properties

are the ones that determine the general appearance and behavior of a

control.

To display the default properties for a particular control type in a form

or report, switch to Design view and display the toolbox and property

sheet. To display the toolbox, choose Toolbox from the View menu. To

display the property sheet, click the Properties button on the toolbar,

or choose Properties from the View menu. Select any tool in the toolbox

to see the default properties for that type of control.

Once you change the default properties for a particular control type, you

can choose Apply Default from the Layout menu to apply the new defaults to

existing controls of that type on a form or report. For most control types,

all properties listed in the default property box will be applied to the

selected control. However, for Label controls, the Width and Height settings

are not reset to match the defaults. Instead, the size of the label adjusts

to fit the existing text in that control.

Steps to Reproduce Behavior:

----------------------------

1. Create a new form.

2. Add a label to the form that says "Label 1."

3. Display the property sheet and the toolbox.

4. Select the label control on the toolbox.

5. Enter the following properties for the default label:

      Width: 1 in

      Height: 1 in

      BackColor: 255

6. Add another label to the form that says "Label 2".

7. Select the label that you created in step 2 and choose Apply Default

   from the Layout menu.

   The BackColor of Label 1 is set to Red, but the height and width do not

   change.

8. Select the label that you created in step 6 and choose Apply Default

   from the Layout menu.

   The height and width of Label 2 shrinks to fit the number of characters

   that you typed in.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 12, "Using Special

Design Effects on Forms and Reports," page 312, and Chapter 18, "Designing

Reports," page 430.

For more information, search for following topics in the Microsoft Access

Help menu:

"default properties," then "Changing Default Property Settings for Controls"

"label properties," then "Label Control Properties"

References


PRB: Referential Integrity Error With Shared Databases

 Article Number: Q95004

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you share databases in Microsoft Access, an attempt to update

   a record that another user has updated fails and Microsoft Access

   generates the following message:

      Data has changed; Operation stopped.

   After you choose OK to dismiss this message, Microsoft Access

   generates the following Write Conflict message:

      This record has been changed by another user since you started

      editing it. If you save the record, you will overwrite the

      changes the other user made.

      Copying the changes to the clipboard will let you look at the

      values the other user entered, and then paste your changes back

      in if you decide to make changes.

   At this point, you can choose one of three buttons: Save Record,

   Copy To Clipboard, or Drop Changes. If you choose Copy To Clipboard

   and then attempt to paste the changes into your table, the attempt

   fails and Microsoft Access generates the following referential

   integrity error message:

     Can't delete or change record. Since related records exist in table

    'Table Name', referential integrity rules would be violated.

CAUSE

   The table in question must be on the "one" side of a one-to-many

   relationship and the table must have the Enforce Referential

   Integrity property. These symptoms occur without regard to the

   field involved in the edit.

STATUS

   This behavior is by design.

More Information:

Perform the following nine steps to demonstrate this behavior.

Steps to Reproduce Behavior

---------------------------

1. Open two instances of Microsoft Access.

2. In each instance, open the NWIND.MDB sample database. Make sure

   that neither instance opens the database for Exclusive access.

3. In each instance, browse the Categories table.

4. In Instance One, change the Category Name field in Record One. Do

   not commit the change.

5. In Instance Two, change the Category Name field in Record One.

   Commit the change by moving the selection to a field in another

   record.

6. Activate Instance One and attempt to commit its change. Microsoft

   Access generates the first of the two messages listed above.

7. When the second message appears, choose Copy To Clipboard.

8. Select the first record and choose Paste from the Edit menu (to

   attempt to paste changes into the database from the clipboard).

9. Attempt to close the table. Microsoft Access generates the

   Referential Integrity message listed above.

References


PRACC9303: Can't Scroll Query Grid Using Arrow Keys or Mouse

 Article Number: Q95005

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 6359

SYMPTOMS

   When you design a query and the query window is sized so that the right

   side of the query grid is cut off (shows only part of the right-most

   field), you can't use the right arrow or drag with the mouse to scroll

   the query grid.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access version

   1.0. We are researching this problem and will post new information here

   in the Microsoft Knowledge Base as it becomes available.

More Information:

Steps to reproduce behavior

---------------------------

1. While working with a query in Design view, create an entry by dragging a

   field to the query grid.

2. Resize the Query window so that the right-most field appears truncated.

3. Click in the field and press the right arrow key. The cursor leaves the

   screen but the grid doesn't scroll. The same thing happens if you try to

   drag and scroll in the field.

References


PRB: Query Toolbar and Menus Are Not Updated Concurrently

 Article Number: Q95006

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you are in Design view in the Query window, the Datasheet View

   and Run buttons on the toolbar remain unavailable until tables or

   queries are added to the query. The View Datasheet and Query Run menu

   commands are made available as soon as any cell on the query grid is

   modified (even if a table or query has not been added.)

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. In the Database window, choose the Query button, and then choose

   the New button.

2. In the Add Table dialog box, choose the Close button without

   selecting a table or query.

3. Notice that the toolbar and menu options mentioned above are

   unavailable.

4. Select the first cell in the grid, press the SPACEBAR, and then

   press ENTER.

5. The menu options are now available; however, if you try to use them

   at this point, you receive the following error message:

      Query input must contain at least one table or query.

The toolbar remains unavailable until you add a table or query.

References


INF: How to Reference Controls or Fields on a Subform

 Article Number: Q95007

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access forms allow a developer to create subform controls that

display embedded forms on a form or report or display embedded reports

on a report. You can reference a control or field that resides on a subform

by using the Form property of the parent form. This article describes

several techniques you can use to reference a control or field that resides

on a subform or nested subform.

More Information:

In Microsoft Access, a parent form can have many subforms, but a top-level

parent form is limited to three levels of nesting for nested subforms.

To reference a control or field on the subform, use the Form property. For

more information on the Form property, search for "Form," then "Form,

Report Properties" using the Help menu.

The following step-by-step example shows by example how to reference a

field or control on a subform or nested subform:

1. Create three tables giving them each two fields as shown below:

   Table: Main Table

   -----------------

   ID:     Counter

   Field1: Text

   Table: Sub Form Table

   ---------------------

   ID:     Counter

   Field2: Text

   Table: Nested SubForm Table

   ---------------------------

         ID:     Counter

         Field3: Text

2. Create three forms based on the three tables and set the form properties

   as shown:

   Form: Nested Sub

   ----------------

   ControlSource: Nested Subfrom Table

   Field: ID

   Field: Field3

   Form: Sub

   ---------

   ControlSource: Sub Form Table

   Field: ID

   Field: Field2

   Control: Nested Sub

   Form: Main

   ----------

   ControlSource: Main Table

   Field: ID

   Field: Field1

   Control: Sub

3. Create a new module, and add the following code to it:

   Function DoIt ()

      Dim MyForm As Form

      Dim MySubForm As Form

      Dim MyControl As Control

      '===============================================================

      'SUBFORM - The next four examples show how to set the value of

      'Field2 on the Sub subform. This example shows four ways to

      'references the control:

      '

      ' 1. Straight reference using the Forms object.

      ' 2. Setting the Forms object to a form variable.

      ' 3. Setting the subform to a form variable.

      ' 4. Setting the field on the subform to a control variable.

      '

      'Note: Each example below is based on the previous example.

      'Some require that the object on the right side of the

      'equation be already initialized. Although variables are

      'used, you can substitute this with the proper Forms object.

      'The example of nested forms uses the Forms object in all the

      'examples.

      '============================================================

      'straight reference

      '------------------

      Forms![Main]![Sub].Form!Field2 = "Hello"

      'referenced using form property

      '-----------------------------

      Set MyForm = Forms![Main]

      MyForm.[Sub].Form.Field2 = "Hello"

         'setting subform to a form object

         '--------------------------------

         Set MySubForm = MyForm.[Sub].Form

         MySubForm.Field2 = "Hello"

         'reference item on subform through control object

         '------------------------------------------------

         Set MyControl = MySubForm.Field2

         MyControl = "Hello"

         '============================================================

         'NESTED SUBFORM - The next four examples show the same ideas

         'as shown above but for nested subforms.

         '============================================================

         'straight reference

         '------------------

         Forms![Main]![Sub].Form![Nested Sub].Form!Field3 = "Hello"

         'referenced using form property

         '-----------------------------

         Set MyForm = Forms![Main]![Sub].Form

         MyForm.[Nested Sub].Form.Field3 = "Hello"

         'setting subform to a form object

         '--------------------------------

         Set MySubForm = Forms![Main]![Sub].Form.[Nested Sub].Form

         MySubForm.Field3 = "Hello"

         'reference item on subform through control object

         '------------------------------------------------

         Set MyControl =

            Forms![Main]![Sub].Form![Nested Sub].Form!Field3

         MyControl = "Hello"

      End Function

References


PRB: Troubleshooting Out of Memory Errors in Queries

 Article Number: Q95008

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 13857

SYMPTOMS

   When executing a query, you may receive the following error message

   even though there are sufficient total memory and system resources:

      Out of Memory

CAUSE

   Microsoft Access allocates specific segments of memory for

   compiling a query. If your query requires more memory than is

   stored in the segment, you will get an "Out of Memory" message.

RESOLUTION

   The following items help to avoid an Out of Memory message:

    - Reduce the number of columns in the table design.

    - Reduce the size of the column names in the table design.

    - Reduce the number of columns selected by a query.

    - Do not create a query based on another query; run only a single

      query at a time.

References


PRB: Trailing Spaces Automatically Truncated During Data Entry

 Article Number: Q95009

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Form controls receiving input with a trailing space will ignore the

   trailing space(s), so the data entered may not be valid as a means

   of comparison. Also, variables in Access Basic that have been

   assigned a value containing a space character at the end of the

   text string will automatically be ignored when used in a

   conditional statement.

CAUSE

   This behavior is by design. Microsoft Access automatically

   truncates (or strips) trailing spaces on data you enter into

   form controls to prevent the creation of a record that cannot be

   referenced because of accidental space character(s) being appended

   to the end of the text.

RESOLUTION

   Don't use text strings that contain trailing spaces. If trailing

   spaces are necessary, insert your data in Datasheet view of the

   form.

More Information:

Although both "a" or "a " are acceptable input in the example below,

the data stored in the underlying table will always contain the value

"a". The space following the "a" is truncated.

Steps to Reproduce Behavior

===========================

In a Form

---------

1. Open a database.

2. Create a form with a single text field.

3. Enter the following for the field's Validation Rule property:

      ="a "

4. View the form in Form view.

5. Enter "a" in the field (with no space at the end).

In Access Basic

---------------

1. Open a database.

2. Open a new module and choose Immediate window from the View

   menu.

3. Enter this syntax in the Immediate window (press ENTER after

   each statement):

      ?"a"="a "

   -or-

      ?chr(97)=chr(97)+chr(32)

4. Either statement will return a non-zero number indicating the

   statement is true, which means the values are equal.

References


INF: ARROW Keys and Mouse Don't Scroll Grid in QBE Grid

 Article Number: Q95010

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

When you are designing a query and the Query window is sized so that

the right side of the Query Grid is cut off (that is, it shows only

part of the rightmost field cell), using the RIGHT ARROW or dragging

with the mouse will not scroll the grid.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open an existing query (such as the Category List query in the

   sample database Northwind Traders [NWIND.MDB]) in Design view.

2. Resize the Query window so that the rightmost column in the QBE

   grid with a field name in it is truncated on the screen.

3. Click in the start of the field cell and press the RIGHT ARROW key.

   The cursor will leave the screen but the grid will not scroll

   initially. The same thing will happen if you try to drag and scroll

   in the field.

References


PRB: Troubleshooting 'ODBC - couldn't find ODBC.DLL' Error

 Article Number: Q95011

 CREATED: 28-JAN-1993

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   You receive the following error message:

      ODBC - couldn't find ODBC.DLL

CAUSES

   Here are three possible causes:

    - The ODBC.DLL file you are using may be old.

    - You may have duplicate ODBC.DLL files on your system, and you are

      using the wrong one.

    - The ODBC.DLL file you are using may be damaged or corrupted.

RESOLUTION

   The ODBC.DLL file installed by Microsoft Access version 1.0 is dated

   10-16-92, has a size of 44736 bytes, and should be installed in the

   \WINDOWS\SYSTEM directory.

More Information:

There are other situations that may indirectly cause this error message. To

troubleshoot for these possibilities:

1. Use File Manager to search for multiple, corrupted, or outdated

   copies of these files:

      File          Correct Dates and Sizes

      ---------------------------------------------------

      DBNMP3.DLL    dated 9-15-92(8241 bytes) or later

      SQLSRVR.DLL   dated 10-16-92(135792 bytes) or later

      NETAPI.DLL    depends on the network being used

      COMMDLG.DLL   dated 10-25-92(89248 bytes) or later

      NOTE: The sizes and dates referenced are correct if the files are

            installed by Microsoft Access version 1.0.

2. Make sure the files listed in step 1 are in their appropriate locations.

   All files except NETAPI.DLL are usually installed in the \WINDOWS\SYSTEM

   directory. The NETAPI.DLL file is a network specific driver; it is

   usually located in the network's program directory, which should be in

   the path.

3. Use another application, such as Q+E, SAF, or PowerBuilder, on the

   same machine to attempt to attach to the same data source. If you

   cannot access the data source from another application, you probably

   have a network problem with the NETAPI.DLL file or with the server, not

   with Microsoft Access or ODBC.

4. Attempt to attach another data source, if available, such as another

   SQL server. If you can attach to another server, the original server may

   be down, or you may need to reconfigure the entry for that server using

   the ODBC Administration Utility.

5. Attempt to attach the same data source from a different machine. If you

   cannot gain access to the SQL server from a different machine, you may

   have a network-wide problem, or the SQL server may be down or not

   communicating.

6. Try increasing your ODBC timeout settings in the ODBC section of the

   MSACCESS.INI file.

7. Check with the system administrator to see if the SQL server is up,

   available for transactions, and operating properly.

8. Reinstall ODBC after performing a clean boot and renaming the

   ODBC.DLL, DBNMP3.DLL, and SQLSRVR.DLL files.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Appendix D, "Setting up

Microsoft Access on a Network," pages 660-662.

References


PRB: Error: Unable to Connect to Data Source

 Article Number: Q95012

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You receive this error message:

      Unable to connect to data source

CAUSE

   The SQL server you are trying to access does not have a correct entry

   in the [SQLSERVER] section of the WIN.INI or the SQL server is down,

   overloaded, or otherwise unavailable.

RESOLUTION

   To correct this situation, verify that the SQL server is up and

   available and that the entry in the [SQLSERVER] section of the WIN.INI

   file looks like this:

      [SQLSERVER]

      MY_SERVER=DBNMP3,\\MY_SERVER\PIPE\SQL\QUERY

   If there are any spaces in this entry or if the server name in the

   \\MY_SERVER\PIPE\SQL\QUERY part of the statement is misspelled, you

   receive this error.

More Information:

It is possible that there are other situations which may indirectly

cause this error message. Here are several other things you can check to

troubleshoot this problem:

1. Use File Manager to search for multiple, corrupted, or outdated

   copies of these files:

   ODBC.DLL - 44736 bytes, dated 10-16-92 or later

   DBNMP3.DLL - 8241 bytes, dated 9-15-92 or later

   SQLSRVR.DLL - 135792 bytes, dated 10-16-92 or later

   NETAPI.DLL - depends on the network being used

   COMMDLG.DLL - 89248 bytes, dated 10-25-92 or later

   NOTE: The sizes and dates referenced are correct if the files were

         installed by Microsoft Access version 1.0.

2. Make sure the files listed above are in appropriate locations. All files

   except NETAPI.DLL are usually installed in the Windows System directory.

   The NETAPI.DLL file is a network specific driver, so it's usually

   located in the network's program directory, which should be in the path.

3. Use another application, such as Q+E, SAF, or PowerBuilder, on the same

   computer to attempt to attach to the same data source. If you can't

   access the data source from another application, there is probably a

   problem with the network (NETAPI.DLL) or with the server, not with

   Microsoft Access or ODBC.

4. Attempt to attach to another data source, if available, such as

   another SQL server. If you can attach to another server, then the

   original server may be down or you may need to reconfigure the entry

   for that server using the ODBC Administration Utility.

5. Attempt to attach to the same data source from another computer. If

   you can't access the SQL server from another computer, there may be a

   network wide problem or the server may be down or not communicating.

6. Try increasing the ODBC timeout settings in the ODBC section of the

   MSACCESS.INI file.

7. Check with the system administrator to see if the SQL server is up,

   available for transactions, and operating correctly.

8. Reinstall ODBC after performing a clean boot and renaming the ODBC.DLL,

   DBNMP3.DLL, and SQLSRVR.DLL files.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Appendix D, "Setting Up

Microsoft Access on a Network," pages 660-662.

References


PRB: SQL Data Sources Dialog Box Lists No Data Sources

 Article Number: Q95013

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You attempt to attach, import from, or export to a SQL server table

   and the SQL Data Sources dialog box is displayed but lists no data

   sources -- no SQL servers.

CAUSE

   Here are the most likely causes:

    - You did not use the ODBC Administrator application to set up

      connections to SQL servers.

    - The [ODBC Data Sources] section in the ODBC.INI file is missing or

      blank, or there are multiple copies of the ODBC.INI file and

      Microsoft Access is using the one that is missing the [ODBC Data

      Sources] section.

RESOLUTION

   Verify that there is a single copy of the ODBC.INI file on your computer

   and that it is in the Windows directory. Also, make sure there is an

   [ODBC Data Sources] section in the ODBC.INI file and that it contains

   correct entries for the SQL server you are trying to connect.

More Information:

You can rename your ODBC.INI file and use the ODBC Administrator

application to set up ODBC to connect to the SQL server(s) you want to use.

The ODBC Administrator application will then create a new ODBC.INI file.

That should correct the problem.

The contents of your ODBC.INI file should look something like this:

   [ODBC Data Sources]

   MYSERVER=SQL Server

   YOURSRVR=SQL Server

   [MYSERVER]

   Driver=C:\WINDOWS\SYSTEM\SQLSRVR.DLL

   Description=SQL Server on server MYSERVER

   OemToAnsi=No

   Network=dbnmp3

   Address=\\MYSERVER\PIPE\SQL\QUERY

   [YOURSRVR]

   Driver=C:\WINDOWS\SYSTEM\SQLSRVR.DLL

   Description=SQL Server on server YOURSRVR

   OemToAnsi=No

   Network=dbnmp3

   Address=\\YOURSRVR\PIPE\SQL\QUERY

Reference(s):

"Microsoft Access User's Guide" version 1.0, Appendix D, pages 660-662.

References


INF: Set Focus to a Subform Control Using GoToControl Action

 Article Number: Q95014

 CREATED: 28-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

You can create a macro to move the focus to a control on a subform by

using the GoToControl macro action to move first to the subform, which

is a type of a control. Use the GoToControl action again to move to a

particular control on the subform.

More Information:

The macro action GoToControl does not allow you to enter the full

syntax for the ControlName argument as:

   Forms![orders]![orders subform].form![Product ID]

If you enter this syntax, you will receive the following error:

   There is no control named 'Forms![orders]![orders

   subform].Form!Product id'.

To get around this, you need to set up a macro that first sets the

focus to the Subform control, followed by a second action that sets

the focus to a specific control.

In the sample database Northwind Traders (NWIND.MDB), the Orders and

Orders Subform forms can be used as an example where you can have a

macro set the focus to the Product Id on the Orders Subform.

Create a new macro with two separate GoToControl actions, then attach

the macro to a button on the Orders form.

   Actions

   -------

   GoToControl

      Control Name: Orders Subform

   GoToControl

      Control Name: Product Id

When the button is clicked, the focus will move to the Product Id

control.

References


INF: Attaching Clipper Tables to Microsoft Access Databases

 Article Number: Q95044

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

It is possible to attach Clipper .DBF files to a Microsoft Access

database. To do so, attach it as a dBASE IV file. Note, however, the

index may or may not be updateable.

Clipper provides an alternative indexing method (.NTX) to the dBASE

standard (.NDX). The Clipper index format isn't recognized by

Microsoft Access, so Microsoft Access cannot update it correctly.

However, if the Clipper application was developed using the dBASE .NDX

format, Microsoft Access updates the index correctly.

References


INF: Using SHARE.EXE and VSHARE.EXE with Microsoft Access

 Article Number: Q95047

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

MS-DOS, Microsoft Windows, and Windows-based applications use

SHARE.EXE to provide a file locking mechanism so that Windows-based

tasks can communicate with each other. The tasks use SHARE.EXE to sort

out file read/write conflicts. Therefore, it is important that you

load SHARE.EXE before starting Windows. Without SHARE.EXE loaded, you

may experience data corruption in applications.

Using SHARE.EXE with Microsoft Access allows multiple users to access a

database at the same time while protecting them from updating the same

record at the same time. If a database is opened exclusively by one

user, no other users will be able to use the database until the first

user releases it. However, if all users open the database in a shared

mode, SHARE.EXE allows all users to read and write to the database

simultaneously, with the exception of locked records. For example, if

a user has record 100 open on a particular database, that record is

considered locked, and no other users will be able to change any data

in record 100 until the first user finishes changing it.

For this reason, while it is possible to run Microsoft Access without

first loading SHARE.EXE, Microsoft does not recommend it. If you choose

not to use SHARE.EXE, you must ensure that only one Windows-based task

writes to a database record at any given moment.

More Information:

MS-DOS uses SHARE.EXE to lock files as requested by applications.

SHARE.EXE controls updates and prevents data corruption in files.

An application can request a deny-read lock (exclusive), a deny-write

lock, or both. Deny-write locks allow other applications to read data,

but prevent two different applications from updating the same file at

the same time.

SHARE.EXE also provides byte-range locks. When a range of bytes is

locked, other applications cannot read, write, or lock those bytes.

Other, unlocked bytes, in the file are not affected. An application

can use byte-range locks to place exclusive locks on records for

record-level locking.

In single-user environments, SHARE.EXE prevents file contention

accidents when multiple instances of a program attempt to write to the

same database or database record at the same time. In multiple-user

environments such as networks, SHARE.EXE prevents possible database

corruption when several different network users attempt to write to

the same database or database record at the same time.

A Single Exception

------------------

The only time you do not have to use SHARE.EXE is when you run

Microsoft Windows for Workgroups in Enhanced mode. Microsoft Windows

for Workgroups in Enhanced mode loads and uses a file-sharing program

called VSHARE.386, which is a replacement for SHARE.EXE. There is an

entry for VSHARE.386 in the SYSTEM.INI file.

In fact, if you plan on running Windows for Workgroups exclusively in

Enhanced mode and do not run other applications that require

SHARE.EXE, you can save approximately 5K of conventional memory by not

loading SHARE.EXE. To do this, remove SHARE.EXE from your AUTOEXEC.BAT

file and restart your computer.

SHARE.EXE is likely to be in your AUTOEXEC.BAT file because during the

Microsoft Access installation process, the SETUP.EXE program

automatically inserts the following MS-DOS command in your

AUTOEXEC.BAT file:

   <MS-DOS directory>\SHARE.EXE /L:500

If SHARE.EXE is already present before running Microsoft Windows for

Workgroups in Enhanced mode, VSHARE.386 loads in addition to SHARE.EXE,

temporarily disabling SHARE.EXE. Then VSHARE.386 takes over file sharing

tasks until you exit Microsoft Windows for Workgroups. After you exit

Windows for Workgroups, VSHARE.EXE passes file-sharing control back to

SHARE.EXE for use by MS-DOS applications that require it.

Microsoft Access runs correctly with either SHARE.EXE or VSHARE.386,

but SHARE.EXE limits the number of available locks to the number

specified when SHARE.EXE was loaded. The /L parameter specifies the

number of share locks; the default is 20. VSHARE.386, on the other

hand, dynamically allocates the number of locks available based on the

demand for locks. The number of locks available is especially

important if the computer running Microsoft Windows for Workgroups

acts as a server in a client-server environment.

References


INF: Use Row Fix-up Technique to Look Up Info Automatically

 Article Number: Q95048

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

You can create a query or form that automatically looks up information

in the one-side table of a one-to-many relationship based on an entry

in a many-side field. This process is sometimes called row fix-up.

You can use row fix-up to have a query automatically look up

information in other tables and display it on a form or report.

In fact, you can look up information by using any one of the following

three techniques:

1. Use row fix-up. For more information on row fix-up, see the "More

   Information" section below.

2. Use multiple DLookup() functions in forms and reports. For more

   information on the DLookup() function, query on the following

   words in the Microsoft Knowledge Base:

       "DLookup" and "forms" and "reports"

3. Use the Column property of a multiple-column combo box to update a

   text box control with new information as focus moves from row to

   row in the combo box. For more information on this, query on the

   following words in the Microsoft Knowledge Base:

      "Column" and "property" and "combo" and "Update"

More Information:

Use row fix-up when you want Microsoft Access to automatically look up

information in the one-side table based on an entry in a many-side

field. The row fix-up technique works in a query or in a form.

The most typical table relationship that can take advantage of row

fix-up is a one-to-many relationship. However, row fix-up also works

with tables that have a one-to-one relationship.

To take advantage of row fix-up with a one-to-one relationship, make

the join a left-outer join with the updatable table on the left. For

more information on what is and what is not updatable, search for

"Underlying table or query," then "When is a query updatable?" using

the Microsoft Access Help menu.

For example, the Categories and Products tables in the sample NWIND

database have a one-to-many relationship. Each category may appear

several times in the Products table. The Products table contains the

field Category ID, which is the foreign key that identifies the

category for a product.

When row fix-up updates data, Microsoft Access automatically

recalculates any totals or expressions that are dependent on the

updated data.

The following two examples demonstrate how row fix-up works.

Example One: Create a Query that Uses Row Fix-Up

------------------------------------------------

1. Start Microsoft Access and open the sample NWIND database.

2. Create a new query. Add the Products and Categories tables. Products

   is the many-side table and Categories is the one-side table. The two

   tables have a many-to-one relationship based on the Category ID

   field. In other words, there are many identical Category ID values

   in Products for each unique Category ID value in Categories.

3. Add the following fields from the Products table:

      Product ID

      Product Name

      Category ID

4. Add the following fields from the Categories table:

      Category Name

      Description

5. Save the query, and name it Row Fix-up Example.

6. View the results of the query. To verify that the query performs

   row fix-up, move to the end of the query and start a new record.

   Enter a valid Category ID value in the Category ID field. At that

   point, Microsoft Access will automatically look up the values

   associated with that Category ID value in the Categories table.

   This works because the Category ID field located in the query comes

   from the many-side table (Products). Microsoft Access performs row

   fix-up on one-side tables when you enter identifying data in the

   many-side table. When you enter a valid value in the Products

   table's Category ID field, Microsoft Access knows that Category ID

   is the key field for the one-side table (Categories), so it looks up

   the information from Categories based on the Category ID value and

   displays it in the query -- automatically.

Example Two: Create a Form that Uses Row Fix-Up

------------------------------------------------

1. Create a new form based on the query created in Example One.

2. Locate the fields from the Products table on one side of the form

   and those from the Categories table on the other side of the form.

3. Create a combo box bound to the Category ID field. Set the

   RowSource property to the Categories table. Display a single

   column, [Category ID] in the Combo Box.

4. Switch to Form view. Now when you enter new records and select a

   category from the Category ID combo box all related information

   about that Category is displayed.

Note that if you had included the PrimaryKey value from the one-side

table (Categories), you would not have been allowed to add new records

to the query or change the Category ID value. That is why it is

necessary to pull the Category ID field from the Products table (the

many-side table) rather than from the Categories table (the one-side

table). Information displayed from the one-side of the many-to-one

relationship is not updatable. For more information on what is and

what is not updatable, search for "Underlying table or query," then

"When is a query updatable?" using the Microsoft Access Help menu.

To see another example of row fix-up, look at the the Orders Form in

the NWIND database. Select different names from the Bill To:

combo box and watch the address information update -- automatically.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 10, "Creating

Forms Based on More than One Table," page 282.

References


PRB: Data Source Not Found, No Default Driver Found Error Msg

 Article Number: Q95050

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When trying to attach or use an attached SQL Sever table, you receive

   the following error message:

      Data source not found and no default driver specified

CAUSE

   You may have a missing, damaged, or incorrect ODBC.INI file.

RESOLUTION

   Verify that there is an ODBC.INI file in your Windows directory and

   that there is only one copy of the ODBC.INI file available on the

   machine you are using. Then make sure the entries in the ODBC.INI

   file are correct for the SQL database server you want to connect.

More Information:

The contents of your ODBC.INI file should look something like this:

[ODBC Data Sources]

MYSERVER=SQL Server

YOURSRVR=SQL Server

[MYSERVER]

Driver=C:\WINDOWS\SYSTEM\SQLSRVR.DLL

Description=SQL Server on server MYSERVER

OemToAnsi=No

Network=dbnmp3

Address=\\MYSERVER\PIPE\SQL\QUERY

[YOURSRVR]

Driver=C:\WINDOWS\SYSTEM\SQLSRVR.DLL

Description=SQL Server on server YOURSRVR

OemToAnsi=No

Network=dbnmp3

Address=\\YOURSRVR\PIPE\SQL\QUERY

You will receive the error message if there is no section that refers to

the SQL server you are trying to attach. For example, you would see the

error message if:

1. The [MYSERVER] section was missing.

2. The Driver= line was missing.

3. The .DLL file on the Driver= line was missing the .DLL extension.

4. The .DLL file was missing, damaged, or outdated.

Other Possible Causes

---------------------

Other situations may indirectly cause this error message. Use the following

as a guide to troubleshoot this problem:

1. Use File Manager to search for multiple, corrupted, or outdated copies

   of these files:

   ODBC.DLL - dated 10-16-92 or later with 44736 bytes

   DBNMP3.DLL - dated 9-15-92 or later with 8241 bytes

   SQLSRVR.DLL - dated 10-16-92 or later with 135792 bytes

   NETAPI.DLL - depends on the network being used

   COMMDLG.DLL - dated 10-25-92 or later with 89248 bytes

   NOTE: The sizes and dates referenced are correct if the files were

         installed by Microsoft Access version 1.0.

2. Make sure all the files listed in step 1 are in appropriate locations.

   All except NETAPI.DLL are usually installed in the Windows System

   directory. NETAPI.DLL is a network specific driver; it is usually

   located in the network's program directory, which should be on the path.

3. Use another application (such as Q+E, SAF, or PowerBuilder) on the

   same machine to attempt to attach the same data source. If you cannot

   access the data source from another application, you probably have a

   problem with the network, not with Access or ODBC. For example, you

   may have a problem with NETAPI.DLL or with the server.

4. Try to attach another data source, such as another SQL Server table from

   a different database server. If you can do it, the original server may

   be down, or you may need to reconfigure the entry for that server by

   using the ODBC Administration Utility.

5. Try to attach the same data source from a different computer. If you

   cannot gain access to the SQL server from another computer, you may

   have a network-wide problem, or perhaps the server is down or not

   communicating.

6. Try increasing your ODBC timeout settings in the ODBC section of the

   MSACCESS.INI file.

7. Check with the system administrator to see if the SQL server is up,

   available for transactions, and operating correctly.

8. Reinstall ODBC after renaming the current ODBC.DLL, DBNMP3.DLL, and

   SQLSRVR.DLL files and restarting the server. For more information on

   how to do this, refer to the "Microsoft Access User's Guide,"

   version 1.0, Appendix D, "Setting up Microsoft Access on a Network,"

   pages 660-662.

References


PRB: Unable to Connect to Attached SQL Server Table Error Msg

 Article Number: Q95051

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   While attempting to use an attached SQL Server table, you receive the

   following error message:

      Unable to connect to data source

CAUSE

   Here are two situations that can cause this error:

   1. An incorrect entry in the [SQLSERVER] section of the WIN.INI file.

      The [SQLSERVER] section of your WIN.INI file should look like this:

      [SQLSERVER]

      MYSERVER=dbnmp3,\\MYSERVER\PIPE\SQL\QUERY

      YOURSRVR=dbnmp3,\\YOURSRVR\PIPE\SQL\QUERY

      The error is caused by an incorrect server name (MYSERVER or YOURSERVR)

      or additional spaces in the entry.

   2. The SQL database server is overloaded or not available.

RESOLUTION

   Verify that the [SQLSERVER] section of your WIN.INI file has the correct

   entry for the server you are attempting to attach. Then check with the

   system administrator to see if the SQL database server is up, available

   for transactions, operating properly, and not overloaded.

More Information:

Other situations may indirectly cause this error message. Use the following

as a guide to troubleshoot this problem:

1. Use File Manager to search for multiple, corrupted, or outdated copies

   of these files:

   ODBC.DLL - dated 10-16-92 or later with 44736 bytes

   DBNMP3.DLL - dated 9-15-92 or later with 8241 bytes

   SQLSRVR.DLL - dated 10-16-92 or later with 135792 bytes

   NETAPI.DLL - depends on the network being used

   COMMDLG.DLL - dated 10-25-92 or later with 89248 bytes

   NOTE: The sizes and dates referenced are correct if the files were

         installed by Microsoft Access version 1.0.

2. Make sure all the files listed in step 1 are in appropriate locations.

   All except NETAPI.DLL are usually installed in the Windows System

   directory. NETAPI.DLL is a network specific driver; it is usually

   located in the network's program directory, which should be on the path.

3. Use another application (such as Q+E, SAF, or PowerBuilder) on the

   same machine to attempt to attach the same data source. If you cannot

   access the data source from another application, you probably have a

   problem with the network, not with Access or ODBC. For example, you

   may have a problem with NETAPI.DLL or with the server.

4. Try to attach another data source, such as another SQL Server table from

   a different database server. If you can do it, the original server may

   be down, or you may need to reconfigure the entry for that server by

   using the ODBC Administration Utility.

5. Try to attach the same data source from a different computer. If you

   cannot gain access to the SQL server from another computer, you may

   have a network-wide problem, or perhaps the server is down or not

   communicating.

6. Try increasing your ODBC timeout settings in the ODBC section of the

   MSACCESS.INI file.

7. Reinstall ODBC after renaming the current ODBC.DLL, DBNMP3.DLL, and

   SQLSRVR.DLL files and restarting the server. For more information on

   how to do this, refer to the "Microsoft Access User's Guide,"

   version 1.0, Appendix D, "Setting up Microsoft Access on a Network,"

   pages 660-662.

References


PRACC9302: Running Delete Query Gives Misleading Error Msg

 Article Number: Q95052

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 82 179

SYMPTOMS

   If you attempt to run a Delete query that would violate referential

   integrity, Microsoft Access displays the following misleading error

   message:

      Errors were encountered: The contents of fields in 0 record(s)

      were deleted, XXX record(s) were lost due to key violations, and 0

      record(s) were locked and couldn't be modified. Proceed anyway?

CAUSE

   Microsoft Access uses the same error message for all action queries.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

Microsoft Access enforces referential integrity if relationships were

defined between tables with this option. You will receive an error

message if you attempt to breach the rules of referential integrity

when running a Delete Query or when you delete fields that would effect

the one-side of a one-to-many relationship.

However, as you can see in the SYMPTOMS section above, when you run the

Delete query, the error message displayed is misleading.

When you try to run a Delete query on the one-side of a one-to-many

relationship that has Referential Integrity enforced, after you choose the

OK button in response to this message: "XXX row(s) will be deleted,"

Microsoft Access gives you the following error message:

   Errors were encountered: The contents of fields in 0 record(s)

   were deleted, XXX record(s) were lost due to key violations, and 0

   record(s) were locked and couldn't be modified. Proceed anyway?

If you proceed by choosing OK, nothing happens.

If you attempt to delete a field from a form or table that is on the

one-side of a one-to-many relationship, Microsoft Access gives you

the following error message:

   Can't delete or change record. Since related records exist in

   table 'The table that is on the many side', referential integrity

   rules would be violated.

In this case, the two preceding error messages mean the same thing.

References


PRB: Query Fails when Linked SQL Server Table Can't Be Found

 Article Number: Q95053

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When attempting to use an attached SQL Server table, you receive the

   following error message:

      Couldn't execute query; couldn't find linked table'

      Invalid object name TABLE_NAME

   TABLE_NAME is the name of the table you are attempting to use.

CAUSE

   The most likely cause of this error is an incorrect entry in the

   [SQLSERVER] section of your WIN.INI file.

   The [SQLSERVER] section of your WIN.INI file should look like this:

   [SQLSERVER]

   MYSERVER=dbnmp3,\\MYSERVER\PIPE\SQL\QUERY

   YOURSRVR=dbnmp3,\\YOURSRVR\PIPE\SQL\QUERY

   The error is caused by an incorrect server name (MYSERVER or YOURSERVR)

   or additional spaces in the entry.

RESOLUTION

   Verify that the [SQLSERVER] section of your WIN.INI file contains

   the correct entry for the server you are attempting to attach.

More Information:

Other situations may indirectly cause this error message. Use the following

as a guide to troubleshoot this problem:

1. Use File Manager to search for multiple, corrupted, or outdated copies

   of these files:

   ODBC.DLL - dated 10-16-92 or later with 44736 bytes

   DBNMP3.DLL - dated 9-15-92 or later with 8241 bytes

   SQLSRVR.DLL - dated 10-16-92 or later with 135792 bytes

   NETAPI.DLL - depends on the network being used

   COMMDLG.DLL - dated 10-25-92 or later with 89248 bytes

   NOTE: The sizes and dates referenced are correct if the files were

         installed by Microsoft Access version 1.0.

2. Make sure all the files listed in step 1 are in appropriate locations.

   All except NETAPI.DLL are usually installed in the Windows System

   directory. NETAPI.DLL is a network specific driver; it is usually

   located in the network's program directory, which should be on the path.

3. Use another application (such as Q+E, SAF, or PowerBuilder) on the

   same machine to attempt to attach the same data source. If you cannot

   access the data source from another application, you probably have a

   problem with the network, not with Access or ODBC. For example, you

   may have a problem with NETAPI.DLL or with the server.

4. Try to attach another data source, such as another SQL Server table from

   a different database server. If you can do it, the original server may

   be down, or you may need to reconfigure the entry for that server by

   using the ODBC Administration Utility.

5. Try to attach the same data source from a different computer. If you

   cannot gain access to the SQL server from another computer, you may

   have a network-wide problem, or perhaps the server is down or not

   communicating.

6. Try increasing your ODBC timeout settings in the ODBC section of the

   MSACCESS.INI file.

7. Check with the system administrator to see if the SQL server is up,

   available for transactions, and operating correctly.

8. Reinstall ODBC after renaming the current ODBC.DLL, DBNMP3.DLL, and

   SQLSRVR.DLL files and restarting the server. For more information on

   how to do this, refer to the "Microsoft Access User's Guide,"

   version 1.0, Appendix D, "Setting up Microsoft Access on a Network,"

   pages 660-662.

References


PRB: Driver Can't Be Found Error When Attaching SQL Server

 Article Number: Q95054

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When trying to attach a SQL Server table or open a table previously

   attached SQL Server table, you receive this error message:

      Driver specified by data source could not be loaded

CAUSE

   The most likely cause of this error is a missing, damaged, or incorrect

   version of the SQLSRVR.DLL file.

RESOLUTION

   To correct this situation, verify these three things:

     1. There is a SQLSRVR.DLL file in your Windows System directory.

     2. There is a single copy of the SQLSRVR.DLL file on the computer you

        are using.

     3. You have the correct version of the SQLSRVR.DLL file. The version

        of the SQLSRVR.DLL file installed by Microsoft Access version 1.0

        is dated 10-16-92 and has a size of 135792 bytes. You need this file

        or a more recent version.

More Information:

It is possible that there are other situations that may indirectly cause

this error message. Use the following guide to troubleshoot this problem:

1. Use File Manager to search for multiple, corrupted, or outdated copies

   of these files:

      ODBC.DLL - dated 10-16-92 or later with 44736 bytes

      DBNMP3.DLL - dated 9-15-92 or later with 8241 bytes

      NETAPI.DLL - depends on the network being used

      COMMDLG.DLL - dated 10-25-92 or later with 89248 bytes

      NOTE: The sizes and dates referenced are correct if Microsoft Access

            version 1.0 installed the files.

2. Make sure all three files are in appropriate locations. All except

   NETAPI.DLL are usually installed in the Windows System directory.

   NETAPI.DLL is a network specific driver; it is usually located in the

   network's program directory -- which should be on the path.

3. Use another application (such as Q+E, SAF, or PowerBuilder) on the

   same machine to attempt to attach the same data source. If you cannot

   access the data source from another application, you probably have a

   problem with the network, not with Access or ODBC. For example, you

   may have a problem with NETAPI.DLL or with the server.

4. Try to attach another data source, such as another SQL Server table from

   a different database server. If you can do it, the original server may

   be down, or you may need to reconfigure the entry for that server by

   using the ODBC Administration Utility.

5. Try to attach the same data source from a different computer. If you

   cannot gain access to the SQL server from another computer, you may

   have a network-wide problem, or perhaps the server is down or not

   communicating.

6. Try increasing your ODBC timeout settings in the ODBC section of the

   MSACCESS.INI file.

7. Check with the system administrator to see if the SQL server is up,

   available for transactions, and operating correctly.

8. Reinstall ODBC after renaming the current ODBC.DLL, DBNMP3.DLL, and

   SQLSRVR.DLL files and restarting the server. For more information on

   how to do this, refer to the "Microsoft Access User's Guide,"

   version 1.0, Appendix D, "Setting up Microsoft Access on a Network,"

   pages 660-662.

References


INF: Recent File List will Display Deleted .MDB Files

 Article Number: Q95055

 CREATED: 31-JAN-1993

 MODIFIED: 31-JAN-1993

Summary:

When you open a database, Microsoft Access remembers that database

name and will display the name in the Recent File List under the File

menu. However, if you delete that database, the Recent File List will

still continue to show it as a valid database even though it doesn't

actually exist. When you open other databases the list will be updated

and the deleted file will eventually disappear from the list.

More Information:

Steps to Reproduce Behavior

--------------------------

1. Create a new database.

2. Close the database.

3. Delete the database using File Manager.

4. Choose the File menu in Microsoft Access. You will notice the

   database you just deleted is still in the File menu list.

References


INF: Creating a New Linking Column Between Existing Tables

 Article Number: Q95058

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

You can change an ID field from a Long Integer or other data type to a

Counter data type in the table on the one-side of a one-to-many

relationship and change the ID values in the corresponding records in the

many-side table while still maintaining the links between the two tables.

More Information:

The following example uses the Northwind Traders (NWIND.MDB) sample

database to show you how to change the ID values in the Customers table

(the one-side table) and update the values in the Orders table (the

many-side table) so that the records in the two tables are still linked.

1. Add the following fields to the Customers and Orders tables:

      Table: Customers

      ----------------

      Field name: New ID

         Data Type: Counter

      Table: Orders

      -------------

      Field name: New ID

         Data Type: Number

         Field Size: Long Integer

2. Create a new query. Add the Customers and Orders tables to the query.

   Make sure the tables are joined on Customer ID.

3. From the Query menu, choose Update.

4. Add the following field and properties to the query grid:

      Update Query: Query1

      --------------------

      Field name: Orders.New ID

         Update To: [Customers].[New ID]

   When you type Orders.New ID into the Field name cell, the Orders

   table name disappears. From the View menu, choose Table Names to

   see all the table names displayed on the grid.

6. To run the query, click the Run button on the tool bar.

7. Close the query. You do not need to save it.

If there is a relationship already defined for the two tables, you need

to remove it. For example, the NWIND database has a defined relationship,

so you need to remove it.

To remove the original relationship between tables:

1. Press F11 to give the Database window the focus. From the Edit

   menu, choose Relationships.

2. Select Customers for the Primary Table and Orders for the Related Table.

   Customer ID automatically appears in Select Matching Fields.

3. Choose the Delete button to remove the relationship. Then close the

   dialog box.

Next, remove the original ID field and rename the new one in the Customers

table:

1. Open the Customers table in Design view.

2. Delete the Customer ID field.

3. Change the name of New ID to Customer ID and make it the primary key.

4. Close the table, and save the changes.

Then remove the original ID field and rename the new one in the Orders

table:

1. Open the Orders table in Design view.

2. Delete the Customer ID field.

3. Change the name of New ID to Customer ID.

4. Close the table, and save the changes.

Now you can redefine the relationship between the tables. From the Edit

menu, choose Relationships.

References


PRB: Connection Not Open Error Message

 Article Number: Q95060

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You receive this error message:

      Connection not open

CAUSE

   The most likely cause of this error is a missing, damaged, or incorrect

   version of the SQLSRVR.DLL or ODBC.DLL file.

RESOLUTION

    To correct this situation, verify each of the following:

    1. SQLSRVR.DLL and ODBC.DLL both exist in your Windows System

       directory.

    2. There is a single copy of SQLSRVR.DLL and a single copy of ODBC.DLL

       on the computer you are using.

    3. You have the correct versions of the two files. The SQLSRVR.DLL file

       installed by Microsoft Access version 1.0 is dated 10-16-92 and has

       a size of 135792 bytes. The ODBC.DLL file installed by Microsoft

       Access version 1.0 is dated 10-16-92 and has a size of 44736 bytes.

More Information:

It is possible that there are other situations that can indirectly cause

this error message. Use the following as a troubleshooting guide:

1. Use File Manager to search for multiple, corrupted, or outdated

   copies of these files:

      DBNMP3.DLL - dated on or after 9-15-92 with a size of 8241 bytes

      NETAPI.DLL - depends on the network being used

      COMMDLG.DLL - dated on or after 10-25-92 with a size of 89248 bytes

      NOTE: Theses sizes and dates are correct if Microsoft Access version

      1.0 installed the files.

2. Make sure all three files are in appropriate locations. All except

   NETAPI.DLL are usually installed in the Windows System directory.

   NETAPI.DLL is a network specific driver; it is usually located in the

   network's program directory -- which should be on the path.

3. Use another application (such as Q+E, SAF, or PowerBuilder) on the

   same machine to attempt to attach the same data source. If you cannot

   access the data source from another application, you probably have a

   problem with the network, not with Access or ODBC. For example, you

   may have a problem with NETAPI.DLL or with the server.

4. Try to attach another data source, such as another SQL database server.

   If you can attach another server, then the original server may be down,

   or you may need to reconfigure the entry for that server by using the

   ODBC Administration Utility.

5. Try to attach the same data source from a different computer. If you

   cannot gain access to the SQL database server from another computer, you

   may have a network-wide problem, or perhaps the server is down or not

   communicating.

6. Try increasing your ODBC timeout settings in the ODBC section of the

   MSACCESS.INI file.

7. Check with the system administrator to see if the SQL database server

   is up, available for transactions, and operating correctly.

8. Reinstall ODBC after renaming the current ODBC.DLL, DBNMP3.DLL, and

   SQLSRVR.DLL files and restarting the server. For more information on

   how to do this, refer to the "Microsoft Access User's Guide,"

   version 1.0, Appendix D, "Setting up Microsoft Access on a Network,"

   pages 660-662.

References


PRB: Stored procedure 'PROCEDURE' not found -- Error Message

 Article Number: Q95061

 CREATED: 31-JAN-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You receive this error:

      Stored procedure 'PROCEDURE' not found

   The 'PROCEDURE' noted in the error message is the name of a  stored

   procedure that cannot be found but is necessary to gain access to the

   SQL server.

CAUSE

   The SQL server you are attempting to access is not set up correctly.

   It is missing the required stored procedures.

RESOLUTION

   To correct this situation, install the necessary stored procedures on

   the SQL Server by using the INSTCAT.SQL SQL script file supplied with

   the Microsoft Access disk set.

More Information:

Run INSTCAT.SQL to configure Microsoft SQL Server for use with ODBC,

the open database connectivity protocol used by Microsoft Access to

attach SQL Server tables. INSTCAT.SQL is the SQL Script file that

ships with with ODBC. You need to run it to set up the stored

procedures that provide catalog information used by ODBC.

To install the catalog stored procedures using INSTCAT.SQL, run

INSTCAT.SQL using the SQL Server facility ISQL (Interactive SQL) from

the MS-DOS command line.

Following is the syntax for this procedure. Note that you need to

enter the two lines as one continuous line, and do not include the

angle braces <> in the command:

   ISQL /U <sa login name> /n /P <password> /S <SQL server name>

   /i <drive:\path\INSTCAT.SQL> /o <drive:\path\output file name>

   Following is a description for each switch:

   /U    Gives the system administrator's login name

   /n    Eliminates line numbering and prompting for user input.

   /P    Gives the system administrator's Password -- case sensitive

   /S    Gives the name of the server to set up.

   /i    Gives the drive and fully qualified path for INSTCAT.SQL

   /o    Provides the output file destination for results of the

         process including errors.

   Here is an example ISQL command line:

   ISQL /U sa /n /P SA_Password /S SQL_SERVER /i d:\SQL\INSTCAT.SQL

   /o d:\SQL\output.txt

After running INSTCAT.SQL, run the RECONFIGURE command against the

MASTER database by using the SQL Administration Facility (SAF) from an

MS-DOS client or the server, or run the SQL Administrator program

from a Microsoft Windows client.

Other Possible Causes for this Error Message

--------------------------------------------

It is possible that other situations can indirectly cause this error

message. Use the following steps to troubleshoot the problem:

1. Use File Manager to search for multiple, corrupted, or outdated

   copies of these files:

      ODBC.DLL - dated on or after 10-16-92 containing 44736 bytes

      DBNMP3.DLL - dated on or after 9-15-92 containing 8241 bytes

      SQLSRVR.DLL - dated on or after 10-16-92 containing 135792 bytes

      NETAPI.DLL - depends on the network being used

      COMMDLG.DLL - dated on or after 10-25-92 containing 89248 bytes

      NOTE: The sizes and dates referenced are correct if the files are

            installed by Microsoft Access version 1.0.

2. Make sure the files listed above are in appropriate locations. All

   the files except NETAPI.DLL are usually installed in the Windows

   System directory. The NETAPI.DLL file is a network specific driver

   that is usually located in the network's program directory, which

   should be in the path.

3. Use another application, such as Q+E, SAF, or PowerBuilder, on the

   same machine to attempt to attach the same data source. If you

   cannot access the data source from another application, there is

   probably a problem with the network. That is there may be a problem

   with the NETAPI.DLL file or a problem with the SQL database server,

   not with Microsoft Access or ODBC.

4. Attempt to attach another data source such as another SQL server.

   If you are successful, the original server may be down or you may

   need to reconfigure the entry for that server by using the ODBC

   Administration Utility.

5. Attempt to attach to the same data source from another machine. If

   you cannot gain access to the SQL database server from another machine,

   there could be a network wide problem or the server may be down or not

   communicating.

6. Try increasing your ODBC timeout settings in the ODBC section of

   the MSACCESS.INI file.

7. Check with the system administrator to see if the SQL database server

   is up, available for transactions, and operating correctly.

8. Reinstall ODBC after restarting the server and renaming the ODBC.DLL,

   DBNMP3.DLL, and SQLSRVR.DLL files.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Appendix D, "Setting up

Microsoft Access on a Network," pages 660-662.

"Microsoft SQL Server Administrator's Guide," version 4.2, pages 205-

212.

References


PRB: Paste Unavailable After Record Is Copied to Clipboard

 Article Number: Q95323

 CREATED: 07-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If two users are simultaneously modifying the same record in the same

   table, the user who attempts to save the record last receives the

   following error message:

      Data has changed; Operation Stopped

   When you choose the OK button to close this message, you receive the

   following error message:

      This record has been changed by another user since you started

      editing it. If you save the record you will overwrite the changes

      the other user made. Copying the changes to the Clipboard will let

      you look at the values the other user entered, and then paste your

      changes back in if you decide to make changes.

   You are given the option to copy the changes the other user made to

   the Clipboard and then view the contents in the Clipboard; however,

   the Paste command is unavailable in Microsoft Access.

CAUSE

   Microsoft Access does not support pasting records when the focus is

   in a control. This behavior is by design.

RESOLUTION

   You can choose Paste Append to append the record to the table; or, if

   you select the record you want to paste to, you can then use the Paste

   command (or CTRL+V).

References


PRB: Current Record Doesn't Change Immediately on Replace All

 Article Number: Q95324

 CREATED: 07-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you run the Replace All command on records and the focus is on a

   field in a record, that record will not be changed until all other

   records have been replaced.

STATUS

   This behavior is by design.

More Information:

The record that has the focus reflects a change resulting from the

Replace All command after all other records in the dynaset have been

updated.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database NWIND.MDB.

2. Create a query based on the Orders table. For example:

      Query: QueryTest

      ----------------

      Field Name:          Ship City

      First Criteria Line: ="seattle"

3. Execute the query and position the cursor in the first field

   between the "e" and "a."

4. From the Edit menu, choose Replace. Enter LE in the Find What box.

   Enter LEFOO in the Replace With box. Under Search In, select Current.

   Do not select Match Case or Match Whole Field.

5. From the Edit menu, choose Replace All.

The first field does not display a change until all other records have

been changed.

References


PRB: Error in Column Property Help Menu Topic

 Article Number: Q95325

 CREATED: 07-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you search for "Column," then "Column Property" using the

   Microsoft Access Help menu, some of the remarks are not correct.

RESOLUTION

   When you use the Column property to reference a specific column in a

   combo box or list box, use Column(0) to refer to the first column,

   Column(1) to refer to the second column, and so on. In other words, the

   numbering begins with 0, not 1.

   Incorrect Statement in the Column Property Help Topic

   -----------------------------------------------------

   You can use the Column property to refer to a particular column in

   a multiple-column combo box or list box. Use 1 to refer to the

   first column, 2 to refer to the second column, and so on.

   Corrected Version

   -----------------

   You can use the Column property to refer to a particular column in

   a multiple-column combo box or list box. Use 0 to refer to the

   first column, 1 to refer to the second column, and so on.

More Information:

To create a multiple-column combo box, set the RowSource property to

include more than one column, and set the ColumnCount property to a number

greater than one. To refer to each column in the combo box, use the Column

property and include a reference number. Here is the syntax:

   Forms![Form Name]![Control Name].Column(#)

Replace the pound sign (#) with the reference number. The reference number

is 0 for first column in the control, 1 for the second column, 2 for the

third, and so on.

Here is a step-by-step example that demonstrates how to use the Column

property reference number correctly:

1. Open the NWIND.MDB sample database, and create a new, blank (unbound)

   form.

2. Add a combo box and a text box to the new form. Use the following as

   a guide to set the properties for each control:

      Object: Combo Box

      -----------------

         ControlName:   My Combo Box

         RowSource:     Employees (a table)

         ColumnCount:   3

         ColumnWidth:   0,1,1

         BoundColumn:   1

      Object: Text Box

      ----------------

         ControlName:   My Text Box

         ControlSource: =[Forms]![Column Example]![My Combo Box].Column(2)

   Because you set ColumnCount to 3 and RowSource to the Employees table,

   Microsoft Access loads the combo box with values from the first three

   fields in the Employees table: Employee ID, Last Name, and First Name.

   Because you set the width of the first column to 0 in the ColumnWidth

   property, the first column (Employee ID) does not show up in the combo

   box. The 2 in the Column(2) in the ControlSource setting for the text

   box, refers to the third column (First Name), not the second (Last Name).

3. Save the form, and name it Column Example.

4. Switch to Form view, and select a name from the combo box list.

The combo box list displays the Last Name and First Name fields for each

employee in the Employees table. When you select a name from the list,

Microsoft Access displays the last name in the combo box and the first name

in the text box.

References


INF: Using a Subtract Query to Find Unmatched Records

 Article Number: Q95326

 CREATED: 07-FEB-1993

 MODIFIED: 25-APR-1993

Summary:

This article describes how to create a Subtract query to compare two tables

and return a dynaset that includes only those records from the first table

that do not have matching records in the second table.

For example, say you have two tables (Table1 and Table2) joined on a common

field (Customer ID). Your goal is to find the records in Table1 that do not

have a matching Customer ID in Table2.

More Information:

To return a dynaset of records that do not match on the joined field,

create a query to join the two tables and subtract the matching records.

This article assumes the two tables are named Table1 and Table2. The steps

listed below outline the process.

Note: Selecting Table Names from the View menu (when in Query Design

view) prevents confusion when referring to the same field from two or

more tables.

1. In Design view, create a new query and add Table1 and Table2.

2. Join the two tables on the appropriate field. Microsoft Access joins the

   tables automatically if there is an underlying relationship between them.

3. Double-click the join line. Convert the join from its default of type 1

   to either type 2 or type 3. Use the join information to decide which

   type of join you want. For this example, you want all the records from

   Table1 and only those that match from Table2 -- a Type 2 join.

4. Drag the joined field from Table2 down to the query grid and set

   the criteria for this field to "Is Null." Uncheck the Show box so

   that Microsoft Access will not display this field.

5. Drag any other needed Table1 fields, such as the primary key field, to

   the query grid. These are the columns that identify unmatched records.

6. Run the query. The Is Null condition ensures that the dynaset contains

   only those records from Table1 that do not have a match on joined field

   in Table2.

The following is a sample Select statement that uses the Northwind

Traders (NWIND.MDB) sample database. It returns all the customers who

have not placed an order.

   SELECT DISTINCTROW Customers.[Company Name]

   FROM Orders, Customers,

   Customers LEFT JOIN Orders

   ON Customers.[Customer ID] = Orders.[Customer ID]

   WHERE ((Orders.[Customer ID] Is Null));

References


PRACC9302: Error When Import dBASE, FoxPro, or Paradox Table

 Article Number: Q95327

 CREATED: 07-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 2326

SYMPTOMS

   When you import a dBASE, FoxPro, or Paradox table without including the

   file extension, Microsoft Access displays this error:

      Couldn't find object '<filename>'

RESOLUTION

   Rename the file so that it has an extension. It does not have to have

   the correct extension, such as .DBF for a dBASE table, but it must have

   some sort of extension.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access version

   1.0. We are researching this problem and will post new information here

   in the Microsoft Knowledge Base as it becomes available.

More Information:

Steps to Reproduce Problem

--------------------------

1. Rename a dBASE, Paradox, or FoxPro file so that it has no

   extension. For example, rename CUSTOMER.DBF to CUSTOMER.

2. Open a Microsoft Access database.

3. From the File menu, choose Import...

4. In the Import dialog box, select the appropriate data source. For

   example, select dBASE III or IV to import a dBASE file.

5. Under List Files of Type, select All Files (*.*).

6. Locate and select the import file created in step 1 without an

   extension.

7. Choose the Import button.

You will see the following error message:

   Couldn't find object '<filename>'.

References


PRB: User with Full Permissions Can't Change a Query

 Article Number: Q95328

 CREATED: 07-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   After changing a query definition, you try to save it but cannot even

   though you have full permissions, including the fact that you are a

   member of the Admins group.

CAUSE

   Queries have a property called Run with Owner's Permissions. You can see

   it in the Query Properties dialog box. If it is checked, only the owner

   of the query can save it. Allowing someone else to make changes would

   be a security violation.

RESOLUTION

   Nobody other than the query owner (the person who created it) can save

   the query as long as this property is set. To allow anyone with Modify

   Definition permissions to save changes to a query, you need to clear

   the Run with Owner's Permissions check box.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 25,

"Administering a Database System," pages 625-629.

References


INF: How to Determine Whether a Form Is Minimized

 Article Number: Q95329

 CREATED: 07-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access does not include an intrinsic function to indicate

that a form is minimized. Use the IsIconic() function in the Microsoft

Windows Application Programming Interface (API) to determine that a

form is minimized.

More Information:

The following code example demonstrates declaring and calling the

IsIconic() function from Access Basic. The argument to IsIconic() is

the handle of the form the state of which you would like to know.

IsIconic() returns 1 if the form is minimized or 0 (zero) if the form

is not minimized.

'=================================================

'GLOBAL DECLARATION SECTION

'=================================================

Option Explicit

Declare Function IsIconic% Lib "User" (ByVal hwnd%)

'======================================================

' w_IsIconic()

'

' This function returns the window state of a form.

'

' Return value:

'   1 - Form is minimized.

'   0 - Form is not minimized.

'======================================================

Function w_IsIconic ()

   w_IsIconic = IsIconic(Forms!Form1.hwnd)

End Function

Reference(s):

Microsoft Windows Software Development Kit, "Programmer's Reference,

Volume 2: Functions," version 3.1, pages 555-556.

References


PRB: CTRL+HOME in List Box Moves to First Item in List

 Article Number: Q95387

 CREATED: 08-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 13668

SYMPTOMS

   When you press CTRL+HOME in a list box, the cursor moves to the first

   item in the list box, not the first field in the first record.

   However, when you search for "navigation keys," then "Navigation

   Keys -- Datasheets and Grids" using the Microsoft Access Help menu,

   you see that Help says CTRL+HOME has two purposes. You can press it to

   move to the first field in the first record, or in a multiple-line text

   box, you can press it to move to the beginning of the first line.

CAUSE

   The key combination CTRL+HOME is an edit key combination, so in a list

   box, the first use (moving to the beginning of the field) has precedence

   over the second use (moving to the first field in the first record).

   Because of this, the focus remains in the list box rather than moving to

   other fields or controls.

STATUS

   This behavior is by design.

References


INF: Doc Err: dBASE SET DELETED Characteristic in Access

 Article Number: Q95388

 CREATED: 08-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

When you delete a record in a dBASE database, the record is actually

only marked for deletion. It is not permanently removed until the

database is packed in dBASE.

This characteristic can produce confusing effects when browsing a

table.

Note: the Access Help Topic "Customizing MSACCESS.INI Settings"

incorrectly states that the default for Set Deleted is On.

More Information:

In dBASE, records which are marked for deletion still appear in any

output form, such as a browse table or a report, unless you set

DELETED to ON. Because of this, Microsoft Access displays records in

an attached dBASE table even if the records are marked for deletion.

To reproduce this characteristic in Microsoft Access, follow these

steps:

1. Attach the NEWCUST.DBF dBASE table. It should be present in your

   ACCESS directory if the sample databases were installed.

2. Open the NEWCUST table in datasheet mode.

   Notice that there are 13 records in this table.

3. Select the last record in the table by clicking on the record

   selector on the far left of the datasheet.

4. Press the Delete key.

   Notice that the record disappears from the datasheet leaving 12

   records in this table.

5. Close the datasheet window and open it again.

   Notice that all 13 records are there again.

This can be confusing because it seems that Microsoft Access deleted

the record, then undeleted it when you reopened the table. In reality,

Microsoft Access marked the record for deletion, but because the

marked record still exists in the table, Microsoft Access continues

to display it in datasheet.

To prevent this confusing scenario, Microsoft Access provides

functionality identical to the dBASE SET DELETED command. To take

advantage of this functionality, follow these steps:

1. Open MSACCESS.INI using NOTEPAD.EXE.

2. Find the section called [dBASE ISAM]

3. Change the setting...

   Deleted=Off

      to

   Deleted=On

4. Save MSACCESS.INI and restart Microsoft Access

Now, when you view the dBASE data, records marked for deletion will

no longer appear.

To permanently remove records marked for deletion, you must open the

dBASE table in dBASE and run the PACK command.

References


PRB: Access Error Using Edit Find with Yes/No Data Type

 Article Number: Q95389

 CREATED: 08-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you are using the Find command from the Edit menu on a form with

   a check box control bound to a field with a Yes/No data type, the

   Find will not work correctly. When you enter Yes or No in the Find

   What box and execute the Find, the following message is displayed:

      Microsoft Access has reached the end of the dynaset.

CAUSE

   Although it appears that the check box is receiving the focus, the

   actual focus is on the label for the check box. The check box will

   never receive the focus, so you cannot use the Find function on the

   check box. The Find function will work correctly if the control is

   not a check box.

RESOLUTION

   Do not use a check box if you want the ability to search on this

   field. You can search on a Yes/No data type if it is a text box.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a form with a check box control using the Yes/No data type.

2. Switch to Form view, and click in the new check box.

3. From the Edit menu, choose Find.

4. Enter Yes or No in the Find What box. Choose the Find Next button.

The above error message will be displayed without any values being

located.

References


INF: Eliminating White Space in Reports with CanShrink and

 Article Number: Q95390

 CREATED: 08-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

Before printing a form or report, you can save space by conditionally

reducing the sizes of the controls on the form or report. For example,

you might want to reduce the size of text boxes that contain varied-length

text or reduce the size of text boxes bound to fields that could be empty.

Note the following information before you try to reduce the size of

controls in reports:

- Overlapping controls will not shrink, even when the CanShrink property

  is set to Yes.

- Controls shrink line by line (vertically). This means, for example, that

  if there are a group of controls placed on the left side of the page and

  a large control (for example, an OLE picture) on the right side of the

  page, the controls on the left side of the page will not shrink, unless

  the picture is blank and hidden.

- Space between controls is not affected by the CanShrink or CanGrow

  properties.

More Information:

A control containing null information automatically shrinks to nothing and

disappears when its CanShrink property is set to Yes, but the space

between the controls is not affected by the CanShrink property.

For example, say you have 11 controls in a column of a report, and there is

.1 inch of space between each control. Even if all 11 controls contain null

information and all 11 have their CanShrink property set to Yes, the space

between the controls adds up to 1 inch. When you print the report, even

though the 11 controls do not print, the first control that does contain

text will print 1 inch lower than you might expect because of all the

accumulated space.

A good way to manage the size of your controls is to have as few as

possible. This will minimize the white space between the controls.

The following example demonstrates how to print mailing labels by using

an Access Basic function to minimize the number of controls and give you

nice, even spacing. Say you want to create mailing labels containing a

name, business name, address, city, state, and zip code. You could use

several different fields, but it would be better to use a single text box,

as in the following step-by-step example:

1. Create a single text box control and set its ControlSource property

   to this expression:

   =AddressBlock([Name],[Business Name],[Address],[City],[State],[ZipCode])

2. Create a new Access Basic module, and type the following code into it:

   Option Explicit

   Function AddressBlock$ (AName, Addr1, Addr2, City, State, Zip)

      Dim A1$, A2$, A3$, A4$, CR$

      CR$ = Chr(13) & Chr(10)  'Carriage return and line feed

      A1$ = IIf(ISB(AName),"",AName & CR$)

      A2$ = IIf(ISB(Addr1),"",Addr1 & CR$)

      A3$ = IIf(ISB(Addr2),"",Addr2 & CR$)

      A4$ = City & ", " & State & " " & Zip

      AddressBlock = A1$ & A2$ & A3$ & A4$   'Concatenate the strings.

   End Function

   Function ISB (V) As Integer

      If IsNull(V) or V = "" Then ISB = True Else ISB = False

   End Function

Now you can run the module to print the labels and keep wasted space to

a minimum.

References


PRB: Bound SubReport Does Not Show DDE Data

 Article Number: Q95441

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 13990

SYMPTOMS

   The result of a DDE expression in a subreport does not display in

   Print Preview or when a report is printed.

CAUSE

   If the subreport is bound, there must be at least one row of data

   in the underlying table or dynaset before the subreport's DDE data

   will display.

RESOLUTION

   There are three possible resolutions:

    - Hide the DDE expression if the dynaset for the subreport is

      empty.

    - Place the DDE expression in an unbound subreport.

    - Place the control that contains the DDE expression in the main

      report.

More Information:

Steps to Reproduce Behavior

---------------------------

 1. Start Microsoft Excel and create a new worksheet. Place the text

    "This is a test" in row 1, column 1. Save this worksheet as

    DDETEST.XLS, and leave this worksheet open.

 2. In Microsoft Access, create a new table:

       Table: Table1

       -------------

       Field Name: TXT

       DataType:   Text

 3. Create a new report bound to [Table1].

 4. Add a text box bound to the field [TXT] by dragging [TXT] from the

    Field List to the report.

 5. To add an unbound text box, select the text box tool from the

    ToolBox and click on the report. Put the following expression in

    the ControlSource property of this unbound text box:

       =DDE("Excel","DDEtest.xls","R1C1")

 6. Save this report as "SubRep" (without the quotation marks).

 7. View [SubRep] in Print Preview. "This is a test" displays

    correctly.

 8. Close [SubRep] and create a new report. Drag the report, [SubRep],

    from the Database window onto this new report. Save this report as

    [MainRep].

 9. View [MainRep] in Print Preview. "This is a test" is not visible

    on the report. Close [MainRep].

10. Open [Table1] and add some data to it. View [MainRep] in Print

    Preview. Notice that "This is a test" is now visible.

References


PRB: Valid Sum Function Returns '#Name?' in Calculated Control

 Article Number: Q95442

 CREATED: 09-FEB-1993

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   If you open a form in Form view and have two or more calculated

   controls, you may get "#Name?" in each of the calculated controls

   on the form, even if the expression for that control is valid.

CAUSE

   All of the domain functions are based on the same query (over the

   underlying dynaset). If any of the bound functions on the form has

   a binding error, all of the functions on the form return an error.

RESOLUTION

   Find the control(s) that uses an invalid expression. Either remove

   the control or correct the expression being used for the control.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new form based on the Orders table from the sample

   database Northwind Traders (NWIND.MDB).

2. Create a text box bound to the Order Amount field of this table.

   Set the following properties:

      Text Box

      --------

      ControlName:   Order Amount

      ControlSource: Order Amount

3. Create an unbound text box on the form. Set the following

   properties:

      Text Box

      --------

      ControlName:    Test1.

      ControlSource:  =Sum([Order Amount]

4. Create another text box on the form. Set the following properties:

      Text Box

      --------

      ControlName:    Test2.

      ControlSource:  =Sum([Test1])

5. View the form in Form view.

#Name? will appear in the second and third text boxes (Test1 and

Test2). Because you cannot use the Sum function on a calculated

expression, Test2 is invalid. This causes all calculated expressions

on the form to return "#Name?."

If you remove Test2 from the form, Test1 will display the correct

value.

References


PRB: Focus Returns to Control After OnDblClick

 Article Number: Q95443

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 14371

SYMPTOMS

   If you assign an event (function or macro) to the OnDblClick

   property of a control, the event is processed and the focus is

   returned to the control you double-clicked on. Even if the event

   contains a GoToControl action, the focus will still be returned to

   the control that you double-clicked.

CAUSE

   This behavior is by design.

RESOLUTION

   If you would like the focus to move to another control, you must

   use the CancelEvent action after the GoToControl action in the

   macro or function.

More Information:

The following is an example of a macro that can be attached to the

OnDblClick property of a control (Field1) and used to move the focus

to another control (Field2).

   Macro Name    Action          Argument

   --------------------------------------

   Test1         GoToControl     Field2

                 CancelEvent     (no arguments)

The GoToControl action moves the focus to Field2, and the CancelEvent

action cancels the double-click action. Thus, the focus remains on

Field2.

References


INF: Creating Floating Popup Menus

 Article Number: Q95444

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

The text below discusses how to create "floating" popup menus using a

combination of functions in the Microsoft Windows application

programming interface (API) and Access Basic code.

More Information:

To create a floating popup menu, perform the following eight steps.

1. Create a new form called "Popup Menu Form."

2. Add a List Box control called "Menu" to the form. Make the control

   large enough to display each of the strings it contains without

   displaying a scroll bar. Give the control the following properties:

      List box properties

      -------------------

         ControlName:   Menu

         RowSourceType: Value List

         RowSource:     String1;String2;String3;String4

         AfterUpdate:   =ItemSelected([Menu])

         Left:          0 in

         Top:           0 in

         FontName:      System

         FontSize:      8

         FontWeight:    Bold

   NOTE: Specify the menu strings in the RowSource property. Separate

   succeeding string values with a semicolon (;) character.

3. Change the properties of the "Popup Menu Form" as indicated below.

      Form properties

      ---------------

         ScrollBars:      Neither

         Popup:           Yes

         RecordSelectors: No

         Width:           <Width of the list box control>

      Section properties

      ------------------

         Height:          <Height of the list box control>

4. Save the form and close it.

5. Create a new module and place the following code into the

   Declarations section for the module.

      'NOTE: Some of the following Windows API functions may be

      'defined in an existing Microsoft Access library. If so, the new

      'declarations would cause a duplication procedure name error. If

      'this error occurs, remove the offending declare statement from

      'your code or convert the declaration to a comment.

      'NOTE: In the following sample code, an underscore (_) is used

      'as a line continuation character. Remove the underscore when

      're-creating this code in Access Basic.

      Option Explicit

      Type POINTAPI

         x As Integer

         y As Integer

      End Type

      Global Const GWL_STYLE = (-16)

      Global Const WS_DLGFRAME = &H400000

      Declare Sub GetCursorPos Lib "User" (lpPoint As POINTAPI)

      Declare Function GetWindowLong& Lib "User" (ByVal hWnd%,_

                          ByVal nIndex%)

      Declare Function SetWindowLong& Lib "User" (ByVal hWnd%,_

                          ByVal nIndex%, ByVal dwNewLong&)

6. Add the following functions to the module.

      Function ShowPopup ()

         Dim coord As POINTAPI

         Dim attr&

         GetCursorPos coord

         DoCmd OpenForm "Popup Menu Form"

         attr& = GetWindowLong(Forms![Popup Menu Form].hWnd, GWL_STYLE)

         attr& = SetWindowLong(Forms![Popup Menu Form].hWnd, GWL_STYLE, _

                    attr& And Not WS_DLGFRAME)

         DoCmd MoveSize (coord.x * 14), (coord.y * 14), , 1100

      End Function

      Function ItemSelected (WhichItem As String)

         DoCmd Close

         MsgBox "The selected item was " & Trim(WhichItem)

      End Function

7. Choose the form in which you want the popup menu to appear. Open

   the form in Design mode.

8. Select the event property that you want to use to activate the

   popup menu and specify the following function call:

      =ShowPopup()

When you open your form and cause the event chosen in Step 8 above,

the popup menu appears at the current mouse position. The menu remains

on the screen until you select an item from the popup menu.

References


INF: Updating a Separate Table When a Value Changes on a Form

 Article Number: Q95445

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

This article shows by example how to have Microsoft Access automatically

update a field in a table when you use a form to change a related field

in a different table. In other words, you can have Microsoft Access post

your changes to a separate table that is not bound to the form.

To set this up, you need to:

 - Add a text box control to the form.

 - Create a new macro group (UpdateOther) that contains two macros

   (SaveValue and ChgValue) to run the update query.

 - Create an update query (IDChgQuery in this example).

 - Change several properties to execute the macros.

More Information:

This example uses the Products form in the sample database Northwind

Traders (NWIND.MDB). Here is the step-by-step procedure:

1. Open the NWIND.MDB database, and make a few modifications to set it up

   for this example. First, delete the relationship between the Products

   and Order Detail tables. Then, because you cannot update fields that

   have a Counter data type, change the following properties of the Product

   ID field in the Products table:

      Table: Products

      ---------------

      Field Name: Product ID

         DataType: Number

         FieldSize: Long Integer

2. Open the Products form in Design view, and display the property sheet.

   Set the following form and control properties:

      Form: Products

      --------------

      OnCurrent: UpdateOther.SaveValue

      Field: Product ID

      -----------------

      AfterUpdate: UpdateOther.ChgValue

      Locked: No

   These actions activate the macros, which in turn run the update query.

3. Add an unbound text box control to the form, and give it the following

   properties:

      Control: Text box

      -----------------

      ControlName: Previous ID

      Visible: No

4. Create a new macro group (UpdateOther) to hold two macros (SaveValue and

   ChgValue) by first choosing to create a new macro. Next, choose Macro

   Names from the View menu or click the Macro Names button on the toolbar.

   Microsoft Access displays the Macro Name column.

5. Enter the two macro names along with their actions and action arguments.

   Each macro in the macro group begins on the line that contains that

   macro's name. Use the following table as a guide:

      Macro Name   Action and Action Arguments

      ----------------------------------------

      SaveValue    SetValue

                      Item:        [Previous ID]

                      Expression:  [Product ID]

      ChgValue     SetWarnings

                      Warnings On: No

                   OpenQuery

                      Query Name:  IDChgQuery

                      View:        Datasheet

                      Data Mode:   Edit

                   SetValue

                      Item:        [Previous ID]

                      Expression:  [Product ID]

6. Save the macro group, and name it UpdateOther. Now UpdateOther appears

   in the list of macros in the Database window. You can use the following

   syntax to specify each macro in the macro group:

      macrogroupname.macroname

   For example, UpdateOther.SaveValue specifies the save value macro.

7. Create a new update query called IDChgQuery. Add the table Order Details

   to the query. In the Field cell, enter Product ID. In the Update To

   cell, enter Forms![Products]![Product ID]. In the Criteria cell, enter

   Forms![Products]![Previous ID]. Here is a summary:

      Query: IDChgQuery

      -----------------

      Tables: Orders Detail

         Field:     Product ID

         Update To: Forms![Products]![Product ID]

         Criteria:  Forms![Products]![Previous ID]

Now, when using the Products form, which is bound to the Products table, if

you enter a new value in the Product ID field, Microsoft Access updates the

Product ID column in the Orders Detail table automatically. It does it by

running the UpdateOther.SaveValue macro to save the previous value to use

as criteria and then the UpdateOther.ChgValue macro to run the IDChgQuery

update query. The IDChgQuery query updates the Product ID column in the

Orders Detail table overwriting the previous old value with the new value.

References


PRACC9302: Importing Delimited Text Files Strips Off Decimals

 Article Number: Q95446

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 2310

SYMPTOMS

   You import a delimited text file that contains numbers with decimal

   places, and the resulting table does not show the decimal places.

CAUSE

   When Microsoft Access creates the table, it looks at the first record

   in the file to decide which data type to assign to the field. If the

   first record contains a .00 decimal value in a field, Microsoft Access

   gives the field a Number, Long Integer data type. Then it strips all

   the decimal values when importing the file because the Number, Long

   Integer data type does not support decimal values.

RESOLUTION

   There are two workarounds. The first is to create a destination table

   that already has the fields defined. Choose Number, Double as the data

   type. It supports decimal places. When you import the text file, append

   it to the existing destination table rather than allowing Microsoft

   Access to create a new table.

   Alternatively, you can work around the problem by making sure the number

   fields in the first record do not contain .00 as decimal values.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access version

   1.0. We are researching this problem and will post new information here

   in the Microsoft Knowledge Base as it becomes available.

More Information:

If any of the fields in the first record contain numbers that have decimal

values of .00, Microsoft Access strips the decimal places from all the

records for the corresponding fields in the resulting table.

Steps to Reproduce Behavior

---------------------------

1. Use a text editor such as Notepad or MS-DOS Edit to create two text

   files (FILE1.TXT and FILE2.TXT) using the following as a guide:

      FILE1.TXT

      ---------

      234.50

      350.75

      FILE2.TXT

      ---------

      100.00

      276.93

2. Import the first file as a delimited text file, and have Microsoft

   Access create a new table. Notice that the resulting table has the

   numbers in the correct format. The data type for this field was

   defined as Number, Double.

3. Import the second file as a delimited text file, and have Microsoft

   Access create a new table. Notice that the resulting table imports the

   numbers as follows:

      100

      276

Microsoft Access stripped the decimal places from the second file because

the data type for the field was defined as Number, Long Integer -- a data

type that does not support decimal values.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 72-78.

References


PRB: '|' Isn't A Valid Path Error Message on Start

 Article Number: Q95447

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When trying to start Microsoft Access, you receive the following error

   message:

      '|' Isn't a Valid Path

CAUSE

   The drive that contains your TEMP directory does not have enough disk

   space, or there no valid SET TEMP statement in the AUTOEXEC.BAT file.

RESOLUTION

   Exit from Windows. Then at the MS-DOS prompt, type SET and press ENTER.

   This gives you a listing of the MS-DOS environment settings. Confirm

   that one of the settings is TEMP= followed by a valid path.

   If you find the TEMP= setting, then check the amount of disk space

   available on the drive where your temporary directory resides. If you

   do not have enough disk space, delete unnecessary files from the

   drive or move the TEMP directory to a partition that has enough disk

   space and change the SET TEMP= line in the AUTOEXEC.BAT file.

References


PRB: Bitmap May Not Display Correctly in Microsoft Access

 Article Number: Q95448

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A bitmap that displays correctly in another application does not display

   correctly in Microsoft Access.

CAUSE

   When Microsoft Access starts, it loads a fixed 256-color palette. This

   color palette supports the most common colors used in bitmaps and

   metafiles. All pictures and OLE Objects displayed in Microsoft Access

   are mapped to this color palette.

STATUS

   This behavior is by design.

More Information:

By using a fixed color palette, Microsoft Access can display multiple

pictures and OLE objects on the screen at one time without each new object

affecting the screen colors.

Windows uses only one palette at a time. This is usually not a problem

because most applications, such as PBRUSH.EXE, display only one bitmap at a

time, so they can use a single Windows palette to display the bitmap.

However, Microsoft Access can display multiple bitmaps at one time.

Therefore, Because Windows can use only one palette at a time, Microsoft

Access uses a common palette that hopefully will be common to all the

bitmaps Microsoft Access might display.

This is why bitmaps and metafiles displayed in Microsoft Access may be

colored differently than they were in the application in which they were

created. Because Windows can use only one palette at a time, each object

Microsoft Access displays must be mapped to the fixed color palette loaded

by Microsoft Access. Microsoft Windows determines this mapping. You cannot

modify it.

Steps To Reproduce Behavior

---------------------------

1. Start Microsoft Paintbrush (PBRUSH.EXE).

2. Choose Image Attributes and select Black and White under the

   Color option.

3. Create a simple picture using several different shades of gray.

4. Choose Save from the File menu.

5. Under the Save File as Type: option, select 256 Color Bitmap.

6. Start Microsoft Access, and open the example database NWIND.MDB.

7. Open the Categories form in Form view.

8. Select the Picture Control.

9. Choose Insert Object from the Edit menu, and click the File button.

10. Choose the file you just created in Microsoft Paintbrush, and click the

    OK button.

Result: the file loads as a solid black picture. Microsoft Paintbrush uses

a custom palette to offer a variety of shades of gray. But Microsoft Access

does not have the ability to load or reproduce this custom color palette,

so it requests that Windows map each of the colors in the bitmap to the

custom palette that was loaded when Microsoft Access started.

This example is extreme. In most cases the color change will be slight.

References


PRB: Wait Argument in SendKeys May Not Stop Macro Processing

 Article Number: Q95449

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When a macro calls the SendKeys action with the Wait parameter set

   to Yes, the macro will continue before the program that processed

   the keystrokes has finished performing the action that it was

   called to do.

RESOLUTION

   To work around this issue, have the macro call an Access Basic

   function or procedure that checks to see if the other application

   is finished. To correct the situation described above, you can do

   the following:

   Macro Action

   ------------

   RunApp                - Start Excel

   SendKeys              - Start the macro

   RunCode               - Call a module that continues checking until

                           the file exists

   TransferSpreadsheet   - Import the spreadsheet

More Information:

For example, suppose you want to create a macro that will call Excel

to make a file and then process that file once Excel has created it.

The Access macro calls RunApp to start Excel, then calls SendKeys

to start an Excel macro with the Wait parameter set to Yes. Access

will wait until the key strokes are processed, then continue if

the Excel macro has not finished creating the file. Access will NOT

wait for Excel, and will fail when it tries to use the file.

The SendKeys action in Access has two arguments: the first argument

indicates which keystrokes to send; the second argument causes Access

to pause until the keystrokes are processed.

The description of the Wait argument on page 432 of the "Language

Reference" is misleading. If Wait is Yes, Access will only wait until

the keystrokes are processed. It will not wait until the application

that the keystrokes were sent to is finished.

Reference(s):

Microsoft Access "Language Reference," version 1.0, pages 433-435

References


PRB: Can't Change Combo Box Value If ControlSource Is Counter

 Article Number: Q95450

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   After setting the ControlSource property of a combo box to a field that

   has a Counter data type, you try to change the value in the combo box

   and receive the following status bar message:

      Control bound to counter column 'Field name'

CAUSE

   The ControlSource of a combo box is a table field where Microsoft Access

   writes your combo box selection. By design, modifications to a Counter

   field are not allowed. Therefore, if the ControlSource property of a

   combo box is set to a Counter field, Microsoft Access cannot update the

   value in the Counter field, so you cannot change the combo box value.

   Microsoft Access gives you the message to tell you why it cannot update

   the combo box control.

RESOLUTION

   Either change the data type of the field now in the ControlSource

   property of the combo box, or set the ControlSource property to a

   field that does not have a Counter data type.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access, open the NWIND.MDB sample database, and create

   a new table called MyTest.

2. Add the following three fields to the MyTest table:

      Field Name     Data Type

      ------------------------

      MyCounter      Counter

      MyData         Number

      MyBucket       Number

3. Enter a few random numeric values in the MyData field. Notice that

   Microsoft Access automatically fills in the MyCounter field and puts

   zeroes in the MyBucket field as you enter values in the MyData field.

4. Create a new blank form.

5. In Design view, place a combo box on the form. Set its ControlSource

   property to the MyCounter field, and its RowSource property to the

   MyTest table.

6. Switch to Form view. Notice that the combo box values are the sequential

   numbers coming from the MyCounter field.

7. Drop down the combo box list and attempt to select a new value from

   it. You receive the following message on the status bar:

      Control bound to counter column 'The Counter'.

   The value in the combo box does not change.

8. Switch back to Design view and change the combo box ControlSource

   property from MyCounter to MyBucket.

9. Switch back to Form view and repeat step 7. Now you can select items

   from the combo box. If you look at the contents of the table, you can

   see the values you select come from the MyBucket field.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 9, "Designing

Forms," pages 235-238.

References


PRB: Property List Boxes Show Two-Word Options on Two Lines

 Article Number: Q95452

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   All the list boxes that show properties use two lines to display

   two-word options instead of putting each two-word option on a

   single line.

CAUSE

   There is an incorrect List Separator in the International section of

   your WIN.INI file.

RESOLUTION

   From the Main group in Program Manager, choose Control Panel. From there,

   choose the International icon. Change the List Separator to a comma (,).

   Now the Property list boxes in Microsoft Access will list two-word

   options correctly. Note that different List Separator entries will cause

   different results.

More Information:

Steps to Reproduce Behavior

--------------------------

1. From the Accessories group in Program Manager, choose Notepad.

2. From the File menu, choose Open.

3. Type C:\WINDOWS\WIN.INI, and choose the OK button. If your Windows

   directory is different, modify the path accordingly.

4. From the Search menu, choose Find.

5. Type slist, and choose the Find Next button.

6. Change the line in the WIN.INI file to look like this:

      slist=" "

7. Save the file, and restart Windows.

8. Start Microsoft Access and open any form in Design view.

9. Choose Default View and look at the valid choices in the list box by

   clicking the down arrow.

   Your displayed choices will look like this:

      Default View....Single

                      Form

                      Continuous

                      Forms

                      Datasheet

   The list should look like this:

      Default View....Single Form

                      Continuous Forms

                      Datasheet

References


PRB: Moving Backward in Report Print Preview Window Is Slow

 Article Number: Q95453

 CREATED: 09-FEB-1993

 MODIFIED: 25-APR-1993

Summary:

SYMPTOMS

   In the Print Preview window in reports, you can move forward and

   backward page by page to view your report before printing it. When

   previewing a large report, you may notice it takes longer to move

   backward than it takes to move forward. The further along you are

   in the report preview, the longer it takes to move backward.

CAUSE

   Microsoft Access must reformat the report pages behind it when

   moving backward. In other words it reformats all the pages from

   page 1 to the current page minus 1.

   As you preview a report in the Print Preview window, Microsoft

   Access formats the report pages. It keeps the page formats in

   memory until you move to a new page. Once you move past a page,

   all the formats constructed to show that page are lost.

   Therefore, previous pages must be reconstructed each time you

   move backward.

   The more pages there are between page 1 and your current page

   location, the more time it takes Microsoft Access to reconstruct

   them. For example, it takes less time to go from page 3 to page 2

   than it takes to go from page 300 to page 299. In the first example,

   only two pages need to be reformatted. In the second, 299 pages

   need to be reformatted.

RESOLUTION

   Rather than previewing or printing a report in Microsoft Access,

   you might consider saving it in a file format that can be

   read by another program such as a spreadsheet or word processor and

   then use the spreadsheet or word processor to browse the report.

   The ability to save a report in different file formats is not built

   into Microsoft Access. However, you can use the OutputAs utility that

   comes as two files -- OUTPUTAS.MDA and OUTPUTAS.DLL -- to save

   a report in other formats.

   You can download OUTPUTAS.MDA and OUTPUTAS.DLL from the reports

   section of CompuServe library 5. At this time, this is the only place

   to get them. Please read the README.TXT file included with the

   OUTPUTAS.MDA and OUTPUTAS.DLL files for detailed instructions on how

   to use it.

   After installing OUTPUTAS.MDA and OUTPUTAS.DLL, you will have a

   Save Report As command added to your Microsoft Access Help menu.

   You can choose Save Report As to save report output in the

   following file formats:

    - BIFF (binary interchange file format) -- a Microsoft Excel

      version 3.0 and higher format.

    - RTF (rich-text format) -- a Microsoft standard document

      interchange format.

    - ASCII (American Standard Code for Information Interchange) --

      a text-only format.

   Once installed, you can choose the Output Report As command from

   the Help menu, select a report from the list it gives you, and then

   choose to output the report in RTF format. Then you can use Microsoft

   Word for Windows to examine and edit the resulting .RTF file.

References


INF: Using Multiple Copies of the Same Table in a Query

 Article Number: Q95454

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

When designing queries, you may at some point need to make multiple

references (links) between a column in one table and different columns

in another table. If you set up the links incorrectly, the query may

return unexpected results or no results at all.

To build the links correctly, you should load multiple copies of the

common table. Then you can reference columns from the other copies as

needed. This is all possible because in Microsoft Access, you can add

multiple copies of the same table to a query.

More Information:

When you add a second copy of a table to a query, Microsoft Access

gives the second copy the same name as the first but appends an

underscore character (_) and consecutive number to the copy. For

example, if Test is the original table name, Microsoft Access names

the first copy Test_1, the second Test_2, the third Test_3 and so on.

Example Scenario

----------------

Here's a scenario that requires multiple copies of a table in a query.

Suppose your company keeps an inventory of janitorial supplies. One

table (Main) holds product names, a code for the primary supplier of

that product, and a code for the alternate supplier. Another table

(Full Names) gives a full name for each supplier code. Here's the

structure:

   Table: Main                   Table: Full Names

   -----------                   -----------------

   Field: Product                Field: Supplier Code

   Field: Primary Supplier       Field: Full Supplier Name

   Field: Backup Supplier

A sample record from the table Main might look like this:

   Product   Primary Supplier  Backup Supplier

   ----------------------------------------------

   Floor Wax      CC              AJ

You use a code for each supplier in Main, but want to see the full name

of each primary and alternate supplier in a query. In other words, you

want your output to look like this:

   Product   Primary Supplier  Backup Supplier

   ----------------------------------------------

   Floor Wax   CleanCo      Allied Janitorial

Your initial reaction might be to create a query joining both the

Primary Supplier and Backup Supplier columns from the Main table to

the Supplier Code column of the Full Names table. However, the result

of the query shows no data. This occurs because the only rows that

satisfy the links are those rows in Mail where the values in Primary

Supplier field match those in the Backup Supplier fields. That is,

Microsoft Access tries to match a single row in Main with a single row

-- not multiple rows -- in the Full Names table. The result is no match.

To correctly evaluate the supplier codes for both primary and alternate

suppliers, you need two copies of the Full Names table. Add another copy

of the Full Names table to the query. It becomes Full Names_1.

Link the Primary Supplier column in the Main table to the Supplier Code

column in the Full Names table. Then link the Backup Supplier column in

the Main table to the Supplier Code column in the new Full Names_1 table.

Your query grid should look something like this:

   Query: Suppliers_Query

   -----------------------

   Field: Product

   Table: Main

   Field: Full Supplier Name

   Table: Full Names

   Field: Full Supplier Name

   Table: Full Names_1

Note: It's helpful to choose Table Names from the View menu. Then it's

clear which table is which on the query grid.

Now when you run the query, the result shows the full supplier name for

both the primary and the backup suppliers. If you like, you can use your

own names for the column headings to make them more meaningful or readable.

For information on how to do this, search for "renaming fields," then

"Renaming a Field in a Query," using the Microsoft Access Help menu

If you anticipate that a product may have a primary but not a backup

supplier, change the join property between Full Names_1 and Main to

include all records from Main and only those records from Full Names_1

where the joined fields are equal.

References


INF: How to Send the Contents of a Control with SendKeys

 Article Number: Q95455

 CREATED: 09-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

To specify the contents of a control or field in the SendKeys action

argument, you must precede the control or field name with an equal

sign (=) in the Keystrokes argument.

More Information:

The following example will perform a SendKeys action and send the

contents of Field0 as the argument to the action.

Action      Keystrokes

----------------------

SendKeys    =Forms!Form1!Field0

References


PRB: Clicking Mouse in AccessWizard Background Changes Focus

 Article Number: Q95565

 CREATED: 17-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When use you the Form Wizard or the Report Wizard, you can change

   the input focus by clicking the mouse in different portions

   background in the Form Wizard or Report Wizard window. For example,

   if you click the mouse at the bottom of the Form Wizard (in the

   area that contains the "Cancel," "Back," and "Next" buttons),

   Microsoft Access gives the input focus to a control in that colored

   area.

CAUSE

   The input focus changed because the Form Wizard and Report Wizard

   are forms that contain a Detail section and a Footer section.

   Clicking the mouse in the Footer section (that contains the

   buttons) moves the input focus to the first enabled control in this

   section (the tab order determines which control is first). However,

   the input focus does not move if you click the mouse in the section

   that contains a control that already has the input focus.

More Information:

Perform the following eight steps to demonstrate this behavior.

Steps to Reproduce Behavior

---------------------------

1. Open the NWIND.MDB sample database.

2. Choose Tables from the View menu.

3. Select the Categories table from the Database window.

4. From the File menu, choose New then choose Form.

5. Choose the FormWizards button. (If the FormWizard is not installed,

   the button is dimmed and unavailable.)

6. Select Single-column and then choose OK.

7. Note that the Next button does not have the focus.

8. Click the in the area at the bottom of the form (not on any of the

   buttons) and the focus shifts to the Next button.

References


PRB: No Field List When Form Based on SQL Statement

 Article Number: Q95566

 CREATED: 17-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   An attempt to set the record source for a form to an SQL statement

   fails and no fields appear in the Field List dialog box.

CAUSE

   Microsoft Access does not support using an SQL statement as the

   record source for a form.

RESOLUTION

   Create a query based on the SQL statement and set the record source

   for the form to the query.

More Information:

To demonstrate this behavior, perform the following seven steps.

Steps to Reproduce Behavior

---------------------------

1. Open the NWIND.MDB sample database.

2. Open the Category List query in Design mode.

3. Choose SQL from the View menu to display the SQL statement for this

   query.

4. Select the contents of the SQL window. Copy the SQL statement to

   the Clipboard with the CTRL+C key combination.

5. Choose Cancel to close the SQL dialog box, then close the Category

   List query.

6. Open a new unbound form. Paste the SQL statement into the form's

   RecordSource property with the CTRL+V key combination.

7. To display the field list, choose Field List from the View menu.

   Note that even though the SQL statement displays in the dialog box

   title bar, no fields are listed to choose from.

References


PRB: Error Message: Query Must Have at Least One Output Field

 Article Number: Q95573

 CREATED: 17-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you try to execute a query, you receive the following error

   message even though the query clearly has fields in the query grid:

      Query must have at least one output field

CAUSE

   One of the fields in the query grid has a colon as the right-most

   character in its name (for example, LastName:). The query parser

   looks for colons in a name to denote calculated fields and

   misinterprets the field name as a result.

RESOLUTION

   Open the source table in Design view and remove the colon from the

   field name. Changing the field name does not affect the data stored in

   the field.

References


INF: Returning Case Sensitive Match in Queries

 Article Number: Q95605

 CREATED: 17-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access can differentiate between case sensitive text strings

using the Asc() function. Using this function in a select query,

Microsoft Access can locate an exact case sensitive match.

More Information:

This technique is useful in a situation where the user needs to find

all the records in a field that contain lowercase text rather than

uppercase text for the first character. An example of this might be in

the Employees table of the NWIND.MDB sample database. Please note that

the example below will find only the first character. If you need

something more complex, you must call an Access Basic function to

return the results.

Suppose the text field called First Name contains values such as the

following:

   First Name

   ----------

   andrew

   Andrew

   Nancy

If you need to find all the records that contain the lower case

"andrew" as compared to "Andrew," use the Asc() function. To do this,

create a new select query:

   Query: QueryTest

   -----------------------

   Field name: First Name

      Show: True

   Field name: Asc([First name])

      Show: True

      First Criteria Line: Like Asc("a")

This query will return only the record for "andrew," not "Andrew."

Reference(s):

Microsoft Access "Language Reference," version 1.0, page 40 [Asc()

Function]

Microsoft Access "User's Guide," version 1.0, chapter 6

References


INF: Enforcing Transactions on Attached SQL Server Tables

 Article Number: Q95607

 CREATED: 17-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access will automatically support transaction processing on

attached SQL Server tables using queries. However, explicit

transactions in Access Basic require the use of dynasets on attached

tables and further require a specific order in the creation of the

dynasets and the implementation of transaction processing.

More Information:

Microsoft Access will enforce transaction processing on an attached

SQL Server table through the use of a dynaset created on that table.

To get more information on how to create a dynaset on an attached SQL

Server table, search for "CreateDynaset" using the Help menu. The key

to making transaction processing work for attached SQL Server tables

is to create and close the dynaset on the attached SQL Server table

outside the transaction. Below are pseudo-code examples of the

incorrect and correct methods of coding this process:

   ***INCORRECT***

   Dim MyDyna As Dynaset

   BeginTrans

      MyDyna = CreateDynaset("Table1")

      <misc.code such as Inserts/Updates/Deletes.>

      MyDyna.Close

   CommitTrans/Rollback

   ***CORRECT***

   Dim MyDyna As Dynaset

   MyDyna = CreateDynaset("Table1")

   BeginTrans

      <misc.code such as Inserts/Updates/Deletes.>

   CommitTrans/Rollback

   MyDyna.close

References


INF: Use a Query to Parse a Full Name into Two Fields

 Article Number: Q95608

 CREATED: 17-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

The following query parses a field containing a full name in which the

last and first names are separated by commas. For example a name could

be entered as: Smith, John. The query would return two columns named

Last: and First:. The query uses the Left$ and Right$ functions and

searches for the comma using the InStr function.

   Query: QueryTest

   ----------------

   Field Name: Last: Left$([Name],InStr(1,[Name],",")-1)

      Show: True

   Field Name: First: Right$([Name],Len([name])-InStr(1,[Name],",")-1)

      Show: True

You can modify the query to account for spaces in the name field. For

example if the name field contained Smith,John with no spaces, you

would remove the -1 for the first name field.

References


PRB: 'Unable to Load Communication Module'

 Article Number: Q95612

 CREATED: 17-FEB-1993

 MODIFIED: 29-APR-1993

Summary:

SYMPTOMS

   The following error message is displayed:

      Unable to load communication module.

      Driver has not been properly installed.

      Unable to connect to data source.

CAUSE

   The error occurs because the DBNMP3.DLL file you are using may be

   old, you may have duplicate DBNMP3.DLL files on your system and the

   wrong one is being used, or the DBNMP3.DLL file you are using may

   be damaged or corrupted.

   This error can also be caused by an incorrect [SQLSERVER] entry in

   your WIN.INI file. This entry should look like:

      [SQLSERVER]

      MY_SERVER=DBNMP3,\\MY_SERVER\PIPE\SQL\QUERY

   If there are any spaces in the above entry, or if DBNMP3 is

   misspelled, you will receive the error.

RESOLUTION

   The DBNMP3.DLL file installed by Microsoft Access version 1.0 is

   dated 9/15/92, has a size of 8241 bytes, and should be installed in

   the \WINDOWS\SYSTEM directory.

More Information:

It is possible that there are other situations that may indirectly

cause the above error message to display. To  troubleshoot this

problem, do the following:

 - Use File Manager to search for multiple, corrupted, or outdated

   copies of these files:

      Filename     Date              Size

      -----------------------------------

      ODBC.DLL     10/16/92 or later (44736 bytes)

      SQLSRVR.DLL  10/16/92 or later (135792 bytes)

      NETAPI.DLL   depends on the network being used

      COMMDLG.DLL  10/25/92 or later (89248 bytes)

      Note: The sizes and dates referenced are correct if the files

      are installed by Access version 1.0.

 - Make sure the files listed above are in their appropriate

   locations. All of the files except NETAPI.DLL are usually installed

   in the Windows \SYSTEM subdirectory. The NETAPI.DLL file is a

   network specific driver and is usually located in the network's

   program directory, which should be in the path.

 - Use another application, such as Q+E, SAF, or PowerBuilder, on the

   same machine to attempt to attach to the same data source. If you

   cannot access the data source from another application, then it is

   probably a problem with the network, such as NETAPI.DLL, or a

   problem with the server, not with Microsoft Access or ODBC.

 - Attempt to attach to another data source, if available, such as

   another SQL server. If you can attach to another server, then the

   original server may be down or you may need to reconfigure the entry

   for that server using the ODBC Administration Utility.

 - Attempt to attach to the same data source from another machine. If

   you can't access the SQL server from another machine, it may

   indicate a network-wide problem or that the server is down or not

   communicating.

 - Try increasing your ODBC timeout settings in the ODBC section of

   the MSACCESS.INI file.

 - Check with the system administrator to see if the SQL server is up,

   available for transactions, and operating properly.

 - Reinstall ODBC after performing a clean boot and renaming the

   ODBC.DLL, DBNMP3.DLL, and SQLSRVR.DLL files.

Reference(s):

Microsoft Access "User's Guide," version 1.0, pages 660-662

References


PRB: Open Object Can Be Deleted by Another User

 Article Number: Q95638

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 11001

SYMPTOMS

   While one user has a form or report object open another user can

   delete the object with no warning.

CAUSE

   Microsoft Access does not have a record-level locking mechanism for

   objects, therefore there is no way to prevent a user on one

   workstation from deleting an open object on another workstation.

   This problem does not occur with tables that have been opened

   exclusively.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

Use a shared database on two machines (A and B).

1. On machine A, open Formx for design.

2. On machine B, delete Formx.

Formx is deleted with no warning.

References


PRB: Design View Edit Menu Commands Dimmed

 Article Number: Q95639

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The Edit menu in Design view dims Clipboard items when you use

   CTRL+mouse click for selecting objects that should be available.

CAUSE

   A mouse click and drag creates a contiguous selection. However,

   CTRL+mouse click creates a discontiguous selection. The Cut, Copy,

   and Delete commands will not work on discontiguous selections, even

   if the objects selected are contiguous.

RESOLUTION

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open a Table in Design view.

2. Select several columns by clicking and dragging the mouse.

3. In the Edit menu, notice that the Cut, Copy, and Delete commands

   are available.

4. Close the Edit menu.

5. Select the same columns by clicking the row selectors while

   holding down the CTRL key.

6. Look at the Edit menu again. All the Clipboard commands are

   now dimmed.

References


INF: Converting Currency or Number Values into English Words

 Article Number: Q95640

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

By using four functions you can convert a currency or other numeric value

into its equivalent in English words. For example, you can change 24.50

into the following text: Twenty Four DOLLARS and Fifty CENTS.

To understand this article, you need to be familiar with Access Basic and

know how to create and use Access Basic procedures. Note that none of the

words in the result are hyphenated. That is, the result shows Twenty Four,

not Twenty-Four. Revise the code if hyphenation is important to you.

More Information:

The following code creates four functions: NumToWord(), GetWord(),

GetTens(), and GetDigit():

' Note: Enter each command on a single line. The underscore (_) on

' the end of some lines is a line continuation character. It's there

' to improve readability. When you enter the line, omit the underscore

' and combine all continued lines into a single line.

'****************************************************************

'Declarations section of the module

'****************************************************************

   Option Explicit

'================================================================

'*** This is the main function call

'================================================================

   Function NumToWord(NumVal)

      Dim NTW, NText, Dollars, Cents, NWord, TotalCents As String

      DIM DecPlace, TotalSets, Cnt, LDollHold As Integer

      ReDim NumParts(9) As String   'Array for Amount (sets of three)

      ReDim Place(9) As String      'Array containing place holders

      Dim LDoll As Integer          'Length of the Dollars Text Amount

      Place(2) = " Thousand "       '

      Place(3) = " Million "        'Place holder names for money

      Place(4) = " Billion "        'amounts

      Place(5) = " Trillion "       '

      NTW = ""                      'Temp value for the function

      NText = Trim(Str(NumVal))     'String representation of amount

      DecPlace = InStr(Trim(NText), ".")'Position of decimal 0 if none

      Dollars = Trim(Left(NText, IIf(DecPlace = 0, Len(NumVal),_

                                     DecPlace - 1)))

      LDoll = Len(Dollars)

      Cents = Trim(Right(NText, IIf(DecPlace = 0, 0, Abs(DecPlace - _

                                    Len(NText)))))

      If Len(Cents) = 1 Then

         Cents = Cents & "0"

      End If

      If (LDoll Mod 3) = 0 Then

         TotalSets = (LDoll \ 3)

      Else

         TotalSets = (LDoll \ 3) + 1

      End If

      cnt = 1

      LDollHold = LDoll

      Do While LDoll > 0

         NumParts(cnt) = IIf(LDoll > 3, Right(Dollars, 3),_

                                              Trim(Dollars))

         Dollars = IIf(LDoll > 3, Left(Dollars, (IIf(LDoll < 3, 3,_

                                       LDoll)) - 3), "")

         LDoll = Len(Dollars)

         cnt = cnt + 1

      Loop

      For cnt = TotalSets To 1 Step -1     'step through NumParts array

         NWord = GetWord(NumParts(cnt))    'convert 1 element of NumParts

         NTW = NTW & NWord                 'concatenate it to temp variable

         If NWord <> "" Then NTW = NTW & Place(cnt)

      Next cnt                             'loop through

      If LDollHold > 0 Then

         NTW = NTW & " DOLLARS and "       'concatenate text

      Else

         NTW = NTW & " NO DOLLARS and "    'concatenate text

      End If

      TotalCents = gettens(Cents)          'Convert cents part to word

      If TotalCents = "" Then TotalCents = "NO"  'Concat NO if cents=0

      NTW = NTW & TotalCents & " CENTS"    'Concat Dollars and Cents

      NumToWord = NTW                      'Assign word value to function

   End Function    'End NumToWord function, Return to calling program

'=================================================================

' The following function converts a number from 0 to 999 to text

'=================================================================

   Function GetWord (NumText)

      Dim GW As String, x As Integer

      GW = ""                       'null out temporary function value

      If Val(NumText) > 0 Then

         For x = 1 To Len(NumText)  'loop the length of NumText times

            Select Case Len(NumText)

               Case 3:

                  If Val(NumText) > 99 Then

                     GW = GetDigit(Left(NumText, 1)) & " Hundred "

                  End If

                  NumText = Right(NumText, 2)

               Case 2:

                  GW = GW & GetTens(NumText)

                  NumText = ""

               Case 1:

                  GW = GetDigit(NumText)

               Case Else

            End Select

         Next x

      End If

      GetWord = GW  'assign function return value

   End Function     'End function GetWord - Return to calling program

 '================================================================

 ' The following function converts a number from 10 to 99 to text

 '================================================================

   Function GetTens (TensText)

      Dim GT As String

      GT = ""           'null out the temporary function value

      If Val(Left(TensText, 1)) = 1 Then   ' If value between 10-19

         Select Case Val(TensText)

            Case 10: GT = "Ten"            '

            Case 11: GT = "Eleven"         '

            Case 12: GT = "Twelve"         '

            Case 13: GT = "Thirteen"       ' Retrieve numeric word

            Case 14: GT = "Fourteen"       ' value if between ten and

            Case 15: GT = "Fifteen"        ' nineteen inclusive.

            Case 16: GT = "Sixteen"        '

            Case 17: GT = "Seventeen"      '

            Case 18: GT = "Eighteen"       '

            Case 19: GT = "Nineteen"       '

            Case Else

         End Select

      Else                                 ' If value between 20-99

         Select Case Val(Left(TensText, 1))

            Case 2: GT = "Twenty "         '

            Case 3: GT = "Thirty "         '

            Case 4: GT = "Forty "          '

            Case 5: GT = "Fifty "          ' Retrieve value if it is

            Case 6: GT = "Sixty "          ' divisible by ten

            Case 7: GT = "Seventy "        ' excluding the value ten.

            Case 8: GT = "Eighty "         '

            Case 9: GT = "Ninety "         '

            Case Else

         End Select

         GT = GT & GetDigit(Right(TensText, 1))  'Retrieve ones place

      End If

      GetTens = GT                     ' Assign function return value.

   End Function   'End function GetTens - return to calling program

 '================================================================

 ' The following function converts a number from 1 to 9 to text

 '================================================================

   Function GetDigit (Digit)

      Select Case Val(Digit)

         Case 1: GetDigit = "One"      '

         Case 2: GetDigit = "Two"      '

         Case 3: GetDigit = "Three"    '

         Case 4: GetDigit = "Four"     ' Assign a numeric word value

         Case 5: GetDigit = "Five"     ' based on a single digit.

         Case 6: GetDigit = "Six"      '

         Case 7: GetDigit = "Seven"    '

         Case 8: GetDigit = "Eight"    '

         Case 9: GetDigit = "Nine"     '

         Case Else: GetDigit = ""      '

      End Select

   End Function  'End function GetDigit - return to calling program

How to use this code

--------------------

To change a currency value into English words, call the NumToWord()

function giving the number as the argument. NumToWord() calls the other

functions as needed and returns the result in English words.

There are two ways to call the NumToWord function. You can call it in

Access Basic code as follows:

   Amount = 24.50

   WordValue = NumToWord(Amount)

Or you can call NumToWord() as a parameter in a SetValue action in a macro.

For example, set Amount to 24.50 and use the following in a SetValue

action in a macro:

   NumToWord(Amount)

References


PRB: Access Toolbox Selection Lost When Closed

 Article Number: Q95641

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 2682

SYMPTOMS

   The toolbox will not retain your selection when it is closed and

   then reopened.

CAUSE

   This behavior is by design.

RESOLUTION

   The toolbox will always be reset to the pointer when you reopen it.

   If you want your selection to be saved, choose the Lock button at

   the bottom of the toolbox.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open a form in Design view.

2. From the View menu, choose Toolbox.

3. Select an item on the toolbox other than the pointer.

4. From the View menu, choose Toolbox (this will close the toolbox).

   The mouse cursor still reflects the current tool selection as

   expected.

5. From the View menu, choose Toolbox to reopen the toolbox. The

   pointer will have the focus again.

References


INF: SHIFT+ENTER Key Combination vs. CTRL+ENTER

 Article Number: Q95642

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

To insert more than one line in a label, field, or zoom box, use the

CTRL+ENTER key combination.

The Microsoft Access "User's Guide" states on page 222 that in order

to add more lines to a label, you should use the SHIFT+ENTER key

combination. You can use this; however, CTRL+ENTER will also work  and

can be used to add more lines to text boxes and zoom boxes as well.

The SHIFT+ENTER key combination will not work with zoom boxes or text

boxes to add more lines. The SHIFT+ENTER key combination also has

other uses with Microsoft Access. For example, if you are performing

data entry, SHIFT+ENTER saves changes to the current record. The

CTRL+ENTER key combination is consistent throughout the program.

You can design a memo or text field so that the ENTER key alone

creates a new line. For more information, query on the following words

in the Microsoft Knowledge Base:

   enter and getkeystate

Reference(s):

Microsoft Access "User's Guide," version 1.0, page 222

References


INF: Row Fix-up in the NWIND.MDB Order Form

 Article Number: Q95643

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

Row fix-up is a technique that Microsoft Access does automatically.

Microsoft Access uses row fix-up to update (fix up) the records in queries

and forms automatically using links between tables. By taking advantage of

row fix-up in a query or form, you can enter a single value, and Microsoft

Access will automatically look up and display other values for that record.

You can take advantage of row fix-up to update forms and queries without

using macros or Access Basic code. This article shows by example how to

set up row fix-up. The Orders form in the sample NWIND.MDB database is the

example presented. While reading this article, you may find it helpful to

refer to the "Microsoft Access User's Guide" and have the NWIND.MDB

database open.

More Information:

This article is based on the NWIND.MDB database. Use the following to help

clarify the points being explained:

1. Refer to the diagram on page 639 of the "Microsoft Access User's Guide,"

   version 1.0, Appendix B, "Northwind Traders Sample Database."

2. Open the NWIND.MDB database.

3. Open the Orders form in Form view.

4. Open the Order Information query in Design view.

5. Create a many-to-one form by using the information in the "Microsoft

   Access User's Guide," version 1.0, Chapter 10, "Creating Forms Based on

   More than One Table," pages 281-284. This gives you a second example

   showing how to use row fix-up.

6. For more information, query on the following words in the Microsoft

   Knowledge Base:

      row and fix-up

Important Points

----------------

When reading this article, keep the following in mind:

1. The RecordSource property of the Orders form is set to the Order

   Information query.

2. The Order Information query is based on three tables: Customers,

   Employees and Orders.

3. The Join properties between the tables are as follows:

                                 One To Many

                                 -----------

      a. CUSTOMERS.[customer id] -(1)--(M)-> ORDERS.[customer id]

      b. EMPLOYEES.[employee id] -(1)--(M)-> ORDERS.[employee id]

4. The Order ID field in the query grid comes from the Orders table, which

   is on the many-side of the relationship -- not from the Customers table,

   which is on the one-side of the relationship. (See 3a above)

5. The Bill To combo box is based on the Customer List query. Customer List

   has the following characteristics:

      a. The query is based on the Customers table.

      b. The query returns two columns, Company Name and Company ID.

      c. The bound column is Company ID.

      d. The visible column is Company Name.

6. Microsoft Access select queries are updatable. This means that when

   you make a change to a query's dynaset, Microsoft Access can update the

   source tables with your changes. For more information on this, search

   for "updating underlying tables," then "When is Query Updatable" using

   the Microsoft Access Help menu.

Explanation of Row Fix-Up in the Orders Form

--------------------------------------------

The Bill To combo box presents you with a list of company names that come

from the visible column of Customer List query. (See point 5 above.)

When you make a selection, the combo box stores the bound column -- the

Company ID field from the Customer List query -- in the Customer ID field

in the Orders table. (See points 4 and 5d above.) It is important to note

that the selection was stored in the many-side table. (See point 3a above.

After the combo box updates the Customer ID field in the Orders table (the

many-side table), the field is changed, so it no longer points to the same

record in the Customers table (the one-side table). See point 6 above. Note

that the Orders table is updated because the query's dynaset was changed.

Microsoft Access recognizes that the relationship no longer matches, so it

automatically updates the relationship by linking the changed record in the

Orders table with the appropriate record in the Customers table.

All the fields in the Orders form that come from the Customers table (the

one-side table) are updated to show the values in record for the newly

formed link.

Example

-------

When you make a change to the Bill To combo box, Microsoft Access uses row

fix-up to update the following list of fields on the Orders form:

   1. [Address]

   2. [City]

   3. [Region]

   4. [Postal Code]

   5. [Country]

The following list of fields on the Orders form are not updated by Row

fix-up. However they are updated by the Orders.Fill In Ship To macro on the

AfterUpdate property of the Bill To combo box.

   1. [Ship Name]

   2. [Ship Address]

   3. [Ship City]

   4. [Ship Region]

   5. [Ship Postal]

   6. [Ship Country]

References


PRB: Form Handle Not Released When Closed with Basic Code

 Article Number: Q95644

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   After closing a form (using the Close macro action) that was opened

   through Access Basic code, the file handle for the table that the

   form is based on is not released. Because the file handle is not

   released, no functions that require exlcusive use on that table can

   be executed (for example, deleting the table). When a function that

   needs exclusive use of that table is executed, the following error

   will occur:

      Couldn't lock table '{tablename}'; currently in use.

CAUSE

   This is by design. You are not guaranteed that the user interface

   (UI) will be synchronized with the underlying Microsoft Access code

   in some cases. In this case, the record locking is done behind the

   scenes. Microsoft Access releases the table when it hits its idle

   loop (that is, the UI optimization).

RESOLUTION

   After the form is opened in Access Basic code, insert a DoEvents

   command before the function that needs exclusive use of the table,

   to cause Microsoft Access to yield execution to the operating

   system, so that it can process events. When the DoEvents command

   occurs it allows Jet to process the pending unlock sequence.

More Information:

Steps to Reproduce Problem

--------------------------

1. Open the sample database Northwind Traders (NWIND.MDB). Create a

   module and enter the following code:

      '*************************************************************

      'Declarations section of the module.

      '*************************************************************

      Option Explicit

      '================================================================

      ' Create and save the following TempCust() function in the Module

      '================================================================

      Function TempCust()

         DoCmd SelectObject a_table, "Customers", True

         DoCmd CopyObject , "Cust2"

         DoCmd OpenForm "Customers", a_normal, "", "", a_edit, a_dialog

         '**** This is where the DoEvents should be inserted to fix ****

         DoCmd SelectObject a_table, "Cust2", True

         DoCmd DoMenuItem 1, 1, 4

      End Function

2. Open the Customers form in Design view, and change the RecordSource

   property to "Cust2."

3. Create a command button on the Customers form and make the

   following changes to its properties:

      Object: Command Button

      ----------------------

         ControlName: Close Form

         Caption: Close Form

         OnPush: ExitForm

4. Save the modified Customers form.

5. Create and save the following macro:

      Macro Name      Action       Argument

      -------------------------------------

      ExitForm        RunCode      TempCust()

6. From the Database container, run the ExitForm macro that was

   created in step 4.

You will receive the error after the dialog box appears verifying that

you want to delete object Cust2.

References


PRB: No AutoRepeat with GoToRecord/Next and DoMenuItem

 Article Number: Q95645

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 2368

SYMPTOMS

   The AutoRepeat property for command buttons does not work in

   conjunction with the GoToRecord/Next macro action for moving to

   successive records on a form. In other words, if your form uses

   command buttons instead of the record selector buttons to move

   from record to record, the AutoRepeat property does not repeatedly

   execute a macro that performs a GoToRecord/Next action.

   Also, the AutoRepeat property fails under the same circumstances

   when using the DoMenuItem/Form/Records/GoTo/Next macro action. To

   re-execute the macro, you must click the command button again.

CAUSE

   This is correct behavior for these macro actions. Here are two

   points that need clarification before the cause can be explained:

   1. OnPush property: The macro under the OnPush property of a

      command button normally won't execute until you push and let up

      the command button with the mouse pointer in the Command

      Button's region. The exception is when the command button's

      AutoRepeat property is set to Yes. In this case, the macro under

      the OnPush property of the command button executes when the

      button is pushed and the mouse pointer is in the Command

      Button's region.

   2. Focus: Several macro actions change the focus. For example,

      GoToControl, GoToRecord, OpenForm, OpenTable, and ApplyFilter all

      change the focus.

   Therefore, if a command button's OnPush property macro changes

   the focus to, for example, the next record, then the command

   button has lost the focus. That is, when you click the command

   button, the click doesn't apply to that command button anymore

   because the focus changed. It's as if you had moved the mouse

   pointer off the command button while pressing the mouse button,

   as if the command button moved out from under the mouse pointer

   right before you pressed the mouse button.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access.

2. Open the sample NWIND.MDB database.

3. Create a new macro with two actions (OpenTable and GoToRecord). Use

   the following as a guide to assign action arguments to each action:

   OpenTable

   -------------------------

      Table Name:   Categories

      View:         Datasheet

      Data Mode:    Edit

   GoToRecord

   -------------------------

      Object Type:  Table

      Object Name:  Categories

      Record:       Next

4. Close, save, and name the macro.

5. Open a new form and click the Blank Form button.

6. Drag the macro you just created onto the blank form to create a

   command button.

7. Set the AutoRepeat property of the command button to Yes. Notice

   the command button's OnPush property is set to the name of the

   macro.

8. Change to Form view to browse the form. As a result, you should see

   a single command button on the form.

9. Click the command button. Now you should see the Categories table.

10. Size the Categories table so that both the form and the table fit on

    the screen and you can see the VCR button on the table.

Each time you click the command button, the record selector moves to

the next record. When you click and hold down the command button, you

would expect Microsoft Access to scroll rapidly to the last record in

the table, but this doesn't happen. Instead, the record selector moves

to the next record only, regardless of the AutoRepeat property setting

of the command button.

However, if you place a macro that uses a different macro action such as

Beep on the form, the AutoRepeat action works as expected. This is because

Beep does not change the focus.

References


PRB: Setup Program STFSETUP.EXE Causes GP Fault

 Article Number: Q95646

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

Issue ID: 2407

SYMPTOMS

   The Microsoft Access Setup program displays the following error

   message immediately after trying to update an old version of the

   Windows help file (WINHELP.HLP):

      General Protection Fault (GPF) in STFSETUP.EXE

CAUSE

   The current WINHELP.HLP or WINHELP.EXE files in the Windows directory

   are corrupt. These corrupt files cause a general protection (GP) fault

   when you run the Microsoft Access Setup program to update the help file.

RESOLUTION

   Rename the WINHELP.EXE and WINHELP.HLP files in the Windows directory.

   Then reinstall Microsoft Access. The Setup program will write new help

   files and place them in the Windows directory.

References


INF: How to Play .WAV Sounds on Events in Microsoft Access

 Article Number: Q95647

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access does not have a built in function to play sound files

on events, such as when a form is opened or closed. However, you can

use the Microsoft Windows 3.1 application program interface (API)

through Access Basic code to create a user-defined function to play

sound files.

This article assumes you are familiar with Access Basic and Windows

APIs. In this article, the use of error trapping has been omitted to

keep the information as clear and concise as possible.

More Information:

Follow these steps to create a user-defined function to play sound

files:

1. Create a new module with a single function named PlaySound().

   Note: In the following sample code, an underscore (_) is used as

   a line-continuation character. Remove the underscore when

   re-creating this code in Access Basic.

'*****************************************************************

'Declarations section of the module.

'*****************************************************************

Option Explicit

Declare Function sndplaysound% Lib "mmsystem" (ByVal filename$,_

                                               ByVal snd_async%)

'==================================================================

' The following function PlaySound calls the Windows API function

'==================================================================

   Function PlaySound (msound)

      XX% = sndplaysound(msound, 1)' play mmwave sound

      If XX% = 0 Then MsgBox "The Sound Did Not Play!"

   End Function

2. Save the module as "Play It Sam."

   The following steps use a command button to trigger the sound, but

   you can use other events to trigger the sound.

3. Add a command button to a form you want to play the sound from.

   Object: Command Button

   ----------------------

   ControlName: Push_Button_1

   Caption:  Play Chimes

   OnPush: =PlaySound("C:\WINDOWS\CHIMES.WAV")

   (Where C:\WINDOWS\ is the location of the sound file and CHIMES.WAV

   is the sound file.)

When the form is open in Form view, the sound is ready to play by

clicking the command button. You can assign this function to the

form's OnOpen event if you want chimes to play when you open a form.

Note: This example does not have error trapping. Unexpected results

may occur if the sound file is not in the location specified or does

not exist!

Reference(s):

"Microsoft Access Basic: An Introduction to Programming," Chapters 1-5

"Microsoft Windows Software Development Kit," Microsoft Press, 1992

"Programming Windows: the Microsoft Guide to Writing Applications for

Windows 3", Charles Petzold. Microsoft Press, 1990

"Programmer's Reference Library: Microsoft Windows 3.1 Guide to

Programming Reference," Volumes 1 - 6, Microsoft Press, 1992

References


INF: Detailed Explanation of the KeepTogether Property

 Article Number: Q95648

 CREATED: 18-FEB-1993

 MODIFIED: 22-APR-1993

Summary:

Form and report sections have a KeepTogether property that you can set

to Yes or No. The KeepTogether property setting determines whether

Microsoft Access prints the controls located in that section on a

single page or on more than one page.

The section's KeepTogether property affects the controls located in

that section, for a single record.

More Information:

If the KeepTogether property is set to yes, Microsoft Access begins

printing the controls located in that section at the top of the next

page if it can't print all of the controls on the current page. If it

is set to no, Microsoft Access prints as many controls as it can on

the current page and continues printing them on the next page.

If all the controls in a section require more than one page for a

single record, Microsoft Access continues printing on a second page

regardless of the KeepTogether setting.

For example, say the detail section of a report has its KeepTogether

property set to Yes and all the controls in that section won't fit on

the current printed page. In this case, Microsoft Access prints none

of the controls on the current page. Instead, it begins printing the

controls at the top of the next page. If it turns out the section

requires more than a single page, Microsoft Access ignores the

KeepTogether property value and continues printing the controls at the

top of the next page.

The KeepTogether property affects the controls in a form or report

section for a single record -- not groups of records. The KeepTogether

property won't keep all the grouped records together, and it will not

avoid the problem of abandoned group headers left on the bottom of a

printed page.

Several other articles can help you learn how to create a label that

will print at the top of each report page when a group of records span

more than one page. To find these articles, query on the following

words here in the Microsoft Knowledge Base:

   Access and continued and new and page

Reference(s):

For information on programatically controlling section printing, see

the "Microsoft Access Language Reference," version 1.0, "MoveLayout,

NextRecord, PrintSection Properties" section, pages 313-314.

References


PRB: Short Label Autosizes to Cursor Size

 Article Number: Q95649

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When in Design view you create a new label on a form and the label

   height is shorter than the cursor size, the control will autosize

   to the height of the cursor.

STATUS

   The autosizing of the cursor in a label to a default height is by

   design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new database.

2. Create a new form.

3. Open the form in Design view.

4. Place a label on the form and size it to a height smaller than the

   height of the cursor.

5. Place the cursor in the text box to enter text.

   The control will resize larger to the height of the cursor.

References


INF: Insert Object from File Dialog Missing 'All Files (*.*)'

 Article Number: Q95650

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

The List Files of Type combo box contained in the Insert Object from

File dialog box does not have an option to list "All Files (*.*)". It

is therefore impossible to choose a file from a list of all files. A

list of file types supported by registered OLE servers will be

displayed.

More Information:

The Insert Object from File dialog box is displayed when you choose

the Insert Object command from the Edit menu. As a result, the List

Files of Type combo box only displays extensions registered for valid

OLE servers. It should only be used for inserting OLE objects.

Steps to Reproduce Behavior

---------------------------

1. Open a table with an OLE field.

2. Add a new record.

3. Select the OLE field, then choose Insert Object from the Edit menu.

4. Choose the File button in the Insert Object dialog box.

5. The Insert Object from File dialog opens with a combo box titled

   "List Files of Type." A choice for "All Files (*.*)" is not

   included.

References


PRB: Edit Find Dialog Is Modal in Form View

 Article Number: Q95651

 CREATED: 18-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you are in the Edit Find dialog box in Microsoft Access, you

   cannot switch focus back to the form. The Edit Find dialog must be

   cleared before you can continue working with the form.

CAUSE

   The Edit Find dialog is modal. When you open a modal form, you

   can't access any other Microsoft Access objects until you close or

   hide the form.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open a database.

2. Open a form with an editable field (for example, a text box) in

   Form view.

3. From the Edit menu, choose Find.

At this point you will be unable to shift focus back to the form. You

must choose the Close button in the Edit Find dialog box.

References


PRB: Unfreeze All Columns Does Not Restore Column Order

 Article Number: Q95805

 CREATED: 25-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you open a database and view a form in Datasheet view then

   choose Freeze Columns from the Layout menu, the column you select

   will be moved to the far left and separated by a bold black bar, as

   expected. However, if you then choose Unfreeze All Columns from the

   Layout menu, the order of the columns will not be restored.

CAUSE

   Frozen columns are moved to the "frozen" area. They are not put

   back in their original position because many other things could

   have been changed because the column was originally frozen.

STATUS

   This behavior is by design.

References


INF: How to Skip Used Mailing Labels and Print Duplicates

 Article Number: Q95806

 CREATED: 25-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

This article describes how to print multiple copies of the same mailing

label, and how to use a partially used page where only some of the labels

are available.

To make use of this article, you need to be familiar with Access Basic and

know how to design Microsoft Access reports.

More Information:

Printing Multiple Copies of the Same Label

------------------------------------------

When you choose Print from the File menu, you can choose to print multiple

copies of the same report. But when you try to print a single mailing label

20 times, Microsoft Access prints one label on each of 20 pages.

On a dot matrix printer, using single column labels, you can work around

this problem by defining each label as a separate page. However, you can't

use this method for laser printers or multiple-column labels. To solve this

problem, use the step-by-step procedure described below.

Using Labels that Would Otherwise Be Wasted

-------------------------------------------

After printing labels, you usually end up with a partially used last page.

There is no built-in mechanism in Microsoft Access to use the remaining

labels on a partially used page. Microsoft Access always starts on a new

page. On a dot matrix printer, you can adjust the top of form manually. But

you can't do that on laser printers. To solve this problem, use the

step-by-step procedure described below.

Step-by-Step Procedure to Solve Both Problems

---------------------------------------------

The Microsoft Access report generator provides powerful hooks that allow

control over the finished product. By calling a function from the OnFormat

property of the report's detail section, you can alter the MoveLayout,

NextRecord, and PrintSection properties to leave blank spaces or print

multiple copies on the same page.

The code listed below is generic. You can attach it to any Mailing Label

report to print multiple copies and to skip used labels if needed. To use

the example, you need to have a mailing label report called MyLabels.

1. Create a new module, and place the following lines in the declaration

   section:

'*********************************************************

   'Declarations section of the module.

'**********************************************************

Option Compare Database

Option Explicit

Dim LabelBlanks&

Dim LabelCopies&

Dim BlankCount&

Dim CopyCount&

'==========================================================

   ' The following function will cause an inputbox to

   ' display when the report is run that prompts the user

   ' for the number of used labels to skip and how many

   ' copies of each label should be printed.

'===========================================================

Function LabelSetup ()

   LabelBlanks& = Val(InputBox$("Enter Number of blank labels to skip"))

   LabelCopies& = Val(InputBox$("Enter Number of Copies to Print"))

   If LabelBlanks& < 0 Then LabelBlanks& = 0

   If LabelCopies& < 1 Then LabelCopies& = 1

End Function

'===========================================================

   ' The following function sets the variables to a zero

'===========================================================

Function LabelInitialize ()

   BlankCount& = 0

   CopyCount& = 0

End Function

'===========================================================

   ' The following function is the main part of this code

   ' that allows the labels to print as the user desires.

'===========================================================

Function LabelLayout (R As Report)

   If BlankCount& < LabelBlanks& Then

      R.NextRecord = False

      R.PrintSection = False

      BlankCount& = BlankCount& + 1

   Else

      If CopyCount& < (LabelCopies& - 1) Then

         R.NextRecord = False

         CopyCount& = CopyCount& + 1

      Else

         CopyCount& = 0

      End If

   End If

End Function

2. Open the report named MyLabels in Design view and add the following line

   to OnFormat property of the Detail section:

      OnFormat: =LabelLayout(Reports![MyLabels])

3. Add the following line to the OnOpen property of the MyLabels Report:

      OnOpen: =LabelSetup()

4. Although typically labels do not have a report header, choose Report

   Hdr/Ftr from the Layout menu to add a report header and footer. Then Add

   the following line to the OnFormat property of the report header:

      OnFormat: =LabelInitialize()

5. Set the Height property for both the report header and report footer

   to 0.

When you print the report, the report calls the LabelSetup() function,

which first asks you to enter the number of used labels to skip on the

first page (BlankCount) and then asks how many of each label you want

printed (CopyCount).

When the report header is formatted, it calls the LabelInitialize()

function, so when you switch from preview to print, the BlankCount and

CopyCount fields are set to zero. As each label is formatted, the

LabelLayout() function adjusts the NextRecord and MoveLayout properties

to skip used labels and print the desired duplicates.

Reference(s):

"Microsoft Access Language Reference," version 1.0, page 313,

"MoveLayout, NextRecord, PrintSection Properties" section.

References


INF: Checking for Last Or First Record in a Macro

 Article Number: Q95807

 CREATED: 25-FEB-1993

 MODIFIED: 21-APR-1993

Summary:

In a macro, you can't check the result of an action just performed. As a

result, you can run into a problem when using a macro to move to the next

record or the previous record. There is no record previous to the first

record and no next record following the last record. If you attempt to go

to the previous or last record when there is none, Microsoft Access

displays error messages that may confuse users of a custom application.

More Information:

You can work around this on a form by using Access Basic functions to move

from record to record. For example, use the following custom MoveToNext()

function to move to the next record or previous record on a form:

   Option Explicit

   Function MoveToNext (DisplayMsg$, MoveForward%)

      Dim MyDyna As Dynaset

      Set MyDyna = Screen.ActiveForm.Dynaset

      MyDyna.Bookmark = Screen.ActiveForm.Bookmark

      If MoveForward% Then

         MyDyna.MoveNext

      Else

         MyDyna.MovePrevious

      End If

      If MyDyna.EOF Or MyDyna.BOF Then

         MsgBox DisplayMsg$

      Else

         Screen.ActiveForm.Bookmark = MyDyna.Bookmark

      End If

   End Function

To use the MoveToNext function, specify the following:

 - Name of the function.

 - Message you want displayed if the current record is at the end or the

   beginning of the record set.

 - 'True' if you want to move to the next record. 'False' if you want to

   move to the previous record.

Here's an example:

   OnPush: =MoveToNext("You are at the end of the record set", True)

References


PRB: Error Occurs in Print Preview Without Driver

 Article Number: Q95901

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You may receive the following error message when choosing Print

   Preview with a form selected:

      An error occurred while attempting to retrieve printer

      information for the (printer name) on (printer port).

CAUSE

   The error occurs because the form was created with a specific

   printer driver and that printer driver no longer exists in the

   system.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new form.

2. Before saving the form, choose Print Setup from the File menu, and

   set Specific Printer to something other than default.

3. Close and save the form as Test Form.

4. Open Windows File Manager.

5. Locate the driver for the specific printer you selected in Print

   Setup (drivers are usually located in the \WINDOWS\SYSTEM

   subdirectory).

6. Select the driver and temporarily rename the file.

7. Select Test Form in the Database window.

8. From the File menu, choose Print Preview.

An error message about the missing printer driver will be displayed.

The problem is that normally COMMDLG.DLL performs a test to determine

if you have an incorrect printer. When you choose Print Preview, you

do not go through COMMDLG.DLL. If, on the other hand, you choose File

Print you will get the more descriptive error message produced by

COMMDLG.DLL:

   An error occurred while attempting to retrieve printer information

   for the (printer name) on (printer port).

References


PRB: Two Accelerator Keys in Custom Menu Only Show First Key

 Article Number: Q95902

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you create a custom menu, if you define two accelerator keys

   in the MacroName grid, the drop-down menu will show the second one

   as the accelerator, but the first one will actually run the macro

   action.

CAUSE

   This behavior is a function of Windows. Microsoft Access does not

   do syntax checking on menu strings, so if Windows receives a menu

   string with extra accelerators, the above symptoms will result.

RESOLUTION

   Only define one accelerator key for a menu item.

More Information:

Steps to Reproduce Behavior

--------------------------

1. In the sample database Northwind Traders (NWIND.MDB), create a new

   macro called MyMenu with one following action:

      Macro Name      Action    Argument

      ----------------------------------

      D&o &This       MsgBox    Message: Any text message here

2. Open the Orders macro, and create a new macro name called OnMenu

   with one action:

      Macro Name      Action

      ----------------------

      OnMenu          AddMenu

      Add Menu Actions

      -------------------

      Menu Name:   &File

      Menu Macro:  MyMenu

3. Open the Orders form. Attach the macro "Orders.OnMenu" macro to the

   OnMenu property of the form.

4. Close the Orders form, save it, and reopen it.

5. Press ALT+F to drop the custom File menu. Note that the "T" in "Do

   This" is shown as the accelerator key.

6. Press the T key. Notice that nothing happens.

7. Press the O key.

   The message box will be displayed.

Reference(s):

References


INF: Filling a Multiple-Column List Box by Using Access Basic

 Article Number: Q95903

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

You can use Access Basic to fill in the information for a list box or

a combo box. On page 82-85 of the "Microsoft Access Introduction to

Programming" manual, an example is given on how to fill in a

single-column list box. You can also use Access Basic to fill in a

multiple-column list box or combo box.

More Information:

To create a multiple-column list box, you must set Code 4 in the

Select Case statement to the number of columns that you want in your

list box. In Code 6 of the Select Case statement, define the data that

will display in each column and row of the list box. The following

code is based on the example on page 84 of the "Microsoft Access

Introduction to Programming" manual:

'*********************************************************************

'Declarations section of the module

'*********************************************************************

Option Explicit

'=====================================================================

'The following function uses a select case statement to fill a

'two-column and four-row list box. The function fills the first column

'of the list box with the dates of the next four Mondays. The second

'column is filled with the dates of the next four Tuesdays.

'=====================================================================

Function ListMonTuesdays(fld As Control, id, row, col, code)

   Dim offset

   Select Case Code

     Case 0                          'Initialize.

       ListMonTuesdays=True

     Case 1                          'Open.

       ListMonTuesdays=id            'Unique ID number for control

     Case 3                          'Number of rows.

       ListMonTuesdays=4

     Case 4                          'Number of columns.

       ListMonTuesdays=2

     Case 5                          'Column width.

       ListMonTuesdays=-1            'Use default width.

'===============================================================

'In the next Case statement:

'

' Offset is the formula for finding the next four Mondays.

' If column=0, then fill in with the dates for the next four

' Mondays in column 1. If column=1, then fill in with the dates

' for the next four Tuesdays in column 2.

'===============================================================

     Case 6                          'Get Date

       Offset=abs((9-Weekday(Now))Mod 7)

       If col=0 then

          ListMonTuesdays=Format(Now()+offset+7*row,"mmmm d")

       Else

          Offset=abs((10-Weekday(Now))Mod 7)

          ListMonTuesdays=Format(Now()+offset+7*row,"mmmm d")

       End if

    End Select

End Function

Reference(s):

"Microsoft Access Introduction to Programming," version 1.0, pages 82-85

References


PRB: 'Couldn't Change Working Directory

 Article Number: Q95904

 CREATED: 01-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

When starting Microsoft Access, you may get the following error

message:

   Couldn't change working directory to <Default Database Directory>

   Click OK or press enter to continue.

Where  <Default Database Directory> is what appears on the

"Default Database Directory"  line in the Access Options menu.

Clicking the OK button or pressing the ENTER key will open Microsoft

Access.

CAUSE

You will get the error if:

 - The "Default Database Directory" property of the Microsoft Access

   View Menu command is not pointing to a valid path or is greater

   than 64 characters.

-or-

 -  If there is a  space before the "." on the  "Default Database Directory"

RESOLUTION

Make sure that the " Default Database Directory" path does not exceed 64

characters and if there is a "." on this line, make sure that there is no

leading space before the ".".

MORE INFORMATION

================

To check the default directory for Microsoft Access, do  the

following:

1. Start Microsoft Access and open any database.

2. From the View menu, choose Options.

3. In the Category box, select General. In the Items box, select

   Default Database Directory.

Normally after installing Microsoft Access, the default directory will

be set to ".". This period represents the Microsoft Access startup

directory as the default database directory.

References


PRACC9303: Form Record Selector Buttons Disabled

 Article Number: Q95905

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 598

SYMPTOMS

   You are unable to choose the record selector buttons in the bottom,

   left-hand corner of the form.

RESOLUTION

   You can design your own record selector buttons such as those used

   in the sample database ORDENTRY.MDB which is shipped with Microsoft

   Access.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. Microsoft is researching this problem and will post

   new information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

Steps to Reproduce Problem

--------------------------

1. Create a GotoControl macro that goes to any one of the controls on

   the form.

2. Assign the macro to the OnCurrent property of the form.

3. Open the form in Form view. The control that your macro refers to

   must be on the form.

4. From the Records menu, choose Edit Filter/Sort.

5. Use the mouse to drag any field onto the grid.

6. From the Records menu, choose Apply Filter/Sort.

7. Click the record selector buttons at the bottom of the form to see that

   these buttons are now disabled.

References


PRB: Scroll Bars Displayed for a Subform in Datasheet View

 Article Number: Q95906

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you set the ScrollBars property to Neither on a subform, the

   scroll bars may not be disabled in Datasheet view.

CAUSE

   This will happen because you have more information than will fit in

   the frame created for the subform. Thus, Microsoft Access  creates

   scroll bars so you can view all the data. If your frame is larger

   than the amount of data that will be shown in your subform, the

   scroll bars will be correctly disabled.

RESOLUTION

   Make the frame for your subform large enough to hold all the data

   that will be displayed within the datasheet.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a subform.

2. Switch the DefaultView property to Datasheet, and set ScrollBars to

   Neither.

3. Add the subform to a main form.

4. Switch to Form view.

Notice the scroll bars still exist.

References


INF: How to Get the Last Two Digits of the Year

 Article Number: Q95907

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article describes how to display only the last two digits of the

year. The expression

   =Year(Now())

will display all four digits of the current year (for example, 1993).

In order to display only the last two digits of the year (for example,

93), use the following expression:

   =Right(Str(Year(Now())),2)

The breakdown of the above expression is:

 - Year(Now()) returns the current year.

 - Str(...) converts the date to a string data type.

 - Right(...,2) returns the right two characters.

For more information, search for YEAR, RIGHT, STR, and NOW functions

using the Microsoft Access Help menu.

References


PRACC9303: SHIFT+HOME Does Not Select All the Text

 Article Number: Q95908

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 373

SYMPTOMS

   In the property sheet, when you press SHIFT+HOME, Microsoft Access

   should highlight the text to the beginning of the line but doesn't.

   This problem occurs only when there is a large amount of text in the

   property. The same problem can occur with SHIFT+END.

CAUSE

   The HOME and END keys do not work correctly with more than 20 inches

   of text in a text box or property box.

RESOLUTION

   To work around the problem, press CTRL+SHIFT+HOME or CTRL+SHIFT+END.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

Steps to Reproduce Problem

--------------------------

1. Type a large amount of text into the ControlSource property of

   a text box control.

2. Press SHIFT+HOME to highlight all the text to the beginning of the line.

3. Press SHIFT+LEFT ARROW, and note that more text can be highlighted.

References


PRB: Error Message: Couldn't Find Input Table or Query

 Article Number: Q95909

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you run a query, the following error message is displayed:

      Couldn't find input table or query '[Object name]'

   When you open the query in Design view, the Field list is empty.

CAUSE

   The query includes a deleted table or query.

RESOLUTION

   Modify the query so that it contains tables or fields that do exist.

   This behavior is by design so that you can determine what was deleted,

   rather than losing your query completely. The field list for the table

   or query appears empty, but the fields from this table or query still

   appear in the QBE grid.

More Information:

The query opens in Design view only. Running the query generates the

following error message:

   Couldn't find input table or query '[Object Name]'.

Steps to Reproduce Behavior

---------------------------

1. In the sample database NWIND.MDB, create a new query based on the

   Categories table.

2. Drag several fields from the Categories field list to the QBE grid.

3. Save the Query as Query1.

4. In the Database window, delete the Categories table.

5. Open Query1 in Design view.

Note that the Categories field list is empty, but all the fields from

step 2 still appear in the QBE grid.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 5, "Query

Basics"

References


PRB: Cursor Position Unchanged in Undo Paste

 Article Number: Q95910

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you choose the Edit Undo Paste command in the Module window,

   the text is deleted but the cursor does not return to its original

   position.

CAUSE

   The Undo function in Microsoft Access is very basic. It only

   remembers the changes to a line that have not been committed to a

   module. It does not maintain information on cursor position.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open the sample database Northwind Traders (NWIND.MDB).

2. Open the Introduction to Programming module. In the Procedure box,

   select ActionQuery.

3. Select any line of text within the Module window.

4. From the Edit menu, choose Copy.

5. In the Module window, place the cursor at the end of the line "Set

   db = OpenDatabase(dbName)". Choose Paste from the Edit menu.

   Note the position of the cursor (at the end of the string of text).

6. From the Edit menu, choose Undo. The text will be deleted, but the

   cursor will not return to the end of the line where you started the

   paste. It will return to the beginning of the line on which the

   paste was made.

References


INF: Calculated Fields Must Be Shown to Perform Calculations

 Article Number: Q95911

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

If you have a calculated field in a query named Field1, and you have

another field that is performing a calculation based on Field1, then

Field1 must be checked to Show in the query grid.

More Information:

The following example assumes that you have a table that contains a

field named Field1.

1. Create the following query:

      Query: QueryTest

      ----------------

      Field Name: Field1: (1+2)

         Show: False

      Field Name: Field2: (Field1 + 5)

         Show: True

2. Run the query.

The calculation in Field2 will not result in any output. The Show box

for Field1 must be checked True in order for the calculation in Field2

to be performed.

Reference(s):

Microsoft Access "User's Guide," version 1.0, Chapter 6, "Designing

Select Queries," pages 148-149

References


PRB: DDE App Name for Access Is Incorrect in Manual

 Article Number: Q95912

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You will not be able to initiate a DDE link with Microsoft Access

   if the app name is incorrectly specified as "ACCESS". An error

   message will be generated. For example, in Microsoft Word, the

   error generated is:

      The remote nwind (System) is not accessible. Do you want to start

      the application Access?

CAUSE

   On page 141 of the "Microsoft Access Basic: An Introduction to

   Programming" manual, the app name for Microsoft Access is

   incorrectly listed as Access. It should be listed as MSACCESS.

RESOLUTION

   The correct app name to use when referring to Microsoft Access in a

   DDE conversation is MSACCESS.

Reference(s):

"Microsoft Access Basic: An Introduction to Programming," version 1.0,

page 141

References


PRB: Graph Object Is Dimmed in Form View

 Article Number: Q95913

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A Microsoft Graph object appears gray in Form view.

CAUSE

   If the RowSource for a Graph object is invalid, the graph will be

   dimmed.

RESOLUTION

   This behavior is by design. To work around the problem, make the

   RowSource valid.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new unbound form.

2. From the Edit menu, choose Insert Object. In the Object Type box,

   select Microsoft Graph, then choose OK.

3. Update the graph to Microsoft Access by closing Microsoft Graph and

   choosing Yes to update Microsoft Access.

4. Change the following properties of the object frame:

      Object: Object Frame

      --------------------

      Scaling: Scale

      RowSourceType: Value List

      RowSource: Title;AAA;H1;H2;H3;1;2;3

      ColumnCount: 3

5. From the View menu, choose Form. Note that the Graph is gray.

The problem is that the RowSource contains eight values and the Column

Count is 3. To correct the Graph, add another value.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 13, "Using

Pictures, Graphs, and Other Objects," pages 327-330

References


PRB: No Arrows on Scroll Bars if Window Is Larger than Form

 Article Number: Q95914

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you create a form and set the form property sheet to allow scroll

   bars, you may not see the scroll bars when you switch to Form

   view.

CAUSE

   If the details section of a form is designed so that all the

   controls fit within the form, Microsoft Access will not display the

   scroll bars. However, the scroll bars will display if the Form

   window is sized smaller than the details section.

STATUS

   This behavior is by design.

More Information:

The purpose of the scroll arrows is to view parts of the form that are

sometimes not visible if the Form window is too small. You cannot

scroll to the next record with scroll bars, only with record

selectors.

Steps to Reproduce Behavior

---------------------------

1. Open a bound form in Design view and display the property sheet.

2. Set the DefaultView for the form to Single Form.

3. Set the Scroll Bars property to Both.

4. View the form in Form view.

5. Size the form window so that all of the controls/fields are visible.

   The scroll bars should not be visible at this point.

6. Size the form so that you cannot see all of the controls/fields.

   The scroll bars should now be visible.

References


PRB: Error Message: Must Run SETUP /A Before Running SETUP

 Article Number: Q95915

 CREATED: 01-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

When you attempt to set up a workstation for Microsoft Access using

the SETUP /N command, you receive the following error message:

   You must run SETUP /A before running SETUP /N

CAUSE

When the network server was set up, the command SETUP /A was issued

from a temporary install directory on the hard disk drive rather than

from the disks.

RESOLUTION

Run SETUP /A from the installation disks in the floppy disk drive to

set up the network server. Then you can run SETUP /N from the

workstations.

References


PRB: ErrMsg: CREATE TABLE Permission Denied in Export to SQL

 Article Number: Q95916

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you export a table from Microsoft Access to Microsoft SQL

   Server, the following error message is displayed

      [Microsoft][ODBC SQL Server Driver][SQL Server] CREATE TABLE

      permission denied, database <database>, owner <owner> [#262]

   where <database> is the database you were trying to export the table

   to and <owner> is the SQL Login ID of the owner of the database.

CAUSE

   You do not have permission to use the SQL command CREATE TABLE in

   the database you are exporting the table to.

RESOLUTION

   To correct this problem, the SQL system administrator or the owner of

   the database must grant you CREATE TABLE permission in the database

   you were trying to export the table to.

   Note: Permissions cannot be granted through Microsoft Access.

References


INF: Concatenating Fields in a Text box to Remove Blank Lines

 Article Number: Q95917

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article describes how to concatenate multiple fields for use in a

form or report. This is especially useful in a mailing label report

when some fields are null, or empty. Null fields can cause blank lines

to be printed on a report. Additionally, from a form, you may want to

be able to copy and paste an entire name and address into another

application like Microsoft Word for Windows.

Using the IIF() and the IsNull() functions, you can determine if a

field is blank. If a field is blank, it returns an "empty" value.

Chr(13) and Chr(10) are used to add a return and a line feed to the

text box.

More Information:

The following steps can be used to create a concatenated field

eliminating blank lines. In this example, the Employees Table from

the sample database Northwind Traders (NWIND.MDB) is used.

1. Create a new form or a report. Create your report based on the

   table or query where the information resides.

2. Add a text box control to the form/report.

   Note: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

   Object: Text Box

   ----------------

   ControlName:  Full Address

   ControlSource:

      =IIf (IsNull([FIRST NAME]),"",[FIRST NAME] & " ") &_

       IIf (IsNull([LAST NAME]),"",[LAST NAME]&Chr(13)&Chr(10)) &_

       IIf (IsNull([ADDRESS]),"",[ADDRESS] & Chr(13) & Chr(10)) &_

       IIf (IsNull([CITY]),"",[CITY] & ", ") &_

       IIf (IsNull([REGION]) ,"",[REGION] & " ") &_

       IIf (IsNull([POSTAL CODE]),"",[POSTAL CODE])

   Can Grow:   Yes

   Can Shrink: Yes

When the form or report is printed, there will be no blank lines.

For more information, search for "IIF," then "IsNull," then "Chr,"

then "Concatenation" using the Help menu.

References


INF: Using Access Basic to Derive a Statistical Median

 Article Number: Q95918

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article describes an Access Basic function that opens a table,

reads the data, and finds the statistical median. The median is a

measure of central tendency, another "middle" of a data set. The data

set consisting of the numbers 1, 2, 3, 6, and 100 has a median of 3,

the middle of the set. The data set consisting of the numbers 1, 2, 6,

and 10 has a median of 4, the middle of the set (2+6)/2=4.

This article assumes that you are familiar with Access Basic and how

to create and use Access Basic procedures.

More Information:

To create an Access Basic function that determines the statistical

median, open a new module or a previously created module, and enter

the following code:

Note: In the following sample code, an underscore (_) is used as

a line-continuation character. Remove the underscore when

re-creating this code in Access Basic.

'*************************************************************

'Declarations section of the module.

'*************************************************************

Option Explicit

'=============================================================

' Create the following Median() function in the Module

' The following function will initialize:

' - A variable for the database object.

' - A variable for the snapshot.

' - Sets the database object to the opened database.

' - Creates a snapshot based on the database object.

' - A variable for the record count, the for statement,

'      two field values and an offset. This function requires the

'      table name and field to be analyzed to be include as argument

'      strings.

'=============================================================

Function Median (tName$, fldName$) As Single

   Dim MedianDB As Database

   Dim ssMedian As Snapshot

   Dim RCount%, i%, x%, y%, OffSet%

   Set MedianDB = CurrentDB()

   Set ssMedian = MedianDB.CreateSnapshot("SELECT " & fldName$ & _

                     " FROM " & tName$ & " ORDER BY " & fldName$ _

                     & ";")

   ssMedian.MoveLast

   RCount% = ssMedian.RecordCount

   x% = RCount% Mod 2

   If x% <> 0 Then

      OffSet% = ((RCount% + 1) / 2) - 2

      For i% = 0 To OffSet%

         ssMedian.MovePrevious

      Next i

      Median = ssMedian(fldName$)

   Else

      OffSet% = (RCount% / 2) - 2

      For i% = 0 To OffSet%

         ssMedian.MovePrevious

      Next i

      x% = ssMedian(fldName$)

      ssMedian.MovePrevious

      y% = ssMedian(fldName$)

      Median = (x% + y%) / 2

   End If

   ssMedian.Close

   MedianDB.Close

End Function

Example of Using this Code

--------------------------

Create a form with text box controls that will reflect all measures of

central tendency of a data set. In the ControlSource property for the

text box control, enter

   =Median("TableName", "FieldName")

The value of this control will be the median of the data set. Another

way to use this function is to call it from within another function

that compares the median from different data sets. For example,

Function CompareMedians()

   Dim MyDB as Database

   .

   .

   .

   X = Median("TableName", "FieldName")

   Y = Median("TableName", "FieldName")

   If X > Y Then Debug.Print "The median for X is greatest."

End Function

Reference(s):

"Microsoft Access Basic: An Introduction to Programming," version 1.0

References


INF: Size To Fit a Label Without Using Layout Menu

 Article Number: Q95919

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

One way to resize a Label control is to use the Size To Fit command.

This command is available on the Layout menu when you are in Design

view of a form or report. This article explains how to resize a Label

control without using the menu.

More Information:

To use Size To Fit on a Label control without using the Layout menu,

first give the Label the focus by clicking the label. When a control

has the focus, the sizing handles are visible. Once it has the focus,

you can execute Size To Fit by double-clicking the left mouse button

on any of the sizing handles except the top left-most handle. This

handle is for moving the Label control. If you double-click any of the

other handles, the Label control expands or contracts to the correct

size.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 8 "Form Basics"

References


PRB: Report Prints with Blank Page Between Every Printed Page

 Article Number: Q95920

 CREATED: 01-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

When you print a report generated in Microsoft Access, a blank page

appears between every printed page of the report.

CAUSE

Blank pages are generated when a report is wider or longer than the

specified page, a condition caused by one or more of the following:

1. The total width of the form or report plus the widths of the left

   and right margins exceeds the page width (usually 8.5 inches).

2. A page size exceeds a user-defined paper size.

3. You use the Groups/Totals ReportWizard but do not select the Fit

   all fields on one page check box option. Because of this, the

   ReportWizard may have located fields or controls wider than the

   paper size selected.

4. The "Same as Detail" option has been unchecked in the Print Setup

   dialog box for Item Size.

RESOLUTION

The following resolutions correspond to each of the three possible

causes listed above:

1. Reduce the width of the form or report, reduce the left or right

   margins, or reduce all three so that the total width of the

   form or report plus the width of the margins does not exceed the

   page width. Here's the formula you want:

      (Form or Report Width)+(Left Margin)+(Right Margin)<=(Page Width)

   Use the form or report's property sheet to view or change the Width

   property. But before you reduce a form or report's width, move the

   fields and controls on it to match the new size.

   To view the left and right margin values, choose Print Setup from

   the File menu.

2. If the paper size is user-defined, Microsoft Access reads the

   defined settings specified for the printer driver. If your report

   page exceeds this user-defined paper size, unwanted blank pages are

   generated in your reports. Make sure your report page fits in the

   user-defined paper size.

   The user-defined settings are changed through the Printers utility

   found in Control Panel under the Main program group of Microsoft

   Windows Program Manager. To change the paper size, highlight the

   specific printer driver you want to change. Then choose the Setup

   button. Under Paper Size, drop down the list and select user-defined

   to trigger a dialog box to adjust the settings.

3. When using the Microsoft Access Groups/Totals ReportWizard, select

   the Fit all fields on one page check box on the last screen before

   you go into Design view or Print Preview. Once you select the Fit

   all fields on one page check box, the ReportWizard assumes an 8.5

   inch wide page and fits the fields and controls on that page

   accordingly. If the option is left unchecked, there is the

   possibility that the resulting report page (report width) will

   exceed the desired page size to produce unwanted blank pages.

4. The "Same as Detail" option available in the Print Setup dialog

   under Item Size is useful when creating a multiple detail columns

   report and you want the detail section to be a different size then

   the grouping or page sections of the report.  Unchecking this option

   can cause blank pages when the detail sections width is defined

   greater than the page size specified.

5.  The "Same as Detail" option for Item Size in Print Setup is checked

    by default with the Width set to the Width property of the report.

STATUS

This behavior is by design.

References


INF: How to Change Default Template for Forms and Reports

 Article Number: Q95922

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access uses a template to define the characteristics of new

forms and reports when AccessWizards are not used. The template

contains information about the default properties for the sections and

controls the new form (or report) will contain. There is a Normal Form

template and a Normal Report template. The defaults used in these

templates can be changed by defining new templates or modifying the

Normal templates.

More Information:

Information that is included in the Normal templates used by Microsoft

Access are things such as:

 - Default section dimensions

 - Default control properties

 - Whether to include page headers/footers in new reports or forms

To change the default settings, either modify a report and/or form and

save it as Normal, or define a different template name the system

should use.

Note that the name you enter as the form template or report template

must actually exist in your database. The SYSTEM.MDA file retains the

name of the form and report templates you define.

To change the form template or report template, do the following:

1. From the View menu, choose Options (you must have a database open).

2. In the Category list, select Form & Report Design.

3. In the Items box, select Form Template (or Report Template).

4. Type the name of a form (or report).

In order to use your templates with another database, you must copy or

export the templates to the other database.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 267-268 (forms)

and pages 446-447 (reports)

References


INF: Making a Subform Uneditable and Unenterable

 Article Number: Q95923

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

If a subform is uneditable, a user cannot make any changes to the

subform. However, a user can give the focus to the subform by clicking

it with the mouse. To prevent this from happening, you must make the

subform unenterable. The text below describes the steps to do this. A

uneditable and unenterable subform appears as a "label" for

information.

More Information:

To make a subform uneditable and unenterable, use the following three

steps:

1. Open the main form in Design view.

2. Click the mouse once on the subform object to display the

   Subform/Subreport property sheet.

3. Change the Subform/Subreport properties to the following:

      Subform/Subreport

      -----------------

      Enabled: No

      Locked:  Yes

For more information, search for "locked," then "Enabled, Locked

Properties" using the Help menu.

References


INF: How to Implement a Timer in Access

 Article Number: Q95924

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

There is no timer control in Microsoft Access. To implement a timer,

you must create an Access Basic module that creates a timing sequence

in your application.

More Information:

To create a timer within your Microsoft Access application, you must

call two functions. One function starts the sequence, and another

function sets a global variable that tells the first function to stop

performing the timing iteration.

In the first function, called StartTimer(), you execute an endless

loop that performs the timing update and the DoEvents() function. The

DoEvents() function instructs the Access Basic function to release the

computer's CPU to other tasks, such as your form, other applications

within Microsoft Windows, and most importantly the StopTimer()

function. The StopTimer() function sets the global variable that the

StartTimer() function checks to determine when to stop looping.

To create an example, follow the instructions below. Once these are

done, open the form in Browse mode and press the Start Timer button.

You should see the timing being performed by the updating in the text

box. At any point you can stop the timing sequence by pressing the

Stop Timer button.

1. Create the following controls on a form and set the appropriate

properties:

      Form: Form1

      -----------

      Control: Text Box

      -----------------

      ControlName: Text1

      Control: Command Button

      -----------------------

      Caption: Start Timer

      OnPush:  =StartTimer()

      Control: Command Button

      -----------------------

      Caption: Stop Timer

      OnPush:  =StopTimer()

2. Create a new module and add the following code:

'---------------------------------------

'GLOBAL DECLARATIONS SECTION

'---------------------------------------

Option Explicit

Dim StopTheTimer     'if set to TRUE, then exit StartTimer()

Const INTERVAL = 1   'determine how often in seconds to update

                     'the screen

'---------------------------------------------------

'This function will start the timer, update

'the display with the correct time unit,

'and look to see if the StopTheTimer is

'set to TRUE so as to determine when to

'stop the process.

'---------------------------------------------------

Function StartTimer ()

   Static InHere  'stop re-entrant code

   Dim iLast, iNow, x%

   'this stops the user from pressing the command button

   'and re-entering this code again if it is already

   'running.

   If InHere = True Then Exit Function

   iLast = Timer

   Do

      'StopTheTimer is set in StopTimer()

      If StopTheTimer = True Then

         StopTheTimer = False

         Exit Function

      End If

      iNow = Timer

      'need to update display only if the interval

      'has been exceeded.

      If (iNow - iLast) > INTERVAL Then

         Forms!Form1!Field0 = iNow

         iLast = iNow

      End If

      'release the CPU to other tasks, namely enable

      'the user to enter the StopTimer() function.

      x% = DoEvents()

   Loop

End Function

'---------------------------------------------------

'This function will set the flag to let StartTimer()

'stop execution.

'---------------------------------------------------

Function StopTimer ()

   StopTheTimer = True

End Function

References


INF: OpenTable Action Argument Does Not List Attached Tables

 Article Number: Q95925

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

One of the macro action arguments for the OpenTable action is Table

Name. In the Action Arguments section of the Macro window, the list of

arguments for Table Name includes the tables in the current database,

but none of the attached tables are listed.

More Information:

To use an attached table with the OpenTable macro action, you must

manually type the attached table name. Or, you can drag the attached

table from the Database window to the Table Name argument.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 21, "Macro

Basics," pages 513-514

References


PRACC9303: Screen Redraw Problems When Reordering Groups

 Article Number: Q95926

 CREATED: 01-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

In a report, when you change the order of two group levels and the

headers or footers have different heights, Microsoft Access doesn't

redraw the screen completely, making further editing of the sections

difficult.

RESOLUTION

Close the report and reopen it to force Microsoft Access to redraw the

screen correctly.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. This problem was corrected in Microsoft Access version 1.1.

MORE INFORMATION

================

The following Steps use the Employee Sales by Country Report from the

NWIND.MDB sample database. In this report, the Salesperson and Country

footers do not have identical heights.

Steps to Reproduce Problem

--------------------------

In the sample database NWIND.MDB:

1. Open the Employee Sales by Country Report in Design view.

2. Choose Sorting and Grouping... from the View menu to view the sorting

   and grouping levels.

3. Move Salesperson above Country so that the Report will group by

   Salesperson first, then Country.

4. Close the Sorting and Grouping box.

Note that while the two group headers and footers changed places, Microsoft

Access did not redraw the screen completely. As a result, you can't click

the page footer because the Salesperson footer remains highlighted.

References:

"Microsoft Access User's Guide," version 1.0, Chapter 19, "Sorting and

Grouping Data," pages 450-464.

References


INF: Currency Format Causes Report Alignment Problems

 Article Number: Q95927

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

In a report, if you format numbers with a Currency format, you may

experience difficulty when you try to align the formatted numbers with

other numbers that are not formatted. Foe example, if you format

totals in a detail section to Currency, but do not format the numbers

above or below the total, the unformatted numbers are not aligned with

the formatted numbers.

More Information:

To address this situation, rather than selecting the Currency format

for the control totals in your report, try using one of the Format

functions listed in the online help. You can enter a format function

in the Format property in the text box property sheet for the

appropriate control.

You can enter "$#,##0.00" for a number when you want to display the

dollar sign and use "#,##0.00" for a number when the dollar sign is

not required (do not enter quotation marks in either case). Each

example formats the numbers in your report to use the comma as the

thousands separator and formats each number to have two decimal

places. Numbers formatted in this manner line up with each other in

the report.

For more information, please refer to the "Format, Format$ Functions"

topic in the Microsoft Access online help. To do so, choose Index from

the Microsoft Access help menu then choose Search. Enter "format"

(without quotation marks) and choose Show Topics. Select "Format,

Format$ Functions" in the topics list box and choose Go To.

Reference(s):

"Microsoft Access Language Reference," version 1.0, page 206

References


INF: Microsoft Access Does Not Use Record Numbers

 Article Number: Q95928

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

The text below discusses the reasons why Microsoft Access does not use

record numbers as some other database products do.

More Information:

Many database products, such as FoxPro, dBASE IV, and Paradox, use a

record number that is physically associated with a record. For

example, the first record in a table has record number 1, the second

record has record number 2, and so on. The record numbers remain part

of the record as long as the record exists. In other words, the first

record entered into a table is always record number 1, even if the

table is sorted and the record appears somewhere other than in the

first position of the table.

Microsoft Access does not use this approach. When you view a table in

a datasheet, a number appears at the bottom of the form to indicate

the position of the record in the recordset, not the record's natural

position in the table. For example, if a record with the key value

"Anderson" is the first record in a recordset, the number 1 appears at

the bottom of the form. However, if you sort the records on a

different key, the record may not appear as the first record any

longer and a different number would appear at the bottom of the form.

When you open a table, form, or report, Microsoft Access creates a

dynaset, a dynamic copy of the appropriate recordset, and assigns

numbers to the records. The numbers are used only by the user

interface to provide a visually unique identifier for each record.

Microsoft Access uses this approach because assigning a physical

record number to each record is not "relationally correct." According

to relational theory, the data may appear in any order at any time.

Therefore, the key value provides the only truly reliable method to

identify a record; a random record number does not.

Because no record number is available, Microsoft Access provides

another method to identify records in a dynaset. Using the Bookmark

property, you can write a procedure that finds a target record, stores

its bookmark value into a variable, moves to other records, and

returns to the original record. For more information on Bookmarks,

please refer to the "Bookmark" topic in Microsoft Access help.

References


PRB: Error in Database Analyzer: DTSysQuery already exists

 Article Number: Q95929

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When using the Database Analyzer, you click the Analyze button and

   receive this error message:

      DTSysQuery already exists

CAUSE

   The Database Analyzer often creates a temporary query called DTSysQuery

   to complete certain tasks. When the Database Analyzer finishes using

   DTSysQuery or needs to create one, it first deletes the current copy.

   If it can't delete DTSysQuery, it attempts to create DTSysQuery anyway

   because it assumes DTSysQuery doesn't exist. As a result, an error

   occurs in the Database Analyzer and the error message you see is the

   result of a generic error trap mechanism that forwards the Access Basic

   error to the user.

   One reason why the Database Analyzer fails to delete the existing copy

   of DTSysQuery is because the Database Analyzer is installed on a drive

   or directory that has read-only permissions.

RESOLUTION

   To prevent the error from occurring, you must follow these steps:

   1. Open MSACCESS.INI in Notepad.

   2. Locate the section called [Libraries].

   3. Place a semicolon in front of the entry for ANALYZER.MDA.

   4. Close and save MSACCESS.INI. Then restart Microsoft Access.

   5. Open the database called ANALYZER.MDA.

   6. In the database window, delete the DTSysQuery query.

   7. Repeat steps 1 and 2. Then remove the semicolon from the front of

      the entry indicated in step 3.

   8. Restart Access and try the Database Analyzer again.

   If the Database Analyzer is located on a drive or directory that does

   not have modify permissions, you may not be able to complete step 6

   successfully. Even if you can, the problem will likely recur. If it

   does, move the Database Analyzer to a drive or directory that has

   modify permissions.

References


PRB: DateAdd 'w' Option Doesn't Work As Expected

 Article Number: Q95930

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When adding days using the "w" weekday option, the DateAdd()

   function adds the number of days instead of the number of work

   days.

CAUSE

   "W" works the same as "d" for DateAdd(). It is provided as an

   option for compatibility with the DatePart() function. Using "w"

   with DatePart() returns the day of the week (Sunday-Saturday), not

   whether the day is a work day.

RESOLUTION

   The functionality as described above is by design. You can use the

   Access Basic code in this article to return the number of work days

   rather than the number of days.

More Information:

To understand the following information, you need to be familiar with

Access Basic, how to create and use Access Basic procedures, and how

to use the Immediate window.

To reproduce this behavior, enter

   ? DateAdd("w",#2/2/93#,10)

in the Immediate window. The result is #2/12/93# (10 days), not

#2/16/93# (10 work days).

The following code provides a function, DateAddW(), that will add work

days to another date.

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

'**********************************************************

'Declarations section of the module

'**********************************************************

   Option Explicit

'==========================================================

' Create the following DateAddW() function in the module.

' This function provides a true work day substitute

'  for DateAdd("w", TheDate, Interval).

' This function performs error checking and ignores fractional

'  Interval values.

'==========================================================

Function DateAddW (ByVal TheDate, ByVal Interval)

  Dim Weeks As Long, OddDays As Long, Temp As String

  If VarType(TheDate) <> 7 Or VarType(Interval) < 2 Or _

        VarType(Interval)  > 5 Then

     DateAddW = TheDate

  ElseIf Interval = 0 Then

     DateAddW = TheDate

  ElseIf Interval > 0 Then

     Interval = Int(Interval)

'    Make sure TheDate is a work day (Round Down)

     Temp = Format(TheDate, "ddd")

     If Temp = "Sun" Then

        TheDate = TheDate - 2

     ElseIf Temp = "Sat" Then

        TheDate = TheDate - 1

     End If

'    Calculate Weeks and Odd Days

     Weeks = Int(Interval / 5)

     OddDays = Interval - (Weeks * 5)

     TheDate = TheDate + (Weeks * 7)

'    Take OddDays week-end into account

     If (DatePart("w", TheDate) + OddDays) > 6 Then

        TheDate = TheDate + OddDays + 2

     Else

        TheDate = TheDate + OddDays

     End If

     DateAddW = TheDate

  Else                        'Interval is < 0

     Interval = Int(-Interval) 'Make positive & subtract later

'    Make sure TheDate is a work day (Round Up)

     Temp = Format(TheDate, "ddd")

     If Temp = "Sun" Then

        TheDate = TheDate + 1

     ElseIf Temp = "Sat" Then

        TheDate = TheDate + 2

     End If

'    Calculate Weeks and Odd Days

     Weeks = Int(Interval / 5)

     OddDays = Interval - (Weeks * 5)

     TheDate = TheDate - (Weeks * 7)

'    Take OddDays week-end into account

     If (DatePart("w", TheDate) - OddDays) < 2 Then

        TheDate = TheDate - OddDays - 2

     Else

        TheDate = TheDate - OddDays

     End If

     DateAddW = TheDate

   End If

End Function

How to Use the DateAddW() Function

----------------------------------

Use the DateAddW() function wherever you would use DateAdd. For

example, instead of

   DateAdd("w",[StartDate],10)

use:

   DateAddW([StartDate],10)

To test the DateAddW() function, enter

   ? DateAddW(#2/2/93#,10)

in the Immediate window. The result is #2/16/93# (10 work days).

Reference(s):

Access "Language Reference," version 1.0, pages 102-107 and 492-493

References


INF: How to Create a Query By Form

 Article Number: Q95931

 CREATED: 01-MAR-1993

 MODIFIED: 26-APR-1993

Summary:

This article describes an approach to creating a query by form (QBF),

which is common in many end-user applications. A QBF presents the user

with several blank text boxes, each labeled with the name of the field

in the table, then allows the user to enter search criteria into these

text boxes, and performs a search only on those fields that have

search criteria specified.

More Information:

For example, a form might appear with the following text boxes:

   First Name: __________

   Last Name:  __________

   City:       __________

   State:      __________

   Zip Code:   __________

The user could then enter any combination of criteria, such as a value

for State and Last Name. The user would then click a button and get a

set of records where the State and Last Name match their entries.

This can be accomplished relatively easily by creating a parameter

query. Each parameter in the query checks for a value on the form. If

the value is there, the parameter returns the value; otherwise, the

parameter returns the current value of the field so that every record

satisfies the parameter value.

To illustrate this in the sample database Northwind Traders

(NWIND.MDB), follow these steps:

1. Create a new query based on the Categories table and add the two

   fields to the query grid.

      Query: Sample

      -------------

      Field: Category ID

         Criteria: IIf(IsNull([Prompt1]), [Category ID], [Prompt1])

      Field: Category Name

         Criteria: IIf(IsNull([Prompt2]), [Category Name], [Prompt2])

2. Run the query.

Notice that the two parameter prompts appear. If you place a value in

the first prompt, such as BEVR, and leave the second prompt blank,

only the first prompt is filtered. If you leave both blank, no

filtering takes place and all records appear.

Now consider the fact that these parameters don't have to be prompts.

They can be references to text boxes on a form. For example, the

parameters can be changed to:

(Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access.)

      Query: Sample

      -------------

      Field: Category ID

         Criteria: IIf(IsNull([Forms]![QueryForm]![Prompt1]),_

                       [Category ID], [Forms]![QueryForm]![Prompt1])

      Field: Category Name

         Criteria: IIf(IsNull([Forms]![QueryForm]![Prompt2]),_

                       [Category Name], [Forms]![QueryForm]![Prompt2])

This would read the parameter from text boxes called Prompt1 and

Prompt2 on a form called QueryForm. With this approach, the form can

be based on the query described above, and a button can be added that

runs a macro as shown below:

   Action

   ------

   DoMenuItem

      MenuBar : Form

      MenuName: Records

      Command : Refresh

Every time the macro is executed, the parameters on the query will

filter the dataset according to any entries on the form. The text

boxes and the button that runs the macro can be in the header or

footer of the form, and the data itself can be located in the detail

section.

References


INF: How to Change the 'Microsoft Access' Window Caption

 Article Number: Q95932

 CREATED: 01-MAR-1993

 MODIFIED: 29-APR-1993

Summary:

There is no Microsoft Access property to set the main caption of the

Microsoft Access window. To change the default "Microsoft Access"

caption to your own text, you must call the Windows application

programming interface (API) SetWindowText() function.

More Information:

To change the default "Microsoft Access" caption to your own text

string, create a new module in Microsoft Access and add the following

function below with the appropriate declaration section.

You may have some Windows API functions defined in an existing

Microsoft Access library; therefore, your declarations may be

duplicates. If you receive a duplicate procedure name error, remove

the Declare statement from your code or comment it out.

Note: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

'-----------------------------------------

' GLOBAL DECLARATION

'-----------------------------------------

Option Compare Database

Option Explicit

Declare Function FindWindow% Lib "User" (ByVal lpClassName As Any,_

                    ByVal lpWindowName As Any)

Declare Sub SetWindowText Lib "User" (ByVal hWnd%, ByVal lpString$)

'-----------------------------------------

' Function: SetCaption ()

' This function will set the caption of

' Microsoft Access's main window.

'-----------------------------------------

Function SetCaption ()

   Dim hWnd%

   hWnd% = FindWindow%("OMain", 0&)

   Call SetWindowText(hWnd%, "This is cool!")

End Function

To change the caption when Microsoft Access is started, you can

execute the RunCode macro action with SetCaption() as an argument and

save the macro as Autoexec. When you open this database up, this macro

will execute and change the "Microsoft Access" caption to "This is

cool!"

Reference(s):

"Microsoft Windows Software Development Kit Programmer's Reference

Volume 2: Functions," version 3.1

References


INF: Determining the Version of Catalog Stored Procedures

 Article Number: Q95933

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article describes how to find the version of catalog stored

procedures on a Microsoft SQL Server.

More Information:

There are situations in which you want to determine the version of a

stored procedure, such as when you are experiencing difficulties

attaching to SQL Server. The first method does not use Microsoft

Access.

Method 1

--------

Using the System Administration Facility (SAF), you need to log

onto SQL Server with the user's login ID and password (using the SQL

administrator's login id (SA) is ideal but is not always readily

available). Once logged on in SAF, the user needs to open the query

window and issue the command USE MASTER. This tells it to use the

Master database that contains the system tables. To determine the

version, have the user enter the following SQL command:

   SELECT Attribute_Value FROM MsServer_Info WHERE Attribute_ID = 500

Method 2

--------

In a situation where you can successfully attach to SQL Server data,

you can attach the MsServer_Info table from the Master database while

using Microsoft Access, then run a query on it for the record where

the Attribute_ID is equal to 500.

References


INF: How to Position Microsoft Access on the Screen

 Article Number: Q95934

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

To position Microsoft Access on the screen, you need to call the

Windows SetWindowPos API function. The article gives a brief

demonstration of how to position Microsoft Access on the screen.

More Information:

To position Microsoft Access on the screen, you will need to use the

SetWindowPos API function that is included in the USER.EXE dynamic

link library (DLL) included with Windows. Implement this function as

follows:

1. Open or create new module in Microsoft Access.

2. Within the Declarations section, add the following declares,

   constants, and comments.

   Note: In the following sample code, an underscore (_) is used as a

   line continuation character. Remove the underscore when re-creating

   this code in Access Basic.

'====================================

' Global Declarations

'====================================

Option Explicit

Declare Function FindWindow% Lib "user" (ByVal lpClassName As Any,_

                    ByVal lpCaption As Any)

Declare Sub SetWindowPos Lib "User" (ByVal hWnd%,_

                    ByVal hWndInsertAfter%, ByVal X%, ByVal Y%,_

                    ByVal cx%, ByVal cy%, ByVal wFlags%)

'Inserts the window to precede the position window in the Z-Order.

'This parameter must be a window handle or one of the following

'constants.

Global Const HWND_TOP = 0

Global Const HWND_BOTTOM = 1

Global Const HWND_TOPMOST = -1

Global Const HWND_NOTOPMOST = -2

'values for wFlags%

Global Const SWP_HIDEWINDOW = &H80   'Hide the window

Global Const SWP_SHOWWINDOW = &H40   'Show the window

Global Const SWP_NOMOVE = &H2        'Ignores the x, y values

Global Const SWP_NOZORDER = &H4      'Ignores the hWndInsertAfter

Global Const SWP_NOACTIVATE = &H10   'Does not activate the form

3. Include the following function:

Function SizeAccess ()

   Dim cX%, cY%, cHeight%, cWidth%

   'get handle to Microsoft Access.

   h% = FindWindow("Omain", 0&)

   cX% = 0: xY% = 0

   cWidth% = 640, cHeight% = 480

   'position Microsoft Access

   SetWindowPos h%, HWND_TOP, cX%, cY%, cWidth%, cHeight%, SWP_SHOWWINDOW

End Function

References


INF: How to Determine Whether a Menu Item Is Checked

 Article Number: Q95935

 CREATED: 01-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article discusses how you can make application programming

interface (API) calls to determine whether or not a menu item is

checked (selected). This method can be used, for example, when you

want to determine whether a form is in Form view or Datasheet view. If

a form is in Datasheet view, the Datasheet menu item on the View menu

is checked. Thus, determining whether this menu item is checked allows

you to determine whether the form is in Datasheet view.

The program code in this article comes from the ORDENTRY.MDB sample

database and is presented in this article in a condensed version.

More Information:

To determine whether a menu item is checked, you can use the

IsMenuChecked() function listed in the code at the end of this

article. IsMenuChecked() accepts two parameters indicating the

position of the menu item you want to check, and returns true if it is

checked and false if it isn't.

To determine the position of the menu item you want to check, count,

beginning with 0 (zero), from the left-most menu item until you reach

the item you want. This determines the first number. From the selected

menu, count down the submenu beginning with 0 until you reach the

desired submenu item. This determines the second number.

For example, suppose you have the following menu:

   File   Edit    View

   -------------------

   Open   Cut     Form Design

   Close  Copy    Form

   Exit   Paste   Datasheet

To determine whether Datasheet is checked, you would call

IsMenuChecked() with the values 2 and 2, because the View menu is in

position 2 and the Datasheet item on the View submenu is in position

2. Note the same menu with numbered rows and columns to illustrate

this further:

         0       1      2

       File     Edit   View

       --------------------

    0  Open     Cut    Form Design

    1  Close    Copy   Form

    2  Exit     Paste  Datasheet

As an example of how to use this function, follow these steps in the

sample database Northwind Traders (NWIND.MDB):

1. Copy the code at the bottom of this article to a new module.

2. Open the Customers form in Design view.

3. Click in the CustomerID text box to give it focus.

4. Specify the following for the OnDblClick property in the property

   sheet:

      OnDblClick: =MsgBox(Str(IsMenuChecked(2,2)))

5. Switch to Form view.

   Notice that the Datasheet item on the View menu is not checked

   because the form is not in Datasheet view.

6. Double-click the CustomerID text box.

   A zero appears indicating that the Datasheet item on the View menu

   is not checked.

7. Switch to Datasheet view.

   Notice that the Datasheet item on the View menu is now checked

   because the form is in Datasheet view.

8. Double-click the CustomerID text box.

   This time, a -1 appears indicating that the Datasheet item on the

   View menu is checked.

The following is a program listing:

Option Compare Database   'Use database order for string comparisons.

Option Explicit

Declare Function IsZoomed% Lib "User" (ByVal hWnd%)

Declare Function GetMenu% Lib "User" (ByVal hWnd%)

Declare Function GetSubMenu% Lib "User" (ByVal hMenu%, ByVal nPos%)

Declare Function GetMenuState% Lib "User" (ByVal hMenu%, ByVal idItem%,

                    ByVal fuFlags%)

Declare Function GetActiveWindow% Lib "User" ()

Declare Function GetParent% Lib "User" (ByVal hwin%)

Declare Function GetClassName% Lib "User" (ByVal hwin%, ByVal stBuf$,

                    ByVal cch%)

Const WU_MF_BYPOSITION = &H400

Const WU_MF_CHECKED = &H8

' OMain is the predefined classname of the

Global Const WU_WC_ACCESS = "OMain"

Function IsMenuChecked (iMenu%, iItem%) As Integer

   Dim hMainMenu%

   Dim hMenu%

   Dim Flags%

   '--------------------------------------------------

   'If the window is maximized, there is an additional

   'system menu added to the MDI window.

   '--------------------------------------------------

   If (IsZoomed(Screen.ActiveForm.hWnd)) Then

      iMenu% = iMenu% + 1

   End If

   '--------------------------------------------------

   ' Get the approriate handle to the menu item.

   '--------------------------------------------------

   hMainMenu% = GetMenu(GetAccessHwnd())

   hMenu% = GetSubMenu(hMainMenu%, iMenu%)

   Flags% = WU_MF_BYPOSITION Or WU_MF_CHECKED

   '--------------------------------------------------

   ' Call the API that returns the state of the menu.

   '--------------------------------------------------

   IsMenuChecked = (GetMenuState(hMenu%, iItem%, Flags%) <> 0)

End Function

Function StWindowClass (hWnd As Integer) As String

   Const cchMax = 255

   Dim cch%

   Dim stBuff As String * cchMax

   '--------------------------------------------------

   ' Get the class name of the window relating to hWnd

   ' and return this as the function.

   '--------------------------------------------------

   cch% = GetClassName(hWnd, stBuff, cchMax)

   If (hWnd% = 0) Then

      StWindowClass = ""

   Else

      StWindowClass = (Left$(stBuff, cch%))

   End If

End Function

Function GetAccessHwnd () As Integer

   Dim hWnd%

   '--------------------------------------------------

   ' Keep getting the handle of the parent, until the

   ' ClassName = "OMain", which is the class name of

   ' the Microsoft Access window.

   '--------------------------------------------------

   hWnd% = GetActiveWindow()

   While ((StWindowClass(hWnd%) <> WU_WC_ACCESS) And (hWnd% <> 0))

      hWnd% = GetParent(hWnd%)

   Wend

   GetAccessHwnd = hWnd%

End Function

References


PRB: DateDiff "W" Option Doesn't Work

 Article Number: Q95977

 CREATED: 03-MAR-1993

 MODIFIED: 25-MAY-1993

Summary:

SYMPTOMS

--------

When you calculate the difference between two dates using the Weekday

option ("w"), DateDiff returns an incorrect number of days.

CAUSE

-----

The "w" option is supposed to work the same way "d" does for DateDiff.

It is provided as an option for compatibility with the DatePart

function. However, "w" actually returns the number of weeks, not the

number of days or the number of work days.

RESOLUTION

----------

If you are using the DateDiff function to return the number of days,

substitute "d" for "w." You can use the Access Basic code in this

article to return the number of work days rather than the number of

days.

More Information:

To understand the following information, you need to be familiar with

Access Basic, know how to create and use Access Basic procedures, and

know how to use the Immediate window.

Steps to Reproduce Behavior

---------------------------

In the Immediate window, type:

   ? DateDiff("W",#2/2/93#,#2/18/93#)

The result is 2 (the number of weeks), not 16 (the number of days) or

12 (the number of work days).

The following code provides a function, WorkDays(), that calculates

the number of work days between two dates.

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

'**********************************************************

'Declarations section of the module

'**********************************************************

Option Explicit

'==========================================================

' Create the following DateDiffW function in the module.

' This function provides a true work day substitute

' for DateDiff ("w", StartDate, EndDate).

'==========================================================

Function DateDiffW (StartDate, EndDate)

   If VarType(StartDate) <> 7 Or VarType(EndDate) <> 7 Then

      DateDiffW = Null

   ElseIf StartDate = EndDate Then

      DateDiffW = 0

   ElseIf StartDate < EndDate Then

      DateDiffW = WorkDays(StartDate, EndDate)

   Else

      DateDiffW = -WorkDays(EndDate, StartDate) 'Note: dates reversed

   End If                                       'and the minus sign

End Function

'==================================================================

'The following function calculates the number of work days between

'two dates.

'This function relies on the caller to perform error checking.

'BegDate must be prior to EndDate.

'==================================================================

Function WorkDays (ByVal BegDate, ByVal EndDate)

   Dim Weeks As Long, OddDays As Long, Temp As String

   'Make sure dates aren't on a weekend (round down).

   Temp = Format(BegDate, "ddd")

   If Temp = "Sat" Then

      BegDate = BegDate - 1

   ElseIf Temp = "Sun" Then

      BegDate = BegDate - 2

   End If

   Temp = Format(EndDate, "ddd")

   If Temp = "Sun" Then

      EndDate = EndDate - 2

   ElseIf Temp = "Sat" Then

      EndDate = EndDate - 1

   End If

   'Check that BegDate is prior to EndDate

   If BegDate >= EndDate Then

      WorkDays = 0

      Exit Function

   End If

   'Calculate number of Weeks & Odd Days

   Weeks = Int((EndDate - BegDate) / 7)

   OddDays = EndDate - BegDate - (Weeks * 7)

   'Take final weekend into account

   If OddDays >= DatePart("w", EndDate) Then

      OddDays = OddDays - 2

   End If

   WorkDays = (Weeks * 5) + OddDays

End Function

How to Use the DateDiffW() Function

-----------------------------------

Use the DateDiffW() function wherever you would use DateDiff().

Instead of

   DateDiff("W",[StartDate],[EndDate])

use the following:

   DateDiffW([StartDate],[EndDate])

Steps to Test DateDiffW() Function

----------------------------------

1. In the Immediate window, type:

      ?DateDiffW(#2/2/93#,#2/18/93#)

2. The result is 12, the number of work days.

Reference(s):

"Access Basic Language Reference," version 1.0, Part 2, "A-Z

Reference," pages 102-107 and 492-493

References


INF: Criteria Parameters Require Concatenated References

 Article Number: Q95978

 CREATED: 03-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access has both a SQL interpreter and an Access Basic

interpreter. Because some Access Basic commands and functions require

SQL syntax as a parameter, it may become confusing how the two work

together.

For example, if you need to look up a description in a table called

Categories where [Category ID] is equal to whatever value is currently

in Forms!Form1!Field1, you cannot use:

   DLookUp("Description", "Categories",

         "[Category ID] = Forms!Form1!Field1")

Instead, you must concatenate the value of Forms!Form1!Field1 into the

criteria parameter as shown below:

   DLookUp("Description", "Categories",

      "[Category ID = '" & Forms!Form1!Field1 & "'")

This means that if the value of Forms!Form1!Field1 is "BEVR," the

criteria parameter in the expression above would evaluate to:

   [Category ID] = 'BEVR'

More Information:

When you make a function call such as:

   DLookUp("Description", "Categories", "[Category ID] = 'BEVR'")

Access Basic internally creates a SQL statement with the parameters

you supply. In this case, the resulting SQL statement is:

   SELECT Description FROM Categories WHERE [Category ID] = 'BEVR'

Access Basic sends this statement to the Access SQL engine, which

returns the result of the SELECT statement back to Access Basic, and,

in turn, back to your DLookUp() expression.

Note that that a DLookUp() coded as follows

   DLookUp("Description", "Categories",

      "[Category ID] = Forms!Form1!Field1")

would result in a WHERE clause that looks like:

   [Category ID] = Forms!Form1!Field1

The SQL parser is designed to accept SQL syntax, and the

Forms!Form1!Field1 reference is Access Basic syntax, so the form

reference cannot be expected to work. Instead, the resulting evaluated

criteria parameter must be done in such a way as to accommodate the

syntax rules of the SQL parser.

Note that this also applies to other Access Basic methods and

functions that require a criteria parameter. For example, Find methods

use a criteria parameter as shown below:

   Dim D As Database, S As Snapshot

   Set D = CurrentDB()

   Set S = D.CreateSnapshot("Categories")

   myvar = "BEVR"

   S.FindFirst "[Category ID] = '" & myvar & "'"

References


INF: Screen Fonts May Not Match Printer Output Fonts

 Article Number: Q96009

 CREATED: 03-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

Screen fonts and printer fonts can be different. When you create a new

form or report, the default font used to format the controls can be

set up to use only printer fonts. Using printer fonts will ensure that

the screen view and printed output are as close as can be to an exact

match. If you use TrueType fonts (supplied with Windows 3.1) the

screen view and printed output will also match. Forms that have been

saved as reports may need to be modified to ensure that you get the

correct output. By default, new reports use printer fonts but forms do

not. You can control which fonts are used by setting the

LayoutForPrint property in the form or report property sheet.

More Information:

When you choose a font for a form or report, the characters on the

screen may not look exactly like those that appear on the printed page

because printer fonts and screen fonts can differ. If you select a

scalable font, such as a TrueType font, the screen and printer

characters will be the same.

When you design a form or report, you can set the LayoutForPrint

property to Yes in the form or report property sheet, and you will

only see printer fonts listed in the toolbar. The LayoutForPrint

property determines whether a screen font or printer font is used. If

LayoutForPrint is set to No, the fonts available on the toolbar

include screen fonts.

If LayoutForPrint is set to Yes, the fonts and point sizes on the

toolbar correspond to the fonts and sizes available on the printer you

chose in the Print Setup command from the File menu.

For reports, this property is set to Yes by default. This property must

be changed to Yes for forms.

In Microsoft Access, you can design a form and save it as a report. If

LayoutForPrint is set to No when the form is originally designed, you

may need to change the fonts from a screen font to a TrueType or

printer font in the report design mode.

To convert a form to a report, open the form in Design view and choose

Save As Report from the File menu.

Reference(s):

"Microsoft Access User's Guide," version 1.0, page 309

References


INF: Changing Area Codes Based on a Telephone Number Prefix

 Article Number: Q96010

 CREATED: 03-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

Some states are adding new telephone area codes based on a phone

number's prefix. This article describes how to change a phone number's

area code in a table based on the prefix. This is accomplished by

creating a table with the prefix to find and the new area code. An

Access Basic function then reads this table into an array and searches

the phone number table and changes the area code in the phone number

table.

Before running this function, back up up your database and make a copy

of your table.

This article assumes that you are familiar with Access Basic and how

to create and use Access Basic procedures and Microsoft Access tables.

More Information:

1. Create a table that will contain the phone number prefix to search

   and the new area code:

      Table: Area Codes To Change

      ---------------------------

      Field Name: Prefix

         Datatype: Text

      Field Name: Area Codes

         Datatype: Text

2. Enter in the phone number prefixes and area codes in the table Area

   Codes To Change. For example:

      Prefix      Area Codes

      ----------------------

      635            207

      634            208

3. Open a module or create a new one, and enter the following code:

   Note: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

'*************************************************************

'Declarations section of the module.

'*************************************************************

Option Explicit

'=============================================================

' Create the following ChgAreaCode() function in the Module

' The following function will initialize:

' - A variable for the database object.

' - Variables for the table objects and several other objects.

' - Sets the database object to the opened database.

' - Opens table "Area Codes To Change" and tPhName.

' - The action of this function is to locate the phone number

'     entries with certain prefixes and then change the

'     corresponding area code. This function operates on numbers

'     with the following format "(206) 635-7050". The table name

'     and field name containing the phone number must be passed

'     as arguments.

'=============================================================

Function ChgAreaCode (tPhName, fldPhone)

   Dim PhoneDB As Database

   Dim tPhone As Table, tPrefix As Table

   Dim PCount%

   Dim i%

   Dim tPrefixName$

   Dim Prefix$

   Dim SpacePos%

   Dim HyphenPos%

   Dim PrefixLen%

   Dim PrefixToFind$

   Dim AreaCode$

   Dim Lastfour$

   tPrefixName$ = "Area Codes To Change"

   If tPhName = "" Or fldPhone = "" Then Exit Function

   Set PhoneDB = CurrentDB()

   Set tPrefix = PhoneDB.OpenTable(tPrefixName$, 1)

   tPrefix.MoveLast

   PCount% = tPrefix.RecordCount

   tPrefix.MoveFirst

   ReDim PrefixArray$((PCount% - 1), 1)

   For i% = 0 To PCount% - 1 Step 1

      PrefixArray$(i%, 0) = tPrefix.Prefix

      PrefixArray$(i%, 1) = tPrefix.[Area Codes]

      tPrefix.MoveNext

   Next i%

   tPrefix.MoveFirst

   tPrefix.Close

   Set tPhone = PhoneDB.OpenTable(tPhName, 1)

   Do Until tPhone.EOF

      SpacePos% = InStr(1, tPhone(fldPhone), " ")

      HyphenPos% = InStr(SpacePos% + 1, tPhone(fldPhone), "-")

      PrefixLen% = (HyphenPos% - SpacePos%) - 1

      PrefixToFind$ = Mid(tPhone(fldPhone), SpacePos% + _

                         1, PrefixLen%)

      For i% = 0 To PCount% - 1 Step 1

         If PrefixArray$(i%, 0) = PrefixToFind$ Then

            AreaCode$ = PrefixArray$(i%, 1)

            Prefix$ = Mid$(tPhone(fldPhone), 7, 3)

            Lastfour$ = Right$(tPhone(fldPhone), 4)

            tPhone.Edit

            tPhone(fldPhone) = "(" & AreaCode & ") "_

                                  & Prefix & "-" & Lastfour

            tPhone.Update

         End If

      Next i%

      tPhone.MoveNext

   Loop

   tPhone.Close

   PhoneDB.Close

End Function

When using this function you pass (tPhName), the name of the table

containing the number to change as a string. Then you pass (fldPhone),

the field name that contains the number to change as a string.

Example

-------

This function can be called from the Immediate window for one time

execution as follows:

   ?ChgAreaCode("Contacts", "Business Phone")

(Where "Contacts" is a table name and "Business Phone" is a

field containing the phone number.)

Reference(s):

"Microsoft Access Basic: An Introduction to Programming," version 1.0

References


PRB: No System Table Permissions After Admin User Deleted

 Article Number: Q96011

 CREATED: 03-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

An attempt to access the system MSysACES, MSysColumns, or

MSysIndexes fails.

CAUSE

You deleted the Admin account from the list of valid users.

RESOLUTION

Before you delete the Admin account, you must Assign permissions

for those tables to a new member member of the Admins group.

STATUS

This problem does not occur in Microsoft Access version 1.1.

MORE INFORMATION

================

The text below explains how to assign permission to access those

tables to a new member of the Admins group.

If you create a new Administrator account and delete the original

Admin account from the Users group before you give the new account

rights to access the system tables, you are unable to access the

system tables. The one exception to this rule applies if the original

Admin account did not create the database.

To assign permissions to access the system tables, perform the

following steps.

 1. Log into Microsoft Access as the user Admin (if you do not receive

    a login screen, you are automatically logged in as Admin).

 2. From the Security menu, choose Users.

 3. In the Users dialog box, choose New.

 4. Enter the name of the new administrator, assign the administrator

    a PIN (personal identification number) and choose OK.

 5. In the Group Membership section of the Users dialog box, add the

    new administrator to the group Admins. To do so, select Admins in

    the Available Groups list and choose Add. Then choose Close.

 6. From the View menu, choose Options.

 7. In the Items box for the General category, set Show System Objects

    to Yes and choose OK.

 8. From the Security menu, choose Permissions.

 9. In the Object section of the Permissions dialog box, select the

    MSysACES table.

10. In the Permissions section of the Permissions dialog box, choose

    "Full Permissions." Microsoft Access automatically selects all

    other permissions.

11. Repeat steps 9 and 10 for the MSysColumns and MSysIndexes tables.

References:

"Microsoft Access User's Guide," version 1.0, Chapter 25,

"Administering a Database System," pages 616-623.

For More information, search for "permissions," then "Adding Users to

Groups," and "Assigning Permissions to Users" using the Help menu.

References


INF: Security Settings for Modifying Data in a Query Dynaset

 Article Number: Q96012

 CREATED: 03-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

You can affect a user's ability to edit data in a query's dynaset by

the setting on these two permissions:

 - Modify Data permissions for a table or a query

 - Run with Owner's Permissions query property

More Information:

For a user to be able to edit a query's dynaset, one of the following must

be true:

1. The Run With Owner's Permissions query property check box must be

   selected. To view query properties, open the query in Design view. Then

   from the View menu, choose Query Properties.

2. The User must have Modify Data permissions for both the underlying

   tables and for the query.

The following table details the possible combinations of these three

settings and their effect on editing the dynaset:

Permission       Permission       Run with

to Modify Data   to Modify Data   Owner's       Edit

Table            Query            Permission    Query?

--------------   --------------   -----------   ------

Yes              No               No            No

Yes              Yes              No            Yes

No               No               No            No

No               Yes              No            No

Yes              No               Yes           No

Yes              Yes              Yes           Yes

No               No               Yes           No

No               Yes              Yes           Yes

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 25,

"Administering a Database System," pages 619-626.

References


INF: Stored Procedures for Microsoft and Sybase SQL Server

 Article Number: Q96013

 CREATED: 03-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access requires certain information from a back-end database

to perform its functions. This information is provided by a series of

catalog stored procedures that reside on the back-end database. There

are two different versions of the stored procedures, depending on what

version of SQL Server you are running. This article describes which

is needed and when.

More Information:

If you are running Microsoft SQL Server:

Version         Requirements

----------------------------

1.x or 4.2      You need to run the INSTCAT.SQL found on the Microsoft

                Access ODBC disk.

4.2a            Running the INSTCAT.SQL is not required, but some

                Microsoft Access problems are resolved with it that are

        not in the SQL Server 4.2a stored procedures.

If you are running Sybase SQL Server:

Version         Requirements

----------------------------

Before 4.8      You need to run the INSTCAT.SQL found on the Microsoft

                Access ODBC disk.

4.8-4.9x        You need to acquire INSTCAT.48 from the MSACCESS

                forum on CompuServe from the ODBC/SQL Server library.

                The file is named SYBASE.ZIP.

If INSTCAT.SQL (or INSTCAT.48) is not properly installed, the

following error message is displayed while you're attaching an SQL

table in Microsoft Access:

   [Microsoft][ODBC SQL Server Driver] The ODBC catalog stored

   procedures installed on your server <servername> are version

   xx.xxxx; version xx.xx.xxxx is required to ensure proper

   operation. Please contact your system administrator.

To install the catalog stored procedures, use the SQL Server ISQL

(Interactive SQL) tool. You can run the ISQL tool from the MS-DOS or

OS/2 command line.

(Note: Don't use the SAF utility provided with Microsoft SQL Server.

Microsoft SAF for MS-DOS and OS/2 is limited to 511 lines of code in

an SQL script.)

The syntax to install INSTCAT.SQL using ISQL is:

   isql /U <sa loginname> /n /P <password> /S <SQL servername>

   /i <drive:\path\INSTCAT.SQL> /o <drive:\path\outputfilename>

(Note: Enter the preceding two lines as one line at the command

prompt, and don't include the angle brackets < >.)

   /U   Login name for the system administrator.

   /n   Eliminates line numbering and prompting for user input.

   /P   Password (case sensitive) used for the system administrator.

   /S   Name of the driver to set up.

   /i   Provides the drive and fully qualified path for INSTCAT.SQL.

   /o   Provides ISQL with an output file destination for results,

        including errors.

Example

-------

  isql /U sa /n /P skier /S DUMMY_SERVER /i D:\SQL\INSTCAT.SQL /o

  D:\SQL\OUTPUT.TXT

References


PRB: Text Label Truncated Printing Form on Epson 9-Pin Printer

 Article Number: Q96100

 CREATED: 08-MAR-1993

 MODIFIED: 18-JUN-1993

Summary:

SYMPTOMS

   When print a form or a report to an Epson 9-pin printer, the last

   two characters of the label controls are truncated. The label

   controls appear correctly in Print Preview.

CAUSE

   This problem is caused by the difference in the sizes of the Epson

   printer driver fonts and the screen fonts.

RESOLUTION

   Before adding any controls to your form or report, set the Layout

   for Print property to Yes.

More Information:

Perform the following three steps to layout your form or report

correctly.

1. Open the form or report in Design view.

2. Choose the Properties button or choose Properties from the View

   menu.

3. Change the Layout for Print property to Yes.

4. Place fields into the form or report as desired. The label controls

   display and print correctly.

For more information, query in the Microsoft Knowledge Base on the

following words:

   screen and fonts and printer and true and type

References


INF: dBASE's REPORT FORM Command in Access Basic

 Article Number: Q96101

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article discusses how to implement a dBASE-style REPORT FORM

command in an Access Basic application.

More Information:

In dBASE, you can create a report via the Report Generator, then print

the report from a program using the REPORT FORM TO PRINT command. In

Microsoft Access, you can print a pre-existing report programmatically

using DoCmd OpenReport.

For example, suppose you have created a report in Microsoft Access

called MyReport, and you want to print the report from an Access Basic

procedure. Use the following command to accomplish this:

   DoCmd OpenReport "MyReport"

If you omit the TO PRINT clause, which is optional in dBASE's REPORT

FORM command, the report will print to the screen. This is equivalent

to showing the report in Print Preview mode rather than sending it to

the printer. This can be done with DoCmd OpenReport by adding the

A_PREVIEW parameter:

   DoCmd OpenReport "MyReport", A_PREVIEW

In Addition, you can open a report in Design mode by using the

A_DESIGN parameter:

   DoCmd OpenReport "MyReport", A_DESIGN

References


PRACC9303: User with Full Permissions Cannot Run Query

 Article Number: Q96102

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 84

SYMPTOMS

   You receive the following message even though you have full permission

   on the table:

      Couldn't read; no read permission for table or query <query name>

   You can view the table in Datasheet and Design view, and you can open

   the query in Design view.

CAUSE

   This occurs when a query has the property Run with Owner's Permissions

   checked and the user who created the query (the owner) is no longer on

   the system. Either the owner was deleted or the database was opened in a

   Microsoft Access session that was started with a different SYSTEM.MDA

   where the owner is not a included.

   When the property Run with Owner's Permissions is checked, Microsoft

   Access checks the owner's permissions. It does not compare the owner's

   permissions to those of the user running the query. Therefore, if the

   owner is not on the system, other users can't execute the query as long

   as the property Run with Owner's Permissions is checked.

RESOLUTION

   To allow users to run the query with their own permissions, clear the

   Run with Owner's Permissions check box and save the query.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access version

   1.0. Microsoft is researching this problem and will post new information

   here in the Microsoft Knowledge Base as it becomes available.

More Information:

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access. If you have activated security, log in as a

   member of the group Admins.

2. From the Security menu, choose Users.

3. Press the New button and add a new user called John. Add another user

   called Jane. Do not assign either to any group other than Users.

4. If you have already activated security, skip this step. Choose Change

   Password... from the Security menu. Leave the Old Password blank, enter

   Admin for New Password and Verify. Press the OK button.

5. Exit and restart Microsoft Access. Log in as John leaving the password

   blank.

7. Create a new query based on any table. If you are in a secure system,

   base the query on a table that the Users group has full permissions to.

   From the View menu, choose Query Properties and select the Run with

   Owner's Permissions check box.

8. Exit and restart Microsoft Access. Log in as Admin using the password

   Admin.

9. Choose Users from the Security menu. Delete the user John.

10. Exit and restart Microsoft Access. Log in as Jane leaving the password

    blank.

11. Attempt to run the query.

At this point, you will see the error message "Couldn't read; no read

permission for table or query '<query name>'.

12. Verify that Jane can open the query in Design view as well as open the

    table on which the query is based.

To avoid the problem, in the Design view, the user Jane can choose Options

from the View menu and clear the Run with Owner's Permissions check box.

Depending on the security, that may have to be done by an Admin. After you

clear the check box, the query will run.

References


INF: Macro to Enter Date Record Was Last Modified

 Article Number: Q96103

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article explains how to write a macro that will place the current

date into a LastModified field in your table each time a record is

modified. This method works when you are editing records from a form.

More Information:

When a form is used to edit records, you can date stamp the record by

attaching a macro to the BeforeUpdate property of the form. For this

example, we will use the Customers table in the sample database

Northwind Traders (NWIND.MDB).

1. Add a new field to the Customers table.

   Table: Customers

   -----------------------------

   Field Name: DateModified

   DataType:   Date/Time

2. Create a macro called LastModified as follows:

   Macro Name            Action

   ----------------------------

   LastModified        SetValue

                          Item: [DateModified]

                          Expression: Date()

   Note: There is no equal sign (=) in front of the Date() function.

   If you put an equal sign in front of the Date() function, the macro

   will always put the date 12/30/99 into the [DateModified] control

   even though the macro step window shows the correct date in the

   argument section.

3. Create a form called Modify Customers based on the Customers table.

   Place a few of the fields on the form as follows:

   Form Name: Modify Customers

   ----------------------------

   ControlSource: DateModified

   ControlSource: Customer ID

   ControlSource: Company Name

   ControlSource: Address

4. Enter the macro name LastModified into the BeforeUpdate property of

   the Modify Customers form. Switch the form to Form view. Any time

   you modify the record, the current date will be placed in the

   DateModified control.

References


INF: Requery, Repaint, and F9/Records Refresh

 Article Number: Q96104

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

Requery, Repaint, and F9/Records Refresh are different; however, they

are all generally are used to ensure that what you see is updated.

Requery

-------

The Requery macro action updates controls, such list boxes and combo

boxes. It does not work for the form on which those controls exist.

Repaint

-------

Repaint is not related to data, it merely redraws the object or

control. If there is data that has been updated in the underlying

dynaset but is not reflected on the form, Repaint can't be used.

F9

--

F9 requeries the form itself, as opposed to any control on the form.

References


PRB: Leading Space in Property Sheet Entry May Cause Problems

 Article Number: Q96105

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Valid values for properties are not recognized as valid. For

   example, you get a #Name value for a control that is bound to a

   field in the underlying table that definitely exists.

CAUSE

   The problem may be caused by having a leading space as part of the

   entry for that property. For example, you may have a ControlSource

   property for a control that correctly identifies the name of a

   field for the control, but includes a leading space. In such a

   case, Microsoft Access attempts to include the leading space as

   part of the value you specified for ControlSource.

RESOLUTION

   Remove the leading space.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new form in the sample database Northwind Traders

   (NWIND.MDB) bound to the Categories table.

2. From the fields list, drag the Description field onto the form.

3. With the Description field in focus, bring up the property sheet

   and put a space in front of the "Description" value that appears

   for the ControlSource property.

4. Switch from Design mode to Browse mode.

Notice that #Name appears for the Description field even though it is

part of the underlying table.

References


INF: Accessing a Report Dynaset Requires a .Form Reference

 Article Number: Q96106

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

The text below discusses methods to access a report's dynaset and

explains the apparent discrepancy in the documentation regarding the

use of a form dynaset versus the use of a report dynaset.

More Information:

Page 65 of the "Microsoft Access Introduction to Programming" manual

for version 1.0 implies that both forms and reports have associated

dynaset objects that are accessible and that function identically.

This is basically true; once you access a report's dynaset, you can

use the same procedures that you use with a form's dynaset. Any

limitations in functionality relate only to the differences between an

interactive object (the form) and a noninteractive object (the

report).

According to page 162 of the "Microsoft Access Language Reference"

manual for version 1.0, the Dynaset property applies only to forms.

This is actually correct even though you can access a dynaset from a

report in the same manner as you can access a dynaset for a form. The

statement is correct because the Dynaset property is accessible only

through a form reference. For example, if you have a form called

"Form1," you can assess Form1's dynaset with the following reference:

   Set MyDynaset = Forms!Form1.Dynaset

However, to access Report1's dynaset, use the following reference:

   Set MyDynaset = Reports!Report1.Form.Dynaset

References


PRB: Compile Error When Attempting to Use an AccessWizard

 Article Number: Q96107

 CREATED: 08-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

The following error appears when you try to use an AccessWizard:

   Compile error

CAUSE

This occurs because there is a compile error in the code stored in the

database.

Microsoft Access must compile all code in memory to use any of it. This

includes the code stored in the database and any libraries (.MDA files)

that are loaded. When you attempt to use an AccessWizard, Microsoft

Access must compile the Access Basic code that is in the WIZARD.MDA file

in addition to any code in your database. If there is an error in the

code in your database, Microsoft Access will not be able to run the

AccessWizard because the compilation failed.

RESOLUTION

To resolve this problem, follow these steps:

1. Open your database.

2. Open any module in Design view.

3. Choose Compile All from the Run menu.

Microsoft Access will bring up the module window with the offending

line of code. Upon correcting the error, and assuming there are no

other errors, AccessWizards should now work.

If the Compile error message persists, repeat steps 2 and 3 until all

errors in the code are corrected.

STATUS

This problem does not occur in Microsoft Access version 1.1.

References


INF: Items in a Module Run Menu Are Unavailable (Grayed Out)

 Article Number: Q96108

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

When you have a module window open and in focus, you may notice that

many items in the Run menu are unavailable (grayed out):

More Information:

The items that are unavailable are:

   Continue

   Single Step

   Procedure Step

   Set Next Statement

   Show Next Statement

This may be confusing because it seems that you ought to be able to do

something similar to Single Step right from the code window.

You cannot begin stepping through code until you are in Break mode,

which is why the items are unavailable. Once the code is executed,

Break mode occurs when any of the following take place:

 - A breakpoint that you set is encountered

 - A Stop command is encountered

 - CTRL+BREAK is pressed while the code is running

 - An error occurs in the code

Reference(s):

"Microsoft Access Introduction to Programming," Chapter 4, "Debugging

Your Access Basic Code," pages 29-42

References


INF: Troubleshooting Access Setup and Installation

 Article Number: Q96109

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article explains the various troubleshooting techniques that you

can use to resolve Microsoft Access setup and installation problems.

Many of these same troubleshooting techniques are also applicable for

post-installation troubleshooting. Troubleshooting techniques include:

checking your disks, checking the temp directory, checking what loads

in memory when you start Windows, and clean booting.

More Information:

Checking Your Disks

-------------------

The following steps help determine whether your problem is related to

bad disks. To check a specific disk:

1. Exit completely out of Windows.

2. At the command prompt (C:>), type the following:

      md \disktest

3. Put the suspect disk in your A drive (substitute B if you are using

   your B drive). Then type the following command:

      copy a:*.* c:\disktest

4. If your disk successfully copies, you will be returned to the

   command prompt without an error message. This means that your disk

   is okay, and your problem should be resolved using one of the other

   troubleshooting techniques. If you receive an error message,

   request replacement disks from Microsoft Customer Service by

   calling (800) 426-9400.

5. Remove the temporary DISKTEST directory and any files that you

   created in step 2 above. At the command prompt, type the following

   commands:

      erase c:\disktest\*.*

      rd c:\disktest

Steps to Check the TEMP Directory

---------------------------------

1. Exit completely from Windows.

2. At am MS-DOS prompt, type the following command:

      set

3. Change to the directory pointed to by the TEMP variable. For

   example, if you are at the C:\DOS> prompt when you type SET and you

   see "Temp=c:\windows\temp", type the following command:

      cd \windows\temp

   If you get "invalid directory" when changing to the TEMP directory,

   you must create that directory using the MS-DOS Make Directory (MD)

   command.

4. There should be no *.TMP files in your TEMP directory when Windows

   is not running. If there are *.TMP files in this directory, they

   should be erased. To see whether there are any .TMP files in your

   TEMP directory, type the following command:

      dir *.tmp

5. Use the MS-DOS Chkdsk command to check your hard drive. (Note:

   Refer to the MS-DOS manual if you have lost allocation units, lost

   clusters, or cross-linked files.) At the command prompt, type:

      chkdsk

6. Check the amount of free space on your hard drive by looking at the

   line that says "bytes available on disk." If this number is less than

   4000000 bytes (4 MB), free up some additional hard drive space.

   For more information on the TEMP directory, query on the following

   words in the Microsoft Knowledge Base:

      windows and temporary and files and definition

Steps to Check What Loads When You Start Windows

------------------------------------------------

It is important to have a clean Windows configuration before booting

off a clean, bootable floppy disk (refer to "Steps to Clean Boot"

below). The following steps ensure a clean Windows configuration:

1. Using a text editor, such as the MS-DOS 5 Editor (Edit), open your

   C:\WINDOWS\WIN.INI file. The two lines you should check in this file

   are the second and third lines:

      load=

      run=

   If there is anything to the right of the equal sign (=) on either of

   these two lines, comment out that line using a semicolon (;). For

   example:

      ;load=c:\mydir\myprogram.exe

2. Save your changes and exit the WIN.INI file. The semicolon causes

   Setup to ignore that line while loading Windows.

3. When clean booting, you do not want anything to load automatically

   from your startup group. To temporarily disable this functionality,

   hold down the SHIFT key as soon as you see the Windows logo screen.

   Keep the SHIFT key depressed until Windows is completely loaded.

4. Make sure that you are using a Windows video driver. To do this,

   exit Windows. At the C:\WINDOWS> prompt, type:

      setup

   Windows will display a System Information screen that indicates the

   type of display that you are using. If the Display does not show EGA

   or VGA, follow the instructions on your screen to change the

   Display to VGA. (Note: If you receive a Welcome to Windows setup

   screen, you were not at the Windows prompt when you typed SETUP.)

Steps to Clean Boot

-------------------

A clean boot eliminates many variables that may be related to your

specific error message. The first step in a clean boot is to create a

bootable system floppy disk. The next step is to create simple

CONFIG.SYS and AUTOEXEC.BAT files on your bootable floppy disk. These

files can be created by using any text editor, such as EDIT (MS-DOS

5.0) or Notepad (Windows versions 3.x).

1. To create a bootable floppy disk, put a blank disk in your A

   drive. You must use your A drive. At an MS-DOS prompt, type the

   following command:

      format a: /s

2. Using a text editor, create a CONFIG.SYS file on the bootable

   floppy disk that you created in step 1 above. Note: If there is

   hard disk partitioning, disk compression, or other third-party

   software required to boot your computer, these files will need to

   be included in your CONFIG.SYS file. A simple CONFIG.SYS is:

      files=50

      buffers=20

      device=c:\windows\himem.sys

      <third-party disk partitioner>

      <third-party disk compression driver>

      <Other third-party driver if necessary to boot your computer>

      shell=c:\<valid path>\command.com /p

   Note: If you have the following line in your current CONFIG.SYS file,

   you will want to include this line in a clean boot CONFIG.SYS file:

      device=c:\windows\smartdrv.sys /double_buffer

   For more on SMARTDRV.SYS, query on the following words in the

   Microsoft Knowledge Base:

      SMARTDrive and 4.0 and design and overview

3. Using a text editor, create an AUTOEXEC.BAT file on the bootable

   floppy disk that you created in step 1 above. A simple AUTOEXEC.BAT

   is:

      prompt $p$g

      path=c:\windows

      set temp=c:\<valid path>

4. If you are still experiencing setup problems, try starting Windows

   in standard mode by typing

      win /s

   at the A prompt. Windows will not try to create any virtual memory

   in standard mode. If running in standard mode resolves your problem,

   contact Windows Product Support for further assistance.

   For more information on the TEMP directory, query on the following words

   in the Microsoft Knowledge Base:

      clean and boot and windows

References


INF: Using WIN.INI & ODBC.INI When Attaching SQL Server Table

 Article Number: Q96110

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article discusses how the ODBC Driver manager and the SQL Server

driver use the WIN.INI and ODBC.INI files during connection time.

More Information:

For the purposes of this article, the following is assumed:

 - You set up a data source for the SQL Server driver called mysqlsvr.

 - The data source is located on a server called Unixmc.

 - You are connecting to a Sybase SQL Server table on Unix whose

   address is 11.1.4.40,3180.

 - The net-library you are using is wdbftptc.dll.

Given these assumption, if the setup was done correctly, the ODBC.INI

file will have the following entry in the [ODBC Data Sources] section:

   mysqlsvr=SQL Server

There will be a section called [mysqlsvr] in the ODBC.INI and it will

have entries of the following form:

   DRIVER=c:\windows\system\sqlsrvr.dll

   Description=SQL\Server on server Unixmc

   OemToAnsi=No

   Network=wdbftptc

   Address=11.1.4.40,3180

The DRIVER entry points to the location of the SQL Server driver. It

is located on the System subdirectory of the Windows directory.

The Description entry describes what kind of a data source this is.

This is something that you can change when setting up the data source

by using ODBC Administrator.

The OemToAnsi entry indicates whether conversion needs to be done from

the OEM code page to the ANSI code page. Note that this is not the

same as the translation DLL.

The Network entry indicates the name of the net-library.

The Address entry indicates the network address.

The WIN.INI file will have the following entry in its [SQLSERVER] section:

   mysqlsrvr=wdbftptc,11.1.4.40,3180

When you run a SQLConnect or SQLDriverConnect command and choose to

connect to the mysqlsvr data source, the Driver manager looks in the

ODBC.INI file to find the name and location of the SQL Server driver.

It looks for the DRIVER entry described above and loads it into

memory.

Next, the SQL Server driver looks in the WIN.INI file's [SQLSERVER]

section for mysqlsvr entry where it picks up the name of the

net-library. Then it loads the net-library name (wdbftptc in this

case) into the memory. Next, it looks at the entry again to get the

address of the server which it passes on to the net-library. If there

is no address following the name of the net-library, it passes the

name of the data source to the net-library, as the network address.

Db-library users should note that unlike W3DBLIB.DLL, the SQL Server

driver does not look at the dsquery entry unless dsquery is a data

source in the ODBC.DLL file.

If you are using Microsoft Access, this sequence of operations take

place when you attach a SQL Server table. If you are using Microsoft

Visual Basic version 2.0, it takes place in response to the

OpenDataBase call.

References


INF: Sorting String Values Based on their Numeric Values

 Article Number: Q96112

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

To preface this article, I have a database that contains a product

code column. It is a text data type but I store numbers from 1 to 999

and each code can have a single letter for a suffix. For instance, I

might have the following codes: 10a, 1d, 100b, 24c, 24a, 1, 89b, and

14. I want to view this data so that it is sorted on the code. It

should appear like this: 1, 1d, 10a, 14, 24a, 24c, 89b, and 100b.

This article discusses one method for doing this. It requires basic

knowledge of Microsoft Access queries and functions.

More Information:

You need to use a query to view your data so that it is sorted on the

code. This will work as long as the numbers do not exceed 1000 (if

they do, you can add to this solution to accept larger numbers), there

can be only one character digit after the number (that is, a, b, c;

not aa, bc, cde), and numbers cannot have leading zeros (that is, 01,

02, 03, and so forth).

The query grid appears as follows:

   Query: Query1

   -------------

   Field: ID

      Show: Yes

   Field: PRE: Val([ID])

      Sort: Ascending

   Field: SUF: IIF(Val([ID])<10,Mid([ID],2,1),

               IIF(Val([ID]) between 10 and 99,

               MID([ID],3,1),Mid([ID],4,1)))

          Sort: Ascending

This separates the numeric value (PRE) and the string value (SUF) into

two separate (temporary) fields in the query. The query sorts on the

individual pieces but shows only the true ID field (assuming your

field name is ID).

References


PRB: RunCode Macro May Not Evaluate Conditions

 Article Number: Q96113

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you execute a RunCode macro with a condition that evaluates a

   control on a form, it runs the code specified regardless of whether

   the condition is met.

CAUSE

   This will happen if the function specified in the action argument

   is preceded by an equal sign (=).

RESOLUTION

   The macro action argument requires only the name of the Access

   Basic function procedure to execute and does not require an equal

   sign before the function name.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create an unbound form with two unbound text box controls named

   Field1 and Field2. Save the form as Form1.

2. In a new module, create a function named TestFunction.

   '****************************************************

   'Declaration section of the module.

   '****************************************************

   Option Explicit

   Function TestFunction()

      MsgBox "Test"

   End Function

3. Create a macro named Test1.

   Macro Name       Condition                    Action

   -----------------------------------------------------

   Test1            Forms![Form1]![Field1]=2     RunCode

      Test1 Actions

      -----------------

      RunCode

         Function Name: =TestFunction()

4. Open Form1 in Design view. Assign the macro named Test1 to the

   OnExit property of Field1.

5. Change to Form view and enter the value of 1 in Field1. Tab off the

   field and notice the message box pops up even though the condition

   was not met. This will happen regardless of whether the condition

   is met or not.

To evaluate the condition, remove the equal sign preceding the

function name in the macro.

References


INF: How to Use the Windows OpenFile Dialog Box

 Article Number: Q96114

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article describes how to use the OpenFile dialog box from Access

Basic.

For more information on how to call the Save dialog box, query on the

following words in the Microsoft Knowledge Base:

   GetSaveFileName

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access.

More Information:

The OpenFile common dialog box can be implemented in Microsoft Access

through the use of the Windows GetOpenFileName() application

programming interface (API) function. Using this function will

simplify programming issues for the developer. This function creates a

system-defined dialog box, familiar throughout Windows, that makes it

possible for the user to select a file to open. This function will

return a valid file to the programmer that is fully qualified with the

path name. The developer can customize how the system will handle

specific situations, such as specifying that the file must exist when

the user wants to save a file through the use of flags.

To use the code below, paste the function and declarations into a

module.

   Note: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

You may have some Windows API functions defined in an existing

Microsoft Access library; therefore, your declarations may be

duplicates. If you receive a duplicate procedure name error, remove

the Declare statement from your code or comment it out.

'-------------------------------------------------------

' Global Declaration Section

'-------------------------------------------------------

Option Compare Database

Option Explicit

Type tagOPENFILENAME

     lStructSize As Long

     hwndOwner As Integer

     hInstance As Integer

     lpstrFilter As Long

     lpstrCustomFilter As Long

     nMaxCustFilter As Long

     nFilterIndex As Long

     lpstrFile As Long

     nMaxFile As Long

     lpstrFileTitle As Long

     nMaxFileTitle As Long

     lpstrInitialDir As Long

     lpstrTitle As Long

     Flags As Long

     nFileOffset As Integer

     nFileExtension As Integer

     lpstrDefExt As Long

     lCustData As Long

     lpfnHook As Long

     lpTemplateName As Long

End Type

Declare Function GetOpenFileName% Lib "COMMDLG.DLL" (_

                    OPENFILENAME As tagOPENFILENAME)

Declare Function GetSaveFileName% Lib "COMMDLG.DLL" (_

                    OPENFILENAME As tagOPENFILENAME)

Declare Function lstrcpy& Lib "Kernel" (ByVal lpDestString As Any,_

                    ByVal lpSourceString As Any)

Dim OPENFILENAME As tagOPENFILENAME

Global Const OFN_READONLY = &H1

Global Const OFN_OVERWRITEPROMPT = &H2

Global Const OFN_HIDEREADONLY = &H4

Global Const OFN_NOCHANGEDIR = &H8

Global Const OFN_SHOWHELP = &H10

Global Const OFN_ENABLEHOOK = &H20

Global Const OFN_ENABLETEMPLATE = &H40

Global Const OFN_ENABLETEMPLATEHANDLE = &H80

Global Const OFN_NOVALIDATE = &H100

Global Const OFN_ALLOWMULTISELECT = &H200

Global Const OFN_EXTENSIONDIFFERENT = &H400

Global Const OFN_PATHMUSTEXIST = &H800

Global Const OFN_FILEMUSTEXIST = &H1000

Global Const OFN_CREATEPROMPT = &H2000

Global Const OFN_SHAREAWARE = &H4000

Global Const OFN_NOREADONLYRETURN = &H8000

Global Const OFN_NOTESTFILECREATE = &H10000

Global Const OFN_SHAREFALLTHROUGH = 2

Global Const OFN_SHARENOWARN = 1

Global Const OFN_SHAREWARN = 0

'-------------------------------------------------------

' Open Common Dialog Function

'-------------------------------------------------------

Function OpenCommDlg ()

  Dim Message$, Filter$, FileName$, FileTitle$, DefExt$

  Dim Title$, szCurDir$, APIResults%

    '*Define the filter string and allocate space in the "c" string

    Filter$ = "Access(*.mdb)" & Chr$(0) & "*.MDB;*.MDA" & Chr$(0)

    Filter$ = Filter$ & "Text(*.txt)" & Chr$(0) & "*.TXT" & Chr$(0)

    Filter$ = Filter$ & "Batch(*.bat)" & Chr$(0) & "*.BAT" & Chr$(0)

    Filter$ = Filter$ & Chr$(0)

    '* Allocate string space for the returned strings.

    FileName$ = Chr$(0) & Space$(255) & Chr$(0)

    FileTitle$ = Space$(255) & Chr$(0)

    '* Give the dialog a caption title.

    Title$ = "My File Open Dialog" & Chr$(0)

    '* If the user does not specify an extension, append TXT.

    DefExt$ = "TXT" & Chr$(0)

    '* Set up the defualt directory

    szCurDir$ = CurDir$ & Chr$(0)

    '* Set up the data structure before you call the GetOpenFileName

    OPENFILENAME.lStructSize = Len(OPENFILENAME)

    OPENFILENAME.hwndOwner = Screen.ActiveForm.hWnd

    OPENFILENAME.lpstrFilter = lstrcpy(Filter$, Filter$)

    OPENFILENAME.nFilterIndex = 1

    OPENFILENAME.lpstrFile = lstrcpy(FileName$, FileName$)

    OPENFILENAME.nMaxFile = Len(FileName$)

    OPENFILENAME.lpstrFileTitle = lstrcpy(FileTitle$, FileTitle$)

    OPENFILENAME.nMaxFileTitle = Len(FileTitle$)

    OPENFILENAME.lpstrTitle = lstrcpy(Title$, Title$)

    OPENFILENAME.Flags = OFN_FILEMUSTEXIST Or OFN_READONLY

    OPENFILENAME.lpstrDefExt = lstrcpy(DefExt$, DefExt$)

    OPENFILENAME.hInstance = 0

    OPENFILENAME.lpstrCustomFilter = 0

    OPENFILENAME.nMaxCustFilter = 0

    OPENFILENAME.lpstrInitialDir = lstrcpy(szCurDir$, szCurDir$)

    OPENFILENAME.nFileOffset = 0

    OPENFILENAME.nFileExtension = 0

    OPENFILENAME.lCustData = 0

    OPENFILENAME.lpfnHook = 0

    OPENFILENAME.lpTemplateName = 0

    '* This will pass the desired data structure to the Windows API,

    '* which will in turn it uses to display the Open Dialog form.

    APIResults% = GetOpenFileName(OPENFILENAME)

    If APIResults% <> 0 Then

        '* Note that FileName$ will have an embedded Chr$(0) at the

        '* end. You may wish to strip this character from the string.

        Message$ = "The file you chose was " + RTrim$(FileName$)

    Else

        Message$ = "No file was selected"

    End If

    MsgBox Message$

End Function

Reference(s):

"Microsoft Windows Software Development Kit Programmer's Reference,

Volume 2: Functions," version 3.1

References


INF: Example Has Wrong Number for Dlookup Ship Postal Code

 Article Number: Q96116

 CREATED: 08-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

The example given on page 145 of the "Microsoft Access Language

Reference" shows a number for Ship Postal Code that does not exist in

the sample database Northwind Traders (NWIND.MDB). The sentence reads

as follows:

   In the following example from the Orders table of the NWIND.MDB

   database, Ship Postal Code is the name of a field, and 98008 is a

   string literal.

It should read:

   In the following example from the Orders table of the NWIND.MDB

   database, Ship Postal Code is the name of a field, and 94117 is a

   string literal.

Reference(s):

"Microsoft Access Language Reference," version 1.0, page 145

References


PRB: NWIND.MDB Query with Criteria Displays Data in Odd Order

 Article Number: Q96419

 CREATED: 16-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you create a query to display the the Category Name from the

   the sample database Northwind Traders (NWIND.MDB) Categories table,

   the results appear in an order different than what is in the table.

   Even though the natural order of the Categories table is Beverages

   then Seafood, the query datasheet shows the opposite order.

CAUSE

   The query will determine the fastest way to obtain the data.

   The order in which the records appear in the table may not be the

   logical order. This will result in an "odd" order returned by the

   query.

RESOLUTION

   In the query you should choose the sort order you want to see the

   data displayed. Choose Ascending sort order for the Category Name

   field to have the names listed in alphabetical order.

STATUS

   This behavior is by design.

More Information:

Unless you specify the sort order in your query, there is the

possibility that data will appear out of order.

Steps to Reproduce Behavior

---------------------------

Follow these steps in the sample database Northwind Traders

(NWIND.MDB):

1. Create a new query based on the Categories table.

2. Drag the Category Name field onto the QBE grid.

3. Enter "Like BEV* OR SEAF*" (without the quotation marks) in the

   Criteria Row.

4. Run the query.

The resulting dynaset will put "Seafood" above "Beverages," even

though the table order is different.

References


PRB: Objects Cannot Be User-Defined Data Type Elements

 Article Number: Q96420

 CREATED: 16-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You will receive the following error message when attempting to use

   a Microsoft Access defined object data type as a user-defined data

   type element:

      Expected: Integer or Long or Single or Double or Currency or String

      or Variant or Identifier.

CAUSE

   Objects predefined by Microsoft Access are not supported as user-

   defined data type elements.

STATUS

   This behavior is by design.

More Information:

Microsoft Access defines eight object data types: Control, Database,

Dynaset, Form, QueryDef, Report, Snapshot, and Table. You can use the

Type statement in the Declarations section of a module to define your

own data type. The user-defined data type cannot be one of the eight

predefined data types.

Steps to Reproduce Behavior

---------------------------

1. Create a new module.

2. In the Declarations section, attempt to define a structure as

   follows:

      Type ControlInfo

        Ctl as Control

      End Type

3. From the Run menu, choose Compile All.

   You will receive the above error message.

For more information, search for "Type Statement," then "Object Data

Types" using the Help menu.

Reference(s):

"Microsoft Access Basic: An Introduction to Programming," version 1.0,

Chapter 5, "Variable, Constants, and Data Types," page 43

References


PRB: Properties Don't Reset Between Crosstab and Make Table

 Article Number: Q96456

 CREATED: 17-MAR-1993

 MODIFIED: 18-JUN-1993

Summary:

SYMPTOMS

   When you choose Crosstab as the query type, by default all columns in

   the QBE grid have Group By in the Totals section. If you change the

   query type to Make Table, these column properties do not change.

CAUSE

   When you change the query type, Microsoft Access removes the rows that

   are not allowed and displays rows that are required. Any other rows

   that are optional remain on the QBE grid. In this situation, the new

   Group By clause does not change the new table.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

--------------------------

1. Open the Northwind Traders sample database (NWIND.MDB).

2. Create a new query.

3. Add the Employee Sales for 1991 table.

4. Bring the first two fields from the Field List down to the QBE

   grid.

5. From the Query menu, choose Crosstab.

6. From the Query menu, choose Make Table.

7. Type a table name in the Query Properties dialog box.

Notice that the Group By attribute remains in the Total property.

References


PRACC316: Can't Paste Column If Focus Is on One Cell in Query

 Article Number: Q96457

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you cut or copy a query grid column, you can paste it back in only

   if a column is selected. If there is no selection (that is, the focus

   is in a single cell), the Paste command is enabled and all information

   is erroneously pasted into one cell.

CAUSE

   Currently Microsoft Access does not differentiate between a multi-line

   piece of text and a grid column in the Clipboard.

STATUS

   We are researching this problem and will post new information here in

   the Microsoft Knowledge Base as it becomes available.

References


INF: Functions to Left and Right Pad Character Strings

 Article Number: Q96458

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

An imported file may contain field values that have a combination of

numeric and alphabetic characters. These fields do not sort in proper

order if they contain variable numbers of characters. This article

describes functions that you can use to pad these values with a

selected character to produce values of consistent length.

Note: This article assumes that you have understanding of Access Basic

code and know how to use Access Basic procedures.

More Information:

Suppose you have a table that contains Customer ID numbers with values

entered as follows:

   Customer ID

   -----------

   123B

   1231

   1231B2

   B123

In a query, these numbers would sort in ascending order as follows:

   Unpadded        Right Padded    Left Padded

   -------------------------------------------

   1231            123100          001231

   1231B2          1231B2          00123B

   123B            123B00          00B123

   B123            B12300          1231B2

Right padding does not change the sort order; however, it is useful if

you need to make all values a consistent number of characters. Left

padding, however, will allow proper sorting.

To create a left-padding function and a right-padding function, enter

the following code in a new or existing module in your database.

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

'*********************************************************************

'Declarations section of the module.

'*********************************************************************

Option Explicit

Dim x As Integer

Dim PadLength As Integer

'=====================================================================

'The following function will left pad a string with a specified

'character. It accepts a base string which is to be left padded with

'characters, a character to be used as the pad character, and a

'length which specifies the total length of the padded result.

'=====================================================================

Function Lpad (MyValue$, MyPadCharacter$, MyPaddedLength%)

   Padlength = MyPaddedLength - Len(MyValue)

   Dim PadString As String

   For x = 1 To Padlength

      PadString = PadString & MyPadCharacter

   Next

   Lpad = PadString + MyValue

End Function

'=====================================================================

'The following function will right pad a string with a specified

'character. It accepts a base string which is to be right padded with

'characters, a character to be used as the pad character, and a

'length which specifies the total length of the padded result.

'=====================================================================

Function Rpad (MyValue$, MyPadCharacter$, MyPaddedLength%)

   Padlength = MyPaddedLength - Len(MyValue)

   Dim PadString As String

   For x = 1 To Padlength

      PadString = PadString & MyPadCharacter

   Next

   Rpad = MyValue + PadString

End Function

The following example shows an update query that would modify the

Customer ID field by left padding the field with the 0 (zero)

character. You will use the Lpad function that was created in step #2.

   Update Query: Leftpad Customer Number

   -------------------------------------

   Field name: Customer ID

      Update to: Lpad([Customer ID],"0",6)

References


INF: Extend Mode and ESC in Form View

 Article Number: Q96459

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

The ESC key performs two different functions in Form view in Microsoft

Access. If you are in Extend mode, pressing ESC will exit Extend mode.

While entering data in a control, pressing ESC activates the Undo

feature and causes the data to be deleted. This can create a small

inconvenience when you are in Extend mode and doing data entry

simultaneously. Any effort to exit Extend mode by pressing ESC will

erase your data in the current control (the one with the focus) in

addition to leaving Extend mode.

References


PRB: Restore Macro Action Does Not Appear to Work

 Article Number: Q96460

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   In a macro, the Restore action does not restore a window previously

   minimized by the Minimize action.

CAUSE

   When an object is minimized in Windows, the focus is automatically

   shifted to the next window. The Restore action attempts to restore

   a window that is already in a restored condition.

RESOLUTION

   To make Windows act on the minimized object, you must first select

   the object. To select the minimized object, put a SelectObject

   action in the macro immediately before the Restore action.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Start Microsoft Access and open a database.

2. Create the following macro in a new macro group called Macro1:

      Macro Name     Action

      ---------------------

      Test1          Minimize

                     Restore

3. Create a new form called Form1 and place a command button on it.

   Give the command button the following properties:

      Object: Command Button

      ----------------------

      OnPush: [Macro1].[Test1]

4. Open Form1 in Form view and push the command button.

The form will minimize as expected, but will not restore.

References


PRB: List Box Does Not Scroll when Scroll Box Is Dragged

 Article Number: Q96461

 CREATED: 17-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

If you have a list box on a form with a vertical scroll bar, and

you attempt to drag the scroll box up and down the list box, the

list box contents will not scroll until the scroll box is dropped.

STATUS

This behavior is by design.

MORE INFORMATION

================

Steps to Reproduce Behavior

---------------------------

1. Create a form.

2. Place a list box control on the form with the following properties:

      Object: Listbox

      -----------------------

         RowSourceType: Value List

         RowSource: 1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0

3. View the form.

4. Drag the list box vertical scroll box up and down. The list box

   contents do not scroll until you release the scroll box.

References


INF: Misleading Documentation for Cancel Property

 Article Number: Q96462

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

The documentation for the Cancel property, as well as for the term

"Cancel" itself, is misleading. It implies that the purpose of the

Cancel property is to make it so that when the button with Cancel set

to Yes is chosen, the current record will be undone as if you chose

the Undo Current Record command from the Edit menu.

This is not true; in fact, the Cancel property plays a much smaller

role.

More Information:

The Help topic for the Cancel property states:

   Use the Cancel property to give the user the option of canceling

   uncommitted changes and returning the form to its previous state.

The actual purpose of the Cancel property is to execute the Cancel

button's OnPush event property when pressing the ESC key from anywhere

on the form.

References


INF: Using '<' and '>' and '=' Operators in Query Parameters

 Article Number: Q96463

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article describes a simple, non-programmatic way to allow a user

to type the comparison operators "<", ">", and "=" in query parameters.

Due to the nature of the method, query criteria should be kept as

simple as possible. For more complex criteria, you will have to use

Access Basic code.

More Information:

1. Create a table called Names with the following fields:

   Table: Names

   ------------

      Field: First Name

      DataType: Text

      Field: Last Name

      DataType: Text

      Field: Age

      DataType: Number

      Format: Single

2. Enter the following data:

   First Name   Last Name   Age

   ----------   ---------   ---

   Tom          Smith        35

   Anne         Howard        7

   Jim          Bowie        20

   Sue          Thomas       44

3. Create the following query based on the Names table:

   Query: List Names

   -----------------

      Field: First Name

      Field: Last Name

      Field: Age

         First Criteria Line: =Mid([Enter Age],2)

         Second Criteria Line: <Mid([Enter Age],2)

         Third Criteria Line: >Mid([Enter Age],2)

         Fourth Criteria Line: <leave blank>

         Show: True

     Field: Expr1:Left([Enter Age],1)

        First Criteria Line: "="

        Second Criteria Line: "<"

        Third Criteria Line: ">"

        Fourth Criteria Line: Is Null

        Show: False

The criteria are entered on successive lines (that is, "Criteria 1" is

entered on the "Criteria" line, "Criteria 2" is entered on the "Or"

line, and "Criteria 3" and "Criteria 4" are entered on the blank lines

below that).

Save the query and run it. Sample output is given for each of the four

types on input:

   [Enter Age]     Output

   -------------   --------------------------

   <leave blank>   Tom          Smith      35

                   Anne         Howard      7

                   Jim          Bowie      20

                   Sue          Thomas     44

   <21             Anne         Howard      7

                   Jim          Bowie      20

   >21             Tom          Smith      35

                   Sue          Thomas     44

   =7              Anne         Howard      7

Note: The query isn't designed to allow combinations of "<", ">", and

"=", such as ">=20". You must always use one of the three operators,

no more, no less, or you must leave the whole parameter blank.

The SQL for the query is given below:

   SELECT DISTINCTROW

      [First Name], [Last Name], Age

   FROM

      Names

   WHERE

      (Age=Mid([Enter Age],2) AND Left([Enter Age],1)="=")

   OR

      (Age<Mid([Enter Age],2) AND Left([Enter Age],1)="<")

   OR

      (Age>Mid([Enter Age],2) AND Left([Enter Age],1)=">")

   OR

      (Left([Enter Age],1) Is Null)

   WITH OWNERACCESS OPTION;

References


INF: A Query Within a Query to Simulate a Sub-select

 Article Number: Q96464

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article explains how to use the sample database Northwind Traders

(NWIND.MDB) to generate a list of customers who have used all three

shippers to deliver their orders.

More Information:

Create the following query (called Query1) based on the Customers

table and the Orders table. Here is the Structured Query Language

(SQL) statement from the View - SQL menu:

  SELECT  DISTINCT Customers.[Customer ID], Orders.[Ship Via]

  FROM Customers, Orders,

  Customers INNER JOIN Orders ON Customers.[Customer ID] =

  Orders.[Customer ID];

To complete this procedure interactively, use the following steps:

1. In the Database window, create a new query by clicking the Query

   button and then choosing the New option button.

2. In the Table/Query box, click the Customers table and choose the

   Add option button.  Then click the Orders table and choose the Add

   option button again.

3. Choose the Close option button. You have now added these tables to

   your new query and the tables are joined by the Customer ID field.

4. Click the Customer ID field from the Customers table and drag it to

   the first box in Field record on the grid.  Then click the Ship Via

   field from the Orders table and drag it to the second box in the

   Field record.

5. Save this query as Query1 and choose the Close option button.

Create a second query (sub-query) based on Query1. Here is the SQL

statement for the second query:

  SELECT  Query1.[Customer ID]

  FROM Query1

  GROUP BY Query1.[Customer ID]

  HAVING (((Count(Query1.[Ship Via]))=3));

To complete this procedure interactively, use the following steps:

1. Repeat step 1 in the procedure above to create a new query. Add

   Query1 as the source of your data.

2. Hold down the CTRL key and click both the Customer ID field and the

   Ship Via field from Query1. Drag these fields to the new grid.

3. From the Toolbar, choose the Sum button (looks like the Greek

   letter Epsilon).

4. In the Totals list box under the Customer ID field, choose Group

   By; under the Ship Via field, choose Count.

5. Clear the Show check box under the Ship Via field. Type "=3" in the

   Criteria record.

6. Save this query as Query2 and choose the Close option button.

When you run Query2, it will list those Customers that have used three

different shippers.

References


PRB: OLE Excel and WinWord Do Not Close when Form Is Closed

 Article Number: Q96465

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Microsoft Access will not close some OLE servers when the user

   closes a table, form, or report while editing an OLE object.

STATUS

   This behavior is by design.

More Information:

Microsoft Access will not close Multiple Document Interface (MDI)

applications, even if they were started as an OLE server for an object

stored in Microsoft Access. An MDI application can edit and display

multiple documents at once.

Microsoft Excel 3.0 and Microsoft Word for Windows 2.0 are examples of

applications that will be left running if you double-click on an

existing embedded object in Microsoft Access and then switch back to

Microsoft Access and close the table, form, or report without closing

the embedded object.

Steps to Reproduce Behavior

---------------------------

1. Open a form in Microsoft Access, and choose Insert Object from the

   Edit menu. In the list of available OLE servers, select Microsoft

   Excel Worksheet.

2. Create the object (worksheet) you want to embed. Once the object is

   completed, close Excel. Save the Access form and close it.

3. Reopen the form and double-click on the embedded object that you

   just created. Once Excel opens and the object is displayed,

   minimize Excel and close the Microsoft Access form. Excel will

   still be running. You must activate Excel and close it.

If you repeat these steps with applications such as Paintbrush,

Microsoft Draw, and Note-It (these are not MDI applications), you will

notice that these servers are closed when the object is closed.

References


INF: Installing Access on a DEC Pathworks Network

 Article Number: Q96466

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

To perform a network server installation of Microsoft Access on a DEC

Pathworks 4.x network, you must install to a File Services drive. You

cannot successfully complete a network installation to a Disk Services

drive.

Microsoft Windows considers DEC Pathworks 4.x Disk Service to be a

local disk drive. Windows considers DEC Pathworks 4.x File Service to

be a network drive.

References


PRACC9301: Access GP Faults in Datasheet View of a Form

 Article Number: Q96467

 CREATED: 17-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

You may receive the following error while switching your form to

Datasheet view:

   An error has occurred in your application. If you choose Ignore,

   you should save your work in a new file. If you choose Close,

   your application will terminate.

You will also receive the following message following the first

message:

   MSACCESS caused a general protection fault in MSACCESS.EXE.

CAUSE

You have a macro assigned to the OnCurrent property of the form

that has a GoToControl action that sets the focus to a control

located in the page header section of the form. There is no visible

page header section when you view the form in Datasheet view.

RESOLUTION

If you are using a GotoControl macro on the OnCurrent property

of a form that sets focus to a control located in the page header

section of the form, do NOT switch to Datasheet view or you will

receive the above error.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.10. We are researching this problem and will post new

information here in the Microsoft Knowledge Base as it becomes

available.

MORE INFORMATION

================

Steps to Reproduce Problem

--------------------------

1. Create a GotoControl macro that goes to any control on the form and

   assign to the OnCurrent property of a form.

2. Place this control in the page header section of the form.

3. Switch to Datasheet view. The above error will appear.

References


INF: Requirements to Connect to Sybase SQL Server

 Article Number: Q96468

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

The SQL Server ODBC driver that ships with Microsoft Access is

designed to work with both Microsoft SQL Server and Sybase SQL Server.

This article describes what is necessary to enable Microsoft Access

version 1.0 to work with Sybase SQL Server.

More Information:

The SQL Server ODBC driver works with both Microsoft and Sybase SQL

Servers. However, the Microsoft applications that shipped with the SQL

Server driver (Visual Basic version 2.0 and Microsoft Access) were

tested and verified with only Microsoft SQL Server. In the ODBC group,

we have done some limited interoperability testing with Sybase version

4.2 on the Sparc platform using Microsoft TCP/IP and the Sybase

Net-Library for this stack. We have not uncovered any significant

problems.

The following are the issues associated with using the Microsoft SQL

Server ODBC driver with Sybase:

 - The ODBC driver requires the catalog stored procedures that ship

   with SQL Server version 4.2a. Until the 4.9.1 Sybase release, these

   catalog procedures did not ship with Sybase servers. The

   INSTCAT.SQL script needs to be run against the Sybase server to

   install the catalog procedures. This is required to ensure the ODBC

   driver will work with Sybase servers. To make matters even more

   confusing, Sybase changed the system catalogs in the 4.8 release,

   requiring a modified script. This script is called INSTCAT.48, and

   is available through Microsoft Product Support and on CompuServe.

 - The SQL Server ODBC driver that ships with Microsoft Access and

   Visual Basic 2.0 comes with the Named Pipe Net-Library. To connect to

   Sybase, you need to use the SQL Bridge product, or buy the

   Net-Libraries from Sybase for each client machine. The only Sybase

   Net-Library that has gone through even minimal interoperability

   testing is the Microsoft TCP/IP Net-Library. Both Microsoft Access

   and Visual Basic 2.0 use the network in a way that is not typical

   of Windows applications (they use multiple simultaneous connections

   and use asynchronous calls). It is probable that there are network

   configurations in which Sybase Net-Libraries will fail with these

   products (Sybase probably does not test this sort of use of the

   Net-Libraries). Microsoft and Sybase are discussing how best to

   perform interoperability testing with the various network

   configurations supported by Sybase (FTP, Wollongong, Novell and

   other TCP/IP, DECnet, and so forth).

The following is a list of Net-Libraries that we know work with

Microsoft Access/ODBC and Sybase SQL Server (date of verification,

Feb. 10, 1993):

   Named Pipe Net-Libraries 1.0

   Novell LAN WorkPlace TCP 4.0 with 1.0 Net-Library

   NetWare (SPX) 1.0 Net-Library

   FTP 2.05 with Net-Libraries 1.0 and 1.0.1

   FTP 2.10 with Net-Library 1.0.1 EBF 1285

   Microsoft TCP/IP 1.0 with Net-Library 1.0.1

   NetManage TCP/IP 3.06 Net-Library 1.0 EBF 1326

   PC-NFS Net-Library 1.0 EBF 1334

The following is a list of Net-Libraries that we know DO NOT work with

Microsoft Access/ODBC and Sybase SQL Server:

   Wollongong Pathway Net-Library 1.0

Reference(s): Sybase net library netlib netlibs dlls

References


INF: Short Description of a Dynaset

 Article Number: Q96469

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

A dynaset is a Microsoft Access term for an updateable view. Rather

than storing the actual data locally for the view, pointers to the

data are stored locally in memory. Displaying the data in the view

involves using the pointers to get the data from the underlying

tables. Also, these pointers make it possible to update the data as

well.

References


INF: How to Determine when a Shelled Process Has Terminated

 Article Number: Q96470

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

The Shell() function initiates a process and returns to Access Basic.

The shelled process will continue indefinitely until you stop it.

Terminating Microsoft Access will not cause the shelled process to

terminate; however, you may not want this behavior if you want

Microsoft Access to wait until the shelled process has finished before

continuing. This article describes a method by which an Access Basic

program will wait until a shelled process has terminated.

More Information:

By using the Windows API functions GetActiveWindow() and IsWindow(),

your program can monitor the status of a shelled process. The API

function GetActiveWindow() should be called from within a loop after

the Shell() function to get the window handle of the main application

window for the shelled process. This will work correctly only if you

invoke the Shell() function using a window style with focus (that is,

window style 1, 2, or 3) and a main application window is displayed

for the shelled process. This routine will work when shelling to

Windows or MS-DOS programs. It will not work for applications that do

not display a window (such as applications that run invisibly in the

background).

By continually calling the API function IsWindow() from within a While

loop, you can make the Access Basic program wait until the shelled

process has terminated. The Windows API function IsWindow() simply

checks to make sure that the window associated with the handle found

with GetActiveWindow() is still a valid, existing window.

To create an example form that will start the example, create a form

with a command button on the form. Set the following properties of

the command button.

   Control: command button

   -----------------------

      OnPush: =Wait_Till_Shell_Done()

Below are the steps necessary to build an Access Basic function called

Wait_Till_Shell_Done() that uses the Shell() function to execute the

Windows Calculator accessory. The program is an example of how to use

the Windows API functions GetActiveWindow() and IsWindow() to wait

until a shelled process has terminated before resuming execution.

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

You may have some Windows API functions defined in an existing

Microsoft Access library, therefore your declarations may be

duplicates. If you receive the duplicate procedure name error, remove

or comment the particular declare statement from your code.

'=========================================

' General Declarations Section

'=========================================

Option Explicit

Declare Function GetActiveWindow% Lib "User" ()

Declare Function IsWindow% Lib "User" (ByVal hWnd%)

Declare Function FindWindow% Lib "User" (ByVal lpClassName As Any,_

                    ByVal lpWindowName As Any)

Function Wait_Till_Shell_Done ()

    Dim TimeOutPeriod%, r%

    Dim fTimeOut%, s!

    Dim AccesshWnd%, hWndShelled%

    Dim KeepWaiting%

   ' Maximum seconds to wait for application window to appear.

    TimeOutPeriod% = 5

   ' Must shell w/window style with focus, window style 1, 2, or 3.

    r = Shell("CALC.EXE", 1)

    fTimeOut% = False

    s! = Timer

    AccesshWnd% = kb_FindWindow("Omain", 0&)

   ' Wait for the application window of the shelled process

   ' to become active.

    Do

        ' Process Windows events for the shelled program.

        ' WARNING: Calling DoEvents allows the user to select any

        ' Window. If the user selects another window while in this

        ' routine, this routine will incorrectly treat that window as

        ' part of the shelled process.

        r = DoEvents()

        hWndShelled% = kb_GetActiveWindow()

        ' do while active window is the calling form...

        KeepWaiting% = hWndShelled% = Forms!form1.hWnd

        ' ...or do while Microsoft Access is the active window

        KeepWaiting% = KeepWaiting% Or (hWndShelled% = AccesshWnd)

        ' ...or do until exceeded the timeout waiting for program.

        KeepWaiting% = KeepWaiting% Or (s! < TimeOutPeriod)

    Loop While KeepWaiting%

   ' If a timeout occurred, display a timeout message and terminate.

    If fTimeOut% Then

       MsgBox "Timeout waiting for shelled application", 16

       End

    End If

   ' Wait until the shelled process has terminated.

    While kb_IsWindow(hWndShelled%)

      ' Process pending Windows events.

       r = DoEvents()

    Wend

    MsgBox "Shelled application just terminated", 64

    End

End Function

Reference(s):

Microsoft Windows 3.1 "Programmer's Reference, Volume 2: Functions"

References


PRACC9303: Error: Not Enough System Resources in Access

 Article Number: Q96471

 CREATED: 17-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

Running a Microsoft Access query can result in this error:

   Not enough system resources to update display.

CAUSE

Changing the Row Height and Font after initially running a query causes

this error to occur the next time that query is run.

RESOLUTION

Choose the OK button when you get the above error message. The query

runs and displays its results with the default settings. The next time

you run the query, no error will appear.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access version

1.0. This problem was corrected in Microsoft Access version 1.1.

MORE INFORMATION

================

Steps to Reproduce Problem

--------------------------

1. Open the sample database NWIND.MDB.

2. Run the Category List query. To run a query, choose the Query

   button in the Database window. Select the desired query, and then

   choose the Open button.

3. Choose Row Height from the Layout menu.

4. Change the setting to 12.0.

5. Choose Font from the Layout menu and change the font to Microsoft Serif

   and the font size to 10.

6. Switch the query to design mode and choose Run from the Query menu.

7. From the File menu, choose Close.

8. From the Database window, select the Category List query and

   choose Open.

The error message appears. After choosing the OK button (your only

option), you will see the query with the default row height, font, and

font point size. The next time you run the query, no error message

will appear.

References:

For more information on changing the row height in a query, search for

"Row Height command" then "Row Height Command (Layout Menu)" using

the Help menu.

For more information on changing the font in a query, search for "Font

command" then "Font Command (Layout Menu)" using the Help menu.

References


PRB: Navigation Button Unavailable in Main/Subform Wizard

 Article Number: Q96473

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you are using FormWizard to create a main/subform form, you

   cannot always use the FormWizard's navigation buttons to move

   backwards (to the previous Wizard screen).

RESOLUTION

   If you need to change the table or query upon which the main form

   is based, choose Cancel. You will need to restart the FormWizard.

More Information:

The FormWizard's navigation buttons (Back and Next) permit you to move

forward and backward within the FormWizard.

Note that you will be able to navigate backward to change the subform

source. It is only the main form source that you cannot navigate

backward to change.

References


PRACC9303: Access Cue Cards Don't Use Standard Windows Menu

 Article Number: Q96474

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

PROBLEM ID: 3998

SYMPTOMS

   When using Cue Cards in Microsoft Access, you might notice that the

   Control menu is not a standard Windows menu. For example, when you

   click a menu item to select it, it doesn't become highlighted.

RESOLUTION

   Although the Cue Cards Control menu does not look like the standard

   Windows menu, its functionality is not impaired. You are still able

   to select the menu items with your mouse.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access version

   1.0. We are researching this problem and will post new information here

   in the Microsoft Knowledge Base as it becomes available.

More Information:

The Control menu is the uppermost left-hand corner of a window. The

standard Windows Control-menu commands allow you to resize, move, maximize,

and minimize that window.

Steps to Reproduce Problem

--------------------------

1. From the Help menu, choose Cue Cards.

2. From the Cue Cards help screen, select "I'm Not Sure."

3. Click the Cue Cards Control-menu box (the upper-left corner of the

   Cue Cards window).

4. Select Minimize.

Although the word Minimize is not highlighted, the Cue Cards window will

become minimized.

Reference(s):

For more information about the elements of a standard Microsoft window,

see the "Microsoft Windows User's Guide." For Windows version 3.0, see

Chapter 2, "Basic Skills," pages 21-22. For Windows version 3.1, see

Chapter 1, "Windows Basics," pages 8-9.

References


INF: How to Convert to and from Unsigned Integers in
INF: How to Convert to and from Unsigned Integers in Access

 Article Number: Q96475

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

There are situations in which calling functions from external dynamic-

link libraries returns a 2-byte unsigned integer. Access Basic doesn't

support this data type. Correctly evaluating this data type requires

converting it from an unsigned integer to an Access Basic Long data

type.

Note: This article assumes that you are familiar with Access Basic and

how to create and use Access Basic procedures.

More Information:

The Access Basic integer data type has a range of -32,768 to 32,767.

An unsigned integer has a range of 0 to 65,536.

Access Basic uses the most significant bit to set the sign of the

value. Therefore, when a value exceeds 32,767, bit 16 is set to

reflect a negative number. To evaluate an unsigned integer, you must

manually adjust bit 16.

There are two methods you can use to convert to and from the unsigned

integer type to the Access Basic Long data type. The first method uses

basic arithmetic (65,536 is subtracted or added to the unsigned

integer). The second uses bit-wise operators. The arithmetic method

works as well as the bit-wise method; however, the arithmetic method

may be more readable, and the bit-wise method may be faster when

executed repetitively.

1. Open a new module or a previously created module and enter the

   following code:

'*************************************************************

'Declarations section of the module.

'*************************************************************

Option Explicit

'=============================================================

' Arithmetic Method:

' ------------------

' Create the following ar_ConvertFromUnsignedInteger& (Uint%)

'    and ar_ConvertToUnsignedInteger% (Bytes&) function in the

'    Module. This first function reads in an unsigned integer

'    and returns the converted value as a long. The second

'    function reads in a long a returns an unsigned integer.

'=============================================================

Function ar_ConvertFromUnsignedInteger& (Uint%)

   If Uint% < 0 Then

      ar_ConvertFromUnsignedInteger& = Uint% + 65536

   Else

      ar_ConvertFromUnsignedInteger% = Uint%

   End If

End Function

Function ar_ConvertToUnsignedInteger% (Bytes&)

   If Bytes& > 32767 Then

      ar_ConvertToUnsignedInteger% = Bytes& - 65536

   Else

      ar_ConvertToUnsignedInteger% = Bytes&

   End If

End Function

'=============================================================

' Bitwise Method:

' ---------------

' Create the following bw_ConvertFromUnsignedInteger& (Uint%)

'    and bw_ConvertToUnsignedInteger% (Bytes&) function in the

'    Module. This first function reads in an unsigned integer

'    and returns the converted value as a long. The second

'    function reads in a long a returns an unsigned integer.

'    The message box statement in the second function is used

'    to prevent an overflow message when the value passed to

'    the function is greater than 64 kilobytes.

' To illustrate what is taking place in the first bitwise function:

'    Uint% equals -23584, a value returned from an external dynamic

'    link library that is an unsigned integer and needs to be

'    converted to an long:

'        1010001111100000 (-23584)

'    AND   11111111111111 (7FFF)

'        ----------------

'          10001111100000 (41952)

'=============================================================

Function bw_ConvertToUnsignedInteger% (Bytes&)

   Dim x%

   If Bytes& > 65535 Then

      MsgBox "You passed a value larger than 65535"

      Exit Function

   End If

   x% = Bytes& And &H7FFF

   bw_ConvertToUnsignedInteger% = x% Or -(Bytes& And &H8000)

End Function

Function bw_ConvertFromUnsignedInteger& (Uint%)

   bw_ConvertFromUnsignedInteger& = Uint% And &HFFFF&

'-------------------------------------------------------------

' The &HFFFF& requires the & at the end of the hex number. This

'   qualifies the hex number as 32 bit versus 16 bit.

'-------------------------------------------------------------

End Function

Examples of Using These Functions:

----------------------------------

An external dynamic-link library requires and returns an unsigned

integer. The Declare statement looks like the following:

 Declare Function External_Call% Lib "your.dll" (ByVal ValueToPass%)

The Declare statement uses integer data types because Access Basic

doesn't support unsigned integers. However, the external dynamic-link

library doesn't know this and returns an unsigned integer that must be

converted for use; therefore, the code may appear as follows:

   x% = External_Call(bw_ConvertToUnsignedInteger%(41952))

   y& = bw_ConvertFromUnsignedInteger&(x%)

References


INF: Create a Function to Capitalize Words & Sets of Words

 Article Number: Q96476

 CREATED: 17-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

There is no built-in format or function in Microsoft Access that

capitalizes the first character of a word or set of words as does the

Microsoft Excel Proper function. However, you can do it by creating your

own Proper function in Access Basic. This article gives you the code you

need to do just that, create a multiple-word Proper function.

There are two flavors of the Proper function:

 - One to use in the AfterUpdate property of a Form control for data entry.

 - The other to use in calculated query fields, calculated controls on

   forms and reports, macro SetValue expressions, and Access Basic

   expressions.

To understand this article, you need to be familiar with Access Basic

and know how to create and use Access Basic procedures.

More Information:

'**********************************************************

'Declarations section of the module

'**********************************************************

   Option Explicit

'==========================================================

'The following function is designed for use in the AfterUpdate

' property of Form controls.

'Features:

'   1. Leading spaces do not affect the function's performance.

'   2. "O'Brian" and 'Wilson-Smythe' will be properly capitalized.

'Limitations:

'   1. It will change 'MacDonald' to 'Macdonald'.

'   2. It will change 'van Buren' to 'Van Buren'.

'   3. It will change 'John Jones III' to 'John Jones Iii'.

'==========================================================

   Function Proper (Field)

   Dim Temp$, C$, OldC$, i As Integer

   If IsNull(Field) Then

      Exit Function

   Else

      Temp$ = CStr(LCase(Field))

      OldC$ = " "  ' Initialize this to a single space (Chr$(32))

                   ' because the first letter needs to be capitalized,

                    ' but has no preceding letter.

      For i = 1 To Len(Temp$)

         C$ = Mid$(Temp$, i, 1)

         If C$>="a" And C$<="z" And (OldC$<"a" Or OldC$>"z") Then

            Mid$(Temp$, i, 1) = UCase$(C$)

         End If

         OldC$ = C$

      Next i

      Field = Temp$

   End If

End Function

How to use this Function in the AfterUpdate Property of a Control

-----------------------------------------------------------------

1. Create a form based on a table or query.

2. Type the following in he AfterUpdate property of a Text control:

   =Proper(<control name>)

   For example, if the ControlName is [Full Name], type:

   =Proper([Full Name])

How to Modify this Function for Expressions and Calculated Controls

-------------------------------------------------------------------

1. Enter the code shown above to create the Proper function.

2. Modify this section of code:

   If IsNull(Field) Then

      Exit Function

   to read:

   If IsNull(Field) Then

      Proper = Field

3. Modify this section of code:

      Field = Temp$

   End If

   to read:

      Proper = Temp$

   End If

Reference(s):

"Access Basic Language Reference," version 1.0, Part 2, "A-Z Reference."

For information on creating a single-word Proper function, query on the

following words in the Microsoft Knowledge Base:

   create and proper and function

References


PRB: Changes in Subform do not Update in Main Form

 Article Number: Q96477

 CREATED: 17-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

After editing a subform in a main form's design mode, the changes

do not take affect in until you close and re-open the main form.

STATUS

This behavior is by design.

RESOLUTION

After editing the subform in the main form's design mode, close and

save the subform. This takes you back to the main form's design mode.

Now click inside the subform control, and then press ENTER.

After clicking inside the subform control and then pressing the

ENTER key, your main form will reflect the changes that you just made

to your subform.

MORE INFORMATION

================

The following information walks you through both methods of viewing

changes that you make in a subform from the main form's design view.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database Northwind Traders (NWIND.MDB).

2. Open the Categories form in Design mode.

3. Select the Category ID control.

4. Double click anywhere inside the Categories Subform control. (This

   opens the Categories Subform in Design mode).

5. From the View menu, choose Field List.

6. Drag the English Name field from the Field List to the Categories

   Subform.

7. Exit and save the changes in the Categories Subform. (This puts you

   back in the Categories Form in Design Mode).

8. From the View menu, choose Form. (This puts the you in Form view).

   Notice that the field you added (English Name) is not in the subform.

   You must close the main form (Categories) and re-open it to see the

   field that you added to the subform or follow the steps outlined below.

9. Repeat steps #1-7 above, dragging down the Supplier ID field

   instead of the English Name field.

10. Select the Category ID field in the main form.

11. Click inside the Categories Subform control, and press the ENTER

    key. (Note: You cannot simply select the subform control and press

    ENTER. You must click inside the subform control.)

12. From the View menu, choose Form.

Notice that the field you added (Supplier ID) appears on the subform

without your having to close and then re-open the main form.

References:

"Microsoft Access User's Guide," version 1.0, Chapter 10, "Creating

Forms Based on More Than One Table" page 274.

References


PRB: Print Preview Displays Only First Line of Toggle Button

 Article Number: Q96543

 CREATED: 21-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you preview a form with a toggle button that contains text

   without any spaces, if the text is longer than the size of the toggle

   button, characters on the first line of the toggle button are

   correctly displayed, but the remaining lines are either missing or

   truncated. This happens when you use a Hewlett-Packard (HP) LaserJet

   IIISi printer and you have selected either of the following screen

   fonts: System or Microsoft Sans Serif.

CAUSE

   In print preview, the method to display some system fonts on toggle

   buttons is slightly different than the method used to actually print

   the buttons.

RESOLUTION

   Change the format of the toggle button control text to a printer font

   or a TrueType font.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create an unbound form named Test.

2. Place a toggle button control on your form. Do not change the

   default size of the toggle button.

3. From the View menu, choose Properties.

4. Type the word "Caption" (without the quotation marks) in the

   Caption property.

5. Switch to Form view. (Notice that the toggle button correctly wraps

   the text.)

6. From the File menu, choose Print Preview. Print preview truncates

   the letter "n." When you print the form, however, the text appears

   correctly.

References


INF: Using Microsoft Word to Edit & Spell Check a Memo Field

 Article Number: Q96544

 CREATED: 21-MAR-1993

 MODIFIED: 25-APR-1993

Summary:

You can use a word processor to edit memo fields stored in Microsoft

Access tables. Then you can check the spelling and grammar in your data.

This article describes how to use Microsoft Word for Windows to edit memo

fields. To make use of this article, you'll need to have some familiarity

with Access Basic.

More Information:

Note the following information before trying the example:

 - Microsoft Word for Windows must have the DOS TEXT Import/Export filter

   installed.

 - Only the most basic formatting will be preserved because memo fields

   don't support tabs, margins, fonts, or other fancy formatting.

 - Memo fields are limited to 32,000 characters (about 8-12 pages in

   Microsoft Word for Windows). Excess characters will be truncated.

 - This example is presented in the most simplest terms. If you open

   the Microsoft Word document and return to Microsoft Access before

   you save the file, you will receive an "Access denied" error message

   when the Access Basic code tries to open the document that is already

   currently open in Microsoft Word.

The following example uses the Employees table in the NWIND.MDB database.

1. Create the following function in a new module.

   '******************************************************

   'Declarations section of the module

   '******************************************************

   Option Explicit

   '=====================================================

   'The following function EditMemo calls Microsoft

   'Word for Windows

   '=====================================================

   Function EditMemo (MyEditBox As Control)

   Dim X%, LineInFile$, NewLine$, FileNum%, CarriageReturn_LineFeed$

   CarriageReturn_LineFeed$ = Chr$(13) & Chr$(10)

   FileNum% = FreeFile

   Open "TEMP.TXT" For Output As #FileNum

   'save the text to temporary file for Microsoft Word for Windows

   If Not IsNull(MyEditBox) Then

      Print #FileNum%, MyEditBox

   Else

      MsgBox "There is no text to edit.  Abort."

      Exit Function

   End If

   Close #FileNum%

   X% = Shell("WINWORD.EXE TEMP.TXT", 3)

   MsgBox "Press Any Key to Return" ' required to pause the function

   'Assume completion of the edits in Microsoft Word, now read the text

   'and place it back into the edit control

   FileNum% = FreeFile

   Open "TEMP.TXT" For Input As #FileNum%

   NewLine$ = ""

   Do While Not EOF(FileNum)

      Line Input #FileNum%, LineInFile$

      If NewLine$ <> "" Then

         NewLine$ = NewLine$ & CarriageReturn_LineFeed$

      End If

      NewLine$ = NewLine$ & LineInFile$

   Loop

   MyEditBox = NewLine$

   Close #FileNum%

   End Function

2. Create a new blank form and base it on the Employees table.

3. Place two text box controls (Last Name and Notes) on the form and

   assign the following properties:

   Object: Text box

   -----------------

   ControlName: Last Name

   ControlSource: Last Name

   Object: Text box

   -----------------

   ControlName: Notes

   ControlSource: Notes

   OnDblClick: =EditMemo([Notes])

4. Save the form and switch to Form view.

5. Double-click the memo field to launch Microsoft Word for Windows.

   You will be presented with the Convert File dialog window. Select

   Text Only and then choose the OK button.

6. Perform the operations you want to do.

7. Exit from Microsoft Word for Windows and save the document.

8. Microsoft Access loads the changes back into the memo field.

For a more elegant solution, one that replaces the MsgBox routine,

query on the following words in the Microsoft Knowledge Base:

   GetActiveWindow and IsWindow and FindWindow and Shell

References


PRB: Changed Field Names In Table Are Not Reflected In Query

 Article Number: Q96545

 CREATED: 21-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

ISSUE ID: 3531

SYMPTOMS

   If you create a query using an existing table and then change a

   field name in that table, the new field name does not show in the

   query grid when the query is reopened. The old field name in the

   query grid has been made into an expression similar to this:

      Expr1: TableName.[Old FieldName]

CAUSE

   Changes to table field names do not propagate up through the queries

   based on that table.

RESOLUTION

   Replace the new expression in the field cell of the query grid with

   the correct field name from the table. The field list in the upper

   half of the query will show the current field names.

STATUS

   This behavior is by design.

More Information:

This behavior actually preserves the original query so you can see

what was originally included in the query.

Steps to Reproduce Behavior

--------------------------

1. Create the following table. Save it, and enter a few records.

      Table: Table1

      -------------

      Field Name:  OldName

      DataType:    Text

2. Create the following query adding the table that you created in

   step 1.

      Query Name: Query1

      ------------------

      Field Name: OldName

      Show:       True

3. Run this query. Notice that data in the OldName field shows up in

   Datasheet view of the query.

4. Open Table1 in design view and change the field OldName to

   NewName. Close and save the table.

5. Open Query1 in Design view. Notice that the field cell now shows the

   following:

      Expr1: Table1.[OldName]

   If you run the query, this field will be blank. To correct this, choose

   NewName from the list in the field cell of the query.

References


INF: Recovering MDB File Larger Than the 128-Megabyte Limit

 Article Number: Q96550

 CREATED: 21-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

A Microsoft Access database (.MDB file) is limited to a maximum size of 128

megabytes. However, you can exceed this limit by importing large amounts of

data or by creating objects that cause the limit to be exceeded.

More Information:

In the event a Microsoft Access database exceeds the limit, here are

two options you can use to attempt to remedy the situation:

1. If you are able to open the database, export some of the objects to

   another database, and then delete them from the current database.

2. If you are unable to open the database, try to compact the database by

   using the Compact utility. It will work on files larger than 128

   megabytes, unlike the Repair utility.

Unfortunately, there are situations where neither one of these options will

work. If this is the case, you will be unable to recover the data.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Appendix A, page 663.

References


PRB: Label Is Placed Within Command Button on Forms

 Article Number: Q96573

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you place a command button on a form, a label is placed in the

   top left corner of the command button control, not to the left of

   the control as you might expect.

STATUS

   This behavior is by design.

RESOLUTION

   You can change the default AutoLabel property of the command button

   to No before creating a new button from the toolbox. New command

   buttons will not have a label created when they are placed on the

   form. Alternatively, you can move the label to a different location

   after the control has been created with a label.

   Refer to the "User's Guide" on how to change the default properties

   of a control.

More Information:

Steps to Reproduce Behavior

---------------------------

Follow these steps in the sample database Northwind Traders

(NWIND.MD):

1. Open the Suppliers form in Design view.

2. Select the command button tool from the toolbox.

3. Place this control anywhere on the form. The command button will

   display with a label in the top left corner.

Reference(s):

"Microsoft Access User's Guide," version 1.0, page 430

References


INF: General Number Format Ignores Decimal Number Setting

 Article Number: Q96574

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

When you place a text box control on a form or report bound to a

numeric field, if the control's Format property is set to General

Number, the DecimalNumbers property setting will have no effect. This

is because the General Number format displays only the number of

decimal places necessary for each value.

For more information, search for "General Number," then "Format

Property - Number and Currency DataTypes" using the Microsoft Access

Help menu.

References


INF: How to Use Access Basic to Derive Statistical Mode

 Article Number: Q96575

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article describes an Access Basic function that creates a

snapshot that determines the frequency of occurrences for all numbers

in a table.

The most frequently occurring number in a dataset is called the mode,

which is a measure of central tendency (a "middle" measure of a

dataset). The data set consisting of the numbers

   {1,1,2,2,2,3,6,100}

has a mode of 2, because it occurs three times in the set. The data

set consisting of the numbers

   {1,1,1,2,2,2,3,6,10}

is bimodal, and has modes of 1 and 2 (both numbers occur three time in

set).

This article assumes that you are familiar with Access Basic and how

to create and use Access Basic procedures.

More Information:

To create an Access Basic function that determines the mode, open a

new module or a previously created module and enter the following

code:

Note: In the following sample code, an underscore (_) is

used as a line continuation character. Remove the underscore

when re-creating this code in Access Basic.

'*************************************************************

'Declarations section of the module.

'*************************************************************

Option Explicit

'=============================================================

' Create the following Mode() function in the Module

' The following function will initialize:

' - A variable for the database object.

' - A variable for the snapshot.

' - Sets the database object to the opened database.

' - Creates a snapshot based on the database object.

' - This function requires table and field name parameters where the

'     arguments are passed using "[" when the name includes spaces.

'=============================================================

Function Mode (tName$, fldName$)

   Dim ModeDB As Database

   Dim ssMode As Snapshot

   Dim ModalField1, ModalField2, ModalResult1, ModalResult2

   If tName$ = "" Or fldName$ = "" Then Exit Function

   Set ModeDB = CurrentDB()

   Set ssMode = ModeDB.CreateSnapshot("SELECT DISTINCTROW Count_

                   (" & fldName$ & ") AS Mode, " & fldName$ & " _

                   FROM " & tName$ & " GROUP BY " & fldName$ & " _

                   ORDER BY Count(" & fldName$ & ") DESC;")

   ModalField1 = ssMode(fldName$)

   ModalResult1 = ssMode!Mode

   ssMode.MoveNext

   ModalField2 = ssMode(fldName$)

   ModalResult2 = ssMode!Mode

      If ModalField1 <> ModalField2 Then

         Mode = "The Result is Modal: " & ModalResult1

      Else

         Mode = "The Result is Bimodal: " & ModalResult1 & _

                  " and " & ModalResult2

      End If

   ssMode.Close

   ModeDB.Close

End Function

Example of Using this Code

--------------------------

Create a form with text box controls that will reflect all measures of

central tendency of a data set. In the ControlSource property for the

text box control, enter:

   =Mode("TableName", "FieldName").

The value of this control will be the statistical mode of the data

set. Another way to use this function is to call it from within

another function that compares mode from different data sets. For

example:

Function CompareModes()

   Dim MyDB as Database

   .

   .

   .

   X = Mode("[TableName]", "[FieldName]")

   Y = Mode("[Table Name]", "[Field Name]")

   If X > Y Then Debug.Print "The mode for X is greatest."

End Function

References


INF: Using Parameterized Queries in  Basic
INF: Using Parameterized Queries in Access Basic

 Article Number: Q96576

 CREATED: 22-MAR-1993

 MODIFIED: 23-APR-1993

Summary:

When you are concatenating variables or controls in a function or

CreateDynaset method, you may get one of the following error messages:

   1 parameter expected only 0 supplied

   -or-

   Type Mismatch

This can result from including a variable or control name in the

function syntax, and Microsoft Access is unable to recognize the data

type, or the syntax for concatenating the variables is incorrect. This

article presents three examples of situations where these errors may

occur and how to correct them.

More Information:

Type Mismatch

-------------

You will get the "Type Mismatch" error message when you concatenate a

variable or control into a method or function that has a string data

type and you use it as a numeric data type. For example, the following

function will produce a "Type Mismatch" error message:

   Function MyFunction (DataToFind As String)

      Dim MyDB As Database, MySet As Dynaset

      Set MyDB = CurrentDB()

      Set MySet = MyDB.CreateDynaset("Employees")

      MySet.FindFirst "Title = " & DataToFind

The correct syntax for the last line is:

   MySet.FindFirst "Title = '" & DataToFind & "'"

Keep the following in mind:

 - When the criteria for an Access Basic function or method is a

   string data type, it requires a single quote around the string

   variable.

 - Numeric data types do not require any delimiters.

 - Dates require the number sign (#).

1 Parameters Were Expected, But Only 0 Were Supplied

----------------------------------------------------

You may get this error message when you use the CreateDynaset method

in Access Basic on an existing query. If the query is a parameterized

query you will need to explicitly declare the parameter and its data

type, and set the parameter value for that query in the function (see

page 137 of the Introduction To Programming manual). The code that

generates the error probably looks like the following:

   Function TestQP ()

      Dim MyDB As Database, MySet As Dynaset

      Set MyDB = CurrentDB()

      Set MySet = MyDB.CreateDynaset("Query1")

      Debug.Print MySet![First Name]; Tab(10); MySet![Last Name]

   End Function

When you are referring to a parameterized query, the correct syntax

is:

   Function TestQP ()

      Dim MyDB As Database, MySet As QueryDef, MyDyna As Dynaset

      Set MyDB = CurrentDB()

      Set MySet = MyDB.OpenQueryDef("Query1")

      MySet![Enter a Name] = "Dav*"

      Set MyDyna = MySet.CreateDynaset()

      Debug.Print MyDyna![First Name]; Tab(10); MyDyna![Last Name]

      MyDyna.Close

      MySet.Close

   End Function

You can also get the same error message when you concatenate a

variable into the SQL SELECT statement of a CreateDynaset method. The

correct syntax for this is:

   Set MySet = MyDB.CreateDynaset("SELECT * FROM Employees WHERE _

                    Employee ID] = " & Forms!Form1!Field0 & ";")

Note: The preceding statement should be entered on one line. An

underscore (_) is used as a line continuation character to improve the

readability of the code.

This SELECT statement points to a control on a form for the WHERE

clause.

References


PRB: Macro Condition Evaluates True if Control Is Null

 Article Number: Q96577

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A macro that conditionally checks the contents of a control on a

   form always evaluates True if the control is null.

RESOLUTION

   Include a StopMacro macro action with a condition to test the

   control for null. If the control is null, the macro will stop. If

   it is not null, the second macro action will occur. This will be

   the action you want to occur if your condition is met.

More Information:

If you do not test for the null condition, the macro will evaluate to

True.

Steps to Reproduce Behavior

---------------------------

1. Create a new unbound form named Form1.

2. Add a text box control to the form named Field0.

3. Create and save a new macro named Test.

      Macro Name    Condition           Action

      ----------------------------------------

      Test          [Field0] = "yes"    MsgBox

      MsgBox Arguments

      ----------------------------------------

      Message: The Answer is YES!

      Beep:  Yes

4. Switch back to Design view of Form1 and place a command button on

   the form. Set the OnPush property to the Test macro.

5. Switch to Form view and run the macro by choosing the command

   button. Note that Field0 is null. (The Msgbox should appear).

6. Type the word "NO" into Field0 and rerun the macro (no Msgbox will

   appear).

7. Type the word "YES" into the field and run the macro (Msgbox should

   appear).

   To correct this situation, change the Test macro so it includes the

   StopMacro action before the MsgBox action:

      Macro Name    Condition           Action

      ----------------------------------------

      Test          [Field0] Is null    StopMacro

                    [Field0] = "yes"    MsgBox

References


INF: Conversions for C Data Types in Access Basic

 Article Number: Q96578

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

This article describes some of the conversions between Access Basic

and C arguments.

More Information:

The following are general data type conversions:

   hWnd            ByVal var As Integer

   LPSTR           ByVal var As String

   hDC             ByVal var As Integer

   WORD            ByVal var As Integer

   DWORD           ByVal var As Long

   INT             ByVal var As Integer

   INT FAR *       var As Integer

   CHAR FAR *      ByVal var As String

   LONG            ByVal var As Long

   LONG FAR *      var As Long

   BYTE            ByVal var As Integer

   BOOL            ByVal var As Integer

   UNSIGNED SHORT  ByVal var As Integer

   UNSIGNED CHAR   ByVal var As Integer - must convert with Asc(var)

   UNSIGNED LONG   ByVal var As Long

The following list shows how to define the C data type in an Access

Basic data type:

   BYTE, BOOL            Var As String * 1

   LPSTR, CHAR FAR *     Var As Long       - Use API lstrcpy() to get

                                             the string pointer.

   anything FAR *        Var As Long       - This does not give the correct

                                             data type but contains the

                                             correct number of bytes; you

                                             may have to convert.

The following list describes the differences returned from a function:

   LPSTR               Function As Long    - Use lstrcpy() to get the

                                             string from the pointer.

References


PRB: SendKeys Macro Does Not Run

 Article Number: Q96579

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A macro including a SendKeys macro action does not run the SendKeys

   action.

CAUSE

   If the Wait argument for the SendKeys action is not set to Yes, the

   macro action is run after some delay. Depending upon the following

   macro action, the keystrokes that are sent may not be valid. If the

   keystrokes are not valid, the SendKeys action appears not to have

   been run.

RESOLUTION

   Set the Wait argument for the SendKeys action to Yes.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a macro named TestMacro.

      Macro Name         Action

      ---------------------------

      TestMacro          SendKeys

                         MsgBox

      TestMacro Actions

      ---------------------------

      SendKeys

         Keystrokes: %FX

         Wait: No

      MsgBox

         Message:  "HELLO WORLD"

2. Save the macro.

3. Run TestMacro.

   The first macro action should exit Microsoft Access. However, the

   Wait argument is set to No and the message box is activated before

   the SendKeys action is run. When the keystrokes are processed, they

   are not valid and you will hear beeping instead. If the Wait

   argument had been set to Yes, the SendKeys action would have been

   completed before moving to the next action, thus exiting Microsoft

   Access.

References


PRB: Invalid Reference to Field '<Value>' Using SetValue

 Article Number: Q96580

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You receive the following alert message when a SetValue macro

   action attempts to set the value of a control

      !  Invalid reference to field 'A'

   where "'A'" is a value in your SetValue expression.

CAUSE

   There is a leading equal sign (=) in the SetValue Expression

   argument. This causes the SetValue action to try to set the field

   value to an invalid expression.

RESOLUTION

   Remove the leading equal sign in the Expression argument.

More Information:

Removing the extra space before "B" will not solve the problem. That

merely changes the error message to refer to "Field AB."

Steps to Reproduce Behavior

---------------------------

1. Create a macro named My Macro with one action as follows:

      Macro Name         Action

      -------------------------

      My Macro           SetValue

      My Macro Actions

      ----------------

      SetValue

         Item: Field0

         Expression: ="A"+" B"

2. Create a new unbound blank form.

3. Place a command button on the form by dragging the macro named My

   Macro from the Database window onto the form.

4. Create a text box on the form. Verify that the ControlName is

   Field0.

5. Switch to Form view.

6. Click the command button to run the macro.

   You will receive the following error message:

      Invalid reference to field 'A'

Remove the equal sign from the Expression argument to allow this macro

to work correctly.

For more information, search for "SetValue" using the Help menu.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 538-539

References


INF: Join Type Mismatch Errors Caught at Runtime

 Article Number: Q96581

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access will not detect a type mismatch error for joins

created in a query until the query is actually run. This is

illustrated in the following example.

More Information:

Follow these steps in the sample database Northwind Traders

(NWIND.MDB):

1. Create a new Query.

2. Add the following two tables, Order and Product List.

3. Create a join between between the Employee ID field of Orders and

   the Product Name field of Product List.

4. Bring all fields from both tables into the Field Row of the QBE

   grid (refer to chapter 5 of the "User's Guide.").

5. From the Query menu, choose Run.

The query will run (no results returned), then return the following

error message:

   ! TYPE MISMATCH

Choose OK to clear the box (choosing the Help button will give you

information on the possible causes of this error).

It may not be obvious that the join is at fault because of the timing

of the error message (especially when querying large amounts of data

over a network).

This issue is one reason it is advantageous to create relationships

between tables before creating queries (refer chapter 3 of the

"User's Guide" for more information).

References


PRB: Alert Appears When it Shouldn't When Running a Macro

 Article Number: Q96582

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you create a macro but don't save it, and then try to run

   another macro from the File menu, the following message appears:

      ? Must save macro first. Save now?

   The Help option states that if you choose Cancel, you will be

   returned to the current macro window; however, this does not

   happen. If you choose the Cancel option from the message box, the

   macro list appears and you can choose another macro to run, without

   saving the first one.

RESOLUTION

   Microsoft recommends that you save your macro before you call

   another one to run.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a macro with a MsgBox action, close and save the macro.

2. Create another macro, but don't save it.

3. While you have the second macro open, choose Run Macro from the

   File menu.

4. When a message box prompts you to save the current macro, choose

   Cancel.

References


PRB: Unwanted Record Separator at the Bottom of a Subform

 Article Number: Q96583

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   In a main/subform, the bottom border of the subform appears to be

   painted even if the subform's Border property is set as "clear".

CAUSE

   In actuality, what appears to be a border may really be a record

   separator.

RESOLUTION

   To resolve this situation, choose Size to Fit from the Layout menu

   for the subform. This is done while you are in Design view of the

   main form and the subform control has been selected.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Open the form in Design view.

2. Click on the name of the embedded subform.

3. Choose Palette from the View menu, or click the Palette button on

   the toolbar.

4. You can check or clear the Border property Clear check box, but

   the border of the subform remains unchanged.

References


INF: Sample Preview Ignores Query

 Article Number: Q96584

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

When you choose Sample Preview from the File menu, Microsoft Access

ignores any query that your report is based on. Use Sample Preview to

check the general layout of your report, but use Print Preview to

check the data in your report.

More Information:

The Sample Preview option for reports provides an accurate view of the

layout of the report. However, the Sample Preview option ignores any

criteria or joins in the underlying query upon which the report is

based. The option is designed as a speed enhancement to view the look

and feel of you report.

The data that you will see displayed in this Sample Preview is based

directly on the table used in the report's underlying query. If more

than one table is in this query, the Sample Preview will erroneously

combine records from the two tables.

Reference(s):

"Microsoft Access Users Guide," version 1.0, Chapter 17, "Report

Basics", page 406

References


PRB: Form Opens Blank Except for Header

 Article Number: Q96585

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You open a form in Form view and it is completely blank. There are

   no controls or text; everything is blank except for the form

   header.

CAUSE

   The form footer may be too large for the form, and it may be

   covering the entire detail section when you view the form.

   Also, if you have a form that is read-only and there is no data in

   the underlying dynaset, no controls will be shown.

RESOLUTION

   If the problem is with the form footer, shorten the footer to allow

   only enough space for any controls that may appear there.

   In the case of no data, controls in the form footer or header will

   be visible.

More Information:

There are other reasons that a form may open and appear to be blank.

Typically, this happens because the dynaset contains no records, or

privileges have been limited. However, an oversized form footer can

also cause this to occur.

Steps to Reproduce Behavior

---------------------------

The following steps are based on the sample database Northwind Traders

(NWIND.MDB):

1. Open the Categories form in Design view.

2. From the Layout menu, choose Form Hdr/Ftr to add a header and

   footer to the form.

3. Extend the length of the footer to 5 inches (place no controls in

   the footer.

4. View the form in Form view. You should see a "blank form" that is

   actually the entire empty footer section.

   For more information on why a form may appear blank when opened in

   Microsoft Access, query on the following words in the Microsoft

   Knowledge Base:

      completely and blank and form

References


PRACC9303: Orders Form Doesn't Print/Preview SubTotal & Total

 Article Number: Q96586

 CREATED: 22-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

You have a main form and a subform, and in the subform you have a

control that uses an aggregate function, such as Sum(), to

calculate a value. On the main form, you have a control set to this

subform control. When the main form is displayed in Form view, the

control on the main form displays the correct value. However, when

you switch the main form to Print or Print Preview, this control is

blank.

For example, look at the Orders form included in the sample

database NWIND.MDB. Note the Subtotal and Total fields. In Form

view, these fields display values. When you switch to Print

Preview, these values do not appear.

CAUSE

If the subform is displayed in Datasheet view, any main form

controls that refer to aggregate calculated subform controls do not

get repainted.

RESOLUTION

Display the subform as a continuous form, or use a domain aggregate

function in the subform control. (See below for more information on

these workarounds.)

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.

MORE INFORMATION

================

To work around this problem, you can either use a continuous form

instead of a datasheet in the subform, or replace the aggregate

function with a domain aggregate function in the subform control.

In the form named Orders Subform, a text box control named Order

Subtotal is calculated by using the following aggregate expression:

   =Sum([Extended Price])

On the form named Orders, the Subtotal control refers to this

calculated subform control. The Orders form displays the Subtotal

value but does not display the value in Print Preview.

Workaround 1

------------

1. Open the Orders Subform in Design view and change the ViewsAllowed

   property to Both and the DefaultView property to Continuous Forms.

2. Close and save the Orders Subform.

3. Open the Orders form. Note that the Subtotal and Total fields are

   correct. Switch to Print Preview and these amounts are now

   displayed.

   Note: You will probably want to rearrange the detail section of

   Orders Subform so it displays properly in the Orders form.

Workaround 2

------------

1. Open the Orders Subform in Design view.

2. Change the text box control named Order Subtotal to the following:

   Note: In the following sample code, an underscore _ is used as a

   line continuation character. Remove the underscore when re-creating

   this code in Access Basic.

      Object: text box

      ----------------

      ControlName: Order Subtotal

      ControlSource: =DSum("[Extended Price]","[Order Details2]", _

                         "[Order ID]=Forms![Orders].[Order ID]")

3. Close and save the form.

4. Open the Orders form in Form view.

Note how the Subtotal and the Total controls display the correct

values in both Form view and Print Preview.

References


PRB: Join Is Broken by Value(s) in Fields '[Field Name]'

 Article Number: Q96587

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When adding records to a table, the error message

      Join is broken by value(s) in field '[Field name]'

   is displayed when you attempt to commit the record by either moving

   off of the current record or by closing the dynaset.

CAUSE

   Referential integrity rules have been violated. You are editing

   data based upon a query and the fields you are editing come from

   the "one" side of the relationship.

STATUS

   This behavior is by design.

RESOLUTION

   When editing records in a query, only edit fields that come from

   the "many" side of the relationship.

More Information:

The error message occurs when referential integrity is violated. If a

field is being updated on the "many" side of a relationship and does

not have a match on the "one" side of the relationship, an "orphan" is

produced, which violates referential integrity. Similarly, a record

cannot be deleted from the "one" side of a relationship if matching

records exist on the "many" side.

Steps to Reproduce Behavior

---------------------------

Follow these steps in the sample database Northwind Traders

(NWIND.MDB)

1. Open the Query named Order Information.

2. From the Records menu, choose GoTo, and select New.

3. Input a new Order ID and Customer ID. Enter a value in the Customer

   ID field that does not exist in the Customers table.

4. Press the DOWN ARROW key to move to a new record.

The following error message will be displayed:

   Join is broken by value(s) in fields 'Customer ID'

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 3, "Changing and

Customizing Tables," page 54

References


PRB: Macro Condition Example Using COUNT() Is Incorrect

 Article Number: Q96588

 CREATED: 22-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

Page 519 of the "Microsoft Access User's Guide" gives examples of

valid conditions to be used in the condition column in the Macro

window. The last example shows the following:

   COUNT(Order_ID) > 35

This condition will result in the error "Can't parse expression."

You could correct the parsing error by adding square brackets and

replacing the underscore with a space:

   COUNT([Order ID]) > 35

You will now get this error message:

   Function isn't available in expressions.

RESOLUTION

To see if the total number of entries in the Order ID field is

greater than 35, you should use the DCOUNT() function in a macro

expression.

   DCOUNT("[Order ID]","Orders") > 35

If there are more than 35 entries in the Order ID field of the

Orders table, the expression above will return TRUE.

References:

For more information, search for "DCOUNT" using the Microsoft Access

Help menu.

"Microsoft Access User's Guide," version 1.0, Chapter 21, "Macro

Basics," page 519

References


PRB: 'Couldn't Find Object [Object Name]'

 Article Number: Q96589

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

If you get the following error message

   Couldn't Find Object [object name]

use the following to troubleshoot the problem:

 - First check to ensure that [object name] exists. It could be a

   table, a query, or an SQL statement. If it does not exist, you must

   remove all references to it from your application. Often, the

   RecordSource property of a form or report will contain a reference to

   an object whose name has changed or has been deleted.

 - If [object name] exists, then it is likely that there is a syntax

   or spelling error in the reference to it.

References


INF: Determine How Many Instances of Application Are Active

 Article Number: Q96591

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

You can use Windows API calls in Access Basic to determine how many

times, or instances, an application is running. You can use this to

prevent re-entrance of an application that is already running to

determine how many instances of an application are active, or to start

a loop that you remain in until the application quits.

This article assumes that you are familiar with Access Basic and how

to create and use Access Basic procedures.

More Information:

This article outlines three uses of two Windows APIs in Access Basic.

Open a new module or a previously created module and enter the

following code:

' Note: Each command should be entered on one line. An underscore (_)

' is used as a line continuation character; keep that code on one line.

'------------------------------------------

'Global Declarations Section Of The Module.

'------------------------------------------

Option Explicit

Declare Function GetModuleHandle% Lib "Kernel" (ByVal lpModuleName$)

Declare Function GetModuleUsage% Lib "Kernel" (ByVal hModule%)

1. Prevent re-entrance:

'------------------------------------------------------------------

' The following function will test for re-entrance and return

' True if there is already an instance of the application active,

' or it returns False. This function requires an argument that is

' the name of the application.

'------------------------------------------------------------------

   Function TestForReentrance% (ApplicationName$)

      If ApplicationName$ = "" Then Exit Function

      If GetModuleUsage(GetModuleHandle(ApplicationName$)) Then _

            TestForReentrance = True

   End Function

Example of Using this Code

--------------------------

You can use this function to keep from starting an application that

is already running

   Function RunMyApp$ (szAppToRun$)

      Dim x%

      If Not TestForReentrance(szAppToRun) Then

         x = Shell(szAppToRun)

         Exit Function

      End If

      RunMyApp = "AppToRun is presently active."

   End Function

and a call to this in the Immediate window such as:

   ?RunMyApp$("Clock.exe")

2. Count the number of instances:

'------------------------------------------------------------------

' The following function will return the number of instances of an

' application that are currently active.

'------------------------------------------------------------------

   Function CountInstance% (szAppName$)

       CountInstance = GetModuleUsage(GetModuleHandle(szAppName))

   End Function

3. Remain idle until an application quits:

'------------------------------------------------------------------

' The following function will attempt to start an MS-DOS application

' and remain in a loop until that application quits.

'------------------------------------------------------------------

   Sub RunDosAppUntil (szAppToRun$)

      Dim hMod%

      hMod% = Shell(szAppToRun, 1)

         If (hMod% > 32) Then

            While (GetModuleUsage(hMod%))

               DoEvents

            Wend

         Else

           MsgBox "Unable to start the Application"

        End If

   End Sub

References


PRB: Page Hdr/Ftr Is Not Under View Menu

 Article Number: Q96592

 CREATED: 22-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Page 474 of the Microsoft Access "User's Guide" says to remove the

   page header and footer from a report by going to the View menu and

   choosing Page Hdr/Ftr. This option is not under the View menu, but

   rather the Layout menu.

RESOLUTION

   The last two sentences of this paragraph read as follows:

      Remove the page header and footer. (From the View menu, choose

      Page Hdr/Ftr.)

   They should read as follows:

      Remove the page header and footer. (From the Layout menu, choose

      Page Hdr/Ftr.)

Reference(s):

Microsoft Access "User's Guide," version 1.0, page 474

References


PRB: System Defaults Not Showing in Imp/Exp Setup

 Article Number: Q96890

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you choose the Imp/Exp Setup command from the File menu, the

   Leading Zeros in Dates and Four Digit Years check boxes do not take

   the defaults from the Microsoft Windows system settings found in

   Control Panel.

CAUSE

   The Control Panel doesn't have a date setting that corresponds to

   the Leading Zeros setting used in Microsoft Access dates. The

   Windows setting has one for day and one for month, which do not

   have to be the same.

RESOLUTION

   This behavior by design.

References


PRB: TransferSpreadsheet Action Doesn't Add File Extension

 Article Number: Q96891

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The TransferSpreadsheet action requires a file type and filename to

   export data to a spreadsheet. The filename tells Microsoft Access

   what to name the spreadsheet file that will hold the exported data.

   If you do not specify an extension in this filename, Microsoft

   Access will not add the appropriate extension for the file format

   to which you are exporting.

RESOLUTION

   This is by design. By not automatically writing a file extension,

   you are able to specify any extension you like (for example, .EXE,

   .DAT, and .INI).

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a Table called Table1 and add some fields and example data.

2. Create the following macro:

      Macro Name      Action

      ----------------------

      Transfer It     TransferSpreadsheet

      Transfer It Actions

      ----------------------

      TransferSpreadsheet

         Transfer Type: Export

         Spreadsheet Type: Microsoft Excel

         Table Name: Table1

         File Name: TestIt

         Has Field Names: No

3. Run the above macro.

   A Microsoft Excel spreadsheet file will be created in the current

   directory and the file will be called TESTIT, not TESTIT.XLS.

Reference(s):

"Microsoft Access Language Reference," version 1.0, pages 476-479

References


INF: Page Locking, No Cluster Indexing Support

 Article Number: Q96892

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

Cluster indexing and row level locking is not possible with Microsoft

Access version 1.0, unless you are using an attached table.

More Information:

This not supported because of the variable length architecture. When

using an attached table, Microsoft Access will use the same locking

scheme as the native product. This means when you are using the

installable ISAMs for DBase, Paradox, and Btrieve, you will do record

level locking. The Paradaox ISAM will even understand the clustered

indexes and use the advantages of these indexes in some queries.

References


PRACC9303: Setting OLE Object Property May Cause GP Fault

 Article Number: Q96893

 CREATED: 30-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

Microsoft Access will produce a general protection (GP) fault if the

OLEDATA property is set to a null value or an invalid object.

CAUSE

OLEDATA is a property of an unbound embedded object used in either

a form or report. The property is not available in the Object

Properties dialog box; it is set by Microsoft Access and can only

be modified using Access Basic code.

If the OLEDATA property is set to an invalid object, Microsoft

Access will display the error "Not a valid OLE object." Microsoft

Access will allow you to exit the dialog box and continue to work

in design mode. The frame will remain in the form or report;

however, since its link is broken, it will be dimmed. Access will

produce a GP fault when leaving design mode to display the form in

view mode, or the report in print preview mode.

If the OLEDATA property is set to null, Access will display the

error "The setting you entered isn't valid for this property" and

produce a GP fault upon exiting the dialog box.

RESOLUTION

Setting the embedded objects Visible property to False will

suppress the display of the object.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.

MORE INFORMATION

================

Any unbound embedded object inserted with the Paste, Paste Link*, or

Paste Special* command is subject to the GP fault if the OLEDATA

property is set to a invalid object.

Steps to Reproduce Problem

--------------------------

 1. Using Paintbrush, open any .BMP file.

 2. Select the object and copy it to the Clipboard.

 3. Exit Paintbrush.

 4. Open Microsoft Access and create a new database.

 5. Create a new form.

 6. In the form's Design view, paste in the object.

 7. Leave the form open and go to the Database window.

 8. Create a new module.

 9. Open the Immediate window.

Option 1

--------

10. Enter the following command:

       Forms![Form1]![Embedded0].OLEDATA=NULL

    Microsoft Access will display the following error:

       The setting you entered isn't valid for this property.

11. Choose the OK button.

    Microsoft Access will GP fault.

Option 2

--------

12. Enter the following command:

       Forms![Form1]![Embedded0].OLEDATA="X"

    Microsoft Access will display the following error:

       Not a valid OLE object

13. Choose the OK button.

14. Go back to Form1.

15. Switch to the form's View window.

    Microsoft Access will GP fault.

References


PRB: Switching Modes Disables Undo

 Article Number: Q96894

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you place a new control on a form and switch to Form view to see

   it, you cannot choose Undo Create from the Edit menu when you go

   back to Design view. Instead, Can't Undo is available, even though you

   have not made any changes since adding the control.

CAUSE

   Switching to Form view is considered a change, thereby nullifying

   the Undo option.

STATUS

   This behavior is by design.

More Information:

If you create a form and add a control, you can choose the Undo Create

command from the Edit menu to remove the control that you have just

created. However, if you switch to Form view to see your modified

form, and then switch back to design mode, the Undo Create option

is no longer available. Immediately after you make a change, you can

reverse it until you make another change. Switching to Form view is

considered a change. Thus, you cannot undo the creation of the

control, and the Edit menu list displays Can't Undo.

For more information, search for "undo timeout," then "undoing

changes" in the Microsoft Access Help menu.

References


PRB: ORDER BYs Must Be Output Columns in DISTINCT Queries

 Article Number: Q96895

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you create a query and use the DISTINCT predicate in conjunction

   with the ORDER BY clause, the fields that are being ordered must be

   output columns. If the ORDER BY fields are not output columns, you

   will receive the following error message:

      ORDER BY clause [Table Name].[Field Name] conflicts with DISTINCT

RESOLUTION

   Use the DISTINCTROW predicate.

More Information:

Steps to Reproduce Behavior

---------------------------

Follow these steps in the sample database Northwind

Traders(NWIND.MDB):

1. Create a new query and add the Employees table.

2. Place the Last Name and First Name fields in the query grid.

      Query: MyQuery

      -------------------------

      Field Name: Last Name

         Sort: Ascending

         Show: False

      Field Name: First Name

         Show: True

3. From the View menu, choose SQL command. Modify the SQL statement as

   follows:

      SELECT DISTINCT

         [Employees].[First Name]

      FROM [Employees]

      ORDER BY

         [Employees].[Last Name];

4. Run the query.

   The following error will be displayed:

      ORDER BY clause (Employees.[Last Name]) conflicts with DISTINCT

   To resolve this, you must Show the Last Name field.

References


PRB: Raised and Sunken Check Box and Option Button Controls

 Article Number: Q96896

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Raised check boxes and option buttons are indistinguishable from

   sunken check boxes and option buttons on both forms and reports.

STATUS

   This behavior is by design.

More Information:

You can specify three different appearances for controls on your forms

and reports: Normal, Raised, and Sunken. Check box controls and option

button controls allow you to specify these different appearances, but

raised and sunken are displayed identically.

Steps to Reproduce Behavior

---------------------------

1. Create a blank unbound form.

2. In Design view add three check box controls to the form.

3. Add three option button controls to the form.

4. Select the Palette button and make one of the check boxes and one

   of the option buttons sunken. Leave one of each normal. Make one of

   each raised.

5. Switch to Form view. Compare the raised controls to the sunken

   controls.

   Notice there is no difference between the controls.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 12, "Using

Special Design Effects on Forms and Reports"

"Microsoft Access User's Guide," version 1.0, page 306

References


PRB: Operation Stops when Editing Attached SQL Tables

 Article Number: Q96897

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Microsoft Access may return an inconsistent value for a floating

   point field in an SQL table when it checks the value of the field

   before editing and before updating. This can result in the error

   message

      Data Has changed:Operation Stopped

   when trying to update a record in an attached SQL table.

CAUSE

   The problem occurs if an SQL field data type is set to Float and

   the table does not contain a TimeStamp field or when an SQL

   indexed field data type is set to either DateTime or Float.

RESOLUTION

   To correct the problem:

   1. Remove the index from any fields with the DateTime or Float

      data types.

      To obtain information on any index within a SQL table, you can

      run the following system stored procedure within the System

      Administrator Facility (SAF):

         sp_helpindex <Table Name>

      To remove an index, use the following command:

         DROP INDEX <Table_Name.Index_Name>

      Note, you must be logged into the SQL server as either the Table

      Owner or the System Administrator.

   2. If other fields in the table have the Float data type, you must

      insert a TimeStamp field in the table. If a field with this

      data type is present, Access returns a consistent value for

      fields of this data type and will use the value in this field to

      verify whether the record has been modified.

      This can be accomplished by performing the following command

      within the SQL Server System Administrator Facility (SAF):

         ALTER TABLE <Table Name> ADD TimeStamp timestamp

      Please note that you must be logged in as either the database

      owner or the System Administrator to run the above command.

References


INF: Strange Stored Procedures Found in SYSOBJECTS Table

 Article Number: Q96898

 CREATED: 30-MAR-1993

 MODIFIED: 22-APR-1993

Summary:

Strange stored procedures are found in the SYSOBJECTS table in SQL

Server. Stored procedures with the general format ODBC#xxxxnnnnn are

found when querying the SYSOBJECTS table. For example, if you issue

the following query from SAF

   SELECT * FROM SysObjects WHERE Name LIKE "ODBC%"

you may see stored procedures as follows:

   ODBC#sa24518

   ODBC#sa2334

   ODBC#sa17854

This article describes these stored procedures and what you can do

about them.

More Information:

The stored procedures are created by ODBC for executing parameterized

queries. When Microsoft Access executes a query that is parameterized,

it calls the ODBC function SQLPrepare that creates these stored

procedures that are compiled. These stored procedures pass the proper

arguments to ensure proper execution.

These stored procedures are deleted under normal circumstances once

the ODBC connection is closed. If a crash or abnormal termination of

the ODBC connection occurs, it is possible that these stored

procedures will remain on the server. In this case, the stored

procedures can be removed without causing any problems.

To manually remove stored procedures, use SAF (SQL Administrator

Facility) to drop each procedure. The command syntax is\

   DROP PROCedure [owner.]procedure_name[,[owner.]procedure_name...]

where procedure_name refers to the procedure you are removing. For

example,

   DROP PROC ODBC#sa24518, ODBC#sa2334

would remove two stored procedures, ODBC#sa24518 and ODBC#sa2334.

References


INF: Importing Word Print Merge Data Files to Microsoft Access

 Article Number: Q96899

 CREATED: 30-MAR-1993

 MODIFIED: 02-MAY-1993

Summary:

This article describes how to import data from a Word for Windows

print merge data file for use in Microsoft Access.

More Information:

In order to use data from a Word for Windows print merge data file in

Microsoft Access, the file must be saved as a comma or tab delimited

unformatted text file.

Word for Windows can perform print merges on data contained in files

that are comma or tab delimited, or on data formatted from a table. If

the data is already comma or tab delimited, you must take care to

ensure the file is saved as an unformatted text file.

If the data is in table form, the table must first be converted to a

tab-delimited format before saving it as a text file.

Note: In Word for Windows, you can create multiline information within

a table cell that contains carriage returns (paragraph marks). The

carriage returns must be removed before converting the table to a tab-

delimited format.

Converting Data from a Table into a Tab-Delimited Format

========================================================

Word for Windows 1.x

--------------------

1. Open the data document in Word for Windows.

2. Position the insertion point anywhere inside the table of data.

3. Press ALT+Keypad 5 to select the entire table (make sure that NUM

   LOCK is turned off).

4. From the Insert menu, choose Table to Text.

5. In the Convert Table To box, select Tab Delimited, then choose OK.

Word for Windows 2.x

--------------------

1. Open the data document in Word for Windows.

2. Position the insertion point anywhere inside the table of data.

3. From the Table menu, choose Select (or press ALT+Keypad 5).

4. From the Table menu, choose Convert Table to Text.

5. Choose the Tabs button from the Separate Text With group

   and choose OK.

Saving the Data File as an Unformatted Text Only File

=====================================================

Word for Windows 1.x

--------------------

1. From the File menu, choose Save As, and enter an unique filename in

   the Save File Name box.

2. Choose the Options button.

3. From the File Format box, select Text Only, and choose OK.

Word for Windows 2.x

--------------------

1. From the File menu, choose Save As, and type a unique filename in

   the File Name box.

2. In the Save File As Type box in the lower left corner, select Text

   Only, and choose OK.

Removing Unwanted Carriage Returns from a Table Formatted Data File

===================================================================

Word for Windows 1.X:

---------------------

1. In the Search For box type "^p" (the caret symbol ^ is generated by

   a shifted 6)

2. In the Replace With box press the SPACEBAR 1 time.

3. Deselect the Confirm Changes checkbox and choose the OK button.

Word for Windows 2.x

--------------------

1. From the Edit menu, choose Replace.

2. In the Find What box, type "^p" (the caret symbol ^ is generated by

   pressing SHIFT+6).

3. In the Replace With box, press the SPACEBAR once.

4. Choose the Replace All button.

Importing the Text Data File into Microsoft Access

==================================================

1. From the File menu, choose Import.

2. Select Text (Delimited) from the Data Source list and choose OK.

3. Select the Word for Windows text file to import from the file list

   and choose the Import button.

4. Select "First Row Contains Field Names" if the first row in the

   Word data file contains a list of field names.

5. Choose the Options button.

6. Choose {tab} in the Field Separator box.

7. Choose the OK button to begin the import.

References


INF: How to Send Information to the Clipboard

 Article Number: Q96900

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

There is no Microsoft Access command to send information to the

Clipboard. To post information to the Clipboard, you need to define an

Access Basic function that calls several Windows API functions. This

article defines a function that copies text to the Clipboard.

For more information on how to retrieve information from the

Clipboard, query on the following words in the Microsoft Knowledge

Base:

   ClipBoard_GetData and GetClipboardData

This article assumes that you are familiar with Access Basic and with

creating Access applications with the programming tools provided with

Microsoft Access.

More Information:

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

Note: You may have some Windows API functions defined in an existing

Microsoft Access library; therefore, your declarations may be

duplicates. If you receive the duplicate procedure name error, remove

or comment the Declare statement from your code.

To call the function, you can make a string assignment to the returned

value, such as:

   X = ClipBoard_SetData("This string will go to the Clipboard!")

'=================================================================

' General Declarations

'=================================================================

Option Compare Database   'Use database order for string comparisons

Option Explicit

Declare Function kb_OpenClipBoard% Lib "User"_

                    Alias "OpenClipBoard" (_

                    ByVal hwnd%)

Declare Function kb_GlobalAlloc% Lib "Kernel" _

                    Alias "GlobalAlloc" (ByVal wFlags%, ByVal wBytes&)

Declare Function kb_GlobalLock& Lib "Kernel" _

                    Alias "GlobalLock" (ByVal hMem%)

Declare Function kb_lstrcpy& Lib "Kernel" _

                    Alias "lstrcpy" (ByVal lpString1 As Any, _

                    ByVal lpString2 As Any)

Declare Function kb_GlobalUnLock% Lib "Kernel" _

                    Alias "GlobalUnLock" (ByVal hMem%)

Declare Function kb_CloseClipBoard% Lib "User" Alias"CloseClipBoard"()

Declare Function kb_EmptyClipBoard% Lib "USER" _

                    Alias "EmptyClipBoard" ()

Declare Function kb_SetClipboardData% Lib "User" _

                    Alias "SetClipboardData" (ByVal wFormat%, _

                    ByVal hMem%)

Global Const GHND = &H42

Global Const CF_TEXT = 1

Global Const MAXSIZE = 4096

Function ClipBoard_SetData (MyString$)

   Dim hGlobalMemory%, lpGlobalMemory&, hClipMemory%, X%

   '-------------------------------------------

   ' Allocate moveable global memory.

   '-------------------------------------------

   hGlobalMemory% = kb_GlobalAlloc(GHND, Len(MyString$) + 1)

   '-------------------------------------------

   ' Lock the block to get a far pointer

   ' to this memory.

   '-------------------------------------------

   lpGlobalMemory& = kb_GlobalLock(hGlobalMemory%)

   '-------------------------------------------

   ' Copy the string to this global memory.

   '-------------------------------------------

   lpGlobalMemory& = kb_lstrcpy(lpGlobalMemory&, MyString$)

   '-------------------------------------------

   ' Unlock the memory.

   '-------------------------------------------

   If kb_GlobalUnLock(hGlobalMemory%) <> 0 Then

      MsgBox "Could not unlock memory location. Copy aborted."

      GoTo OutOfHere2

   End If

   '-------------------------------------------

   ' Open the Clipboard to copy data to.

   '-------------------------------------------

   If kb_OpenClipBoard(0&) = 0 Then

      MsgBox "Could not open the Clipboard. Copy aborted."

      Exit Function

   End If

   '-------------------------------------------

   ' Clear the Clipboard.

   '-------------------------------------------

   X% = kb_EmptyClipBoard()

   '-------------------------------------------

   ' Copy the data to the Clipboard.

   '-------------------------------------------

   hClipMemory% = kb_SetClipboardData(CF_TEXT, hGlobalMemory%)

OutOfHere2:

   If kb_CloseClipBoard() = 0 Then

      MsgBox "Could not close Clipboard."

   End If

End Function

Reference(s):

"Microsoft Windows 3.1 Programmer's Reference," Volume 2

References


INF: Limit to List Set to Yes Needs a Unique Entry

 Article Number: Q96901

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

If you set the LimitToList property of a combo box to Yes, and type a

portion of an entry into the combo box and press ENTER, you may

receive the following error message:

   The text you enter must match an entry in the list.

The error occurs because there are duplicates in the list. For

example, if you enter the value "co" in the combo box and the values

"conf" and "cond" exist in the drop-down list, the error occurs.

Reference(s):

"Microsoft Access User's Guide," version 1.0, chapter 9, "Designing

Forms", pages 244-245

References


PRACC9210: StDevP() with All NULL Records Returns #ERROR

 Article Number: Q96902

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When the StDevP() function is applied to a database containing only

   NULL records, #ERROR results. This problem does not occur with the

   StDev() function.

RESOLUTION

   Make sure that at least one record of a database where the StDevP()

   function is used contains a non-NULL value.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

StDevP() and StDev() are functions that return estimates of the

standard deviation for a population or a population sample,

respectively.

References


PRACC9210: '#' Appears in Attached Table Name in Error Message

 Article Number: Q96903

 CREATED: 30-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

In certain error messages, a number sign (#) instead of a period

appears as a file extension separator. For example, this message

may appear:

   Couldn't open file 'PDXSALES#DB'

instead of this message:

   Couldn't open file 'PDXSALES.DB'

This problem occurs in errors that are generated while attempting

to attach an external table that uses an installable ISAM driver

(as seen in the [Installable ISAMs] section of the MSACCESS.INI

file in the WINDOWS directory.)

CAUSE

Internally, an installable ISAM driver replaces the period in the

table name with a number sign for database compatibility purposes.

The problem is caused when Microsoft Access uses this internal

number sign-separated table filename in the error message, instead

of the period-separated name.

This is a cosmetic problem only; it does not affect the operation

of the installable ISAM driver or the attaching of external tables.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.

References


PRB: Low Number of Share Locks Can Cause Errors

 Article Number: Q96904

 CREATED: 30-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

A user receives the following error message

   Can't save; record is locked by another user

with Microsoft Access, even when only one user (one session and

machine) is using a database opened for shared access.

CAUSE

This error can be caused by an insufficient number of share locks.

RESOLUTION

Be sure that the number of share locks is set to 500 or more. The

number of share locks is set by the /L:xxxx parameter when

SHARE.EXE is invoked, usually in the AUTOEXEC.BAT file:

   LOAD C:\DOS\SHARE.EXE /L:500

The Microsoft Access Setup program modifies your AUTOEXEC.BAT file

and sets the number of share locks to 500, but some other program

may alter that value.

Although 500 share locks are sufficient for most Microsoft Access

applications, some applications may have share-lock-related

problems, and you may need to gradually increase the number of

share locks until these problems disappear. Try to add as few share

locks as possible, however, because each one takes up memory.

References


PRB: Rounding Errors Importing/Exporting dBASE IV Numerics

 Article Number: Q96905

 CREATED: 30-MAR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

Some floating-point values (single and double precision) have

rounding errors when exported out to or imported from a dBASE IV

database.

For example, the floating-point number .0807 is exported from a

Microsoft Access database to a dBASE IV database, and then imported

back into Microsoft Access. After the import, the value reads

.08069.

CAUSE

This problem is caused by the floating-point number being converted

from IEEE floating-point numeric format (used by Microsoft Access

and several other Microsoft products) to ASCII character values

required by dBASE IV. The Microsoft Access dBASE ISAM converts IEEE

floating-point values to ASCII, and conversion of binary fractions

to decimal is inherently inexact.

Typically, such rounding errors are not noticeable or relevant

because they take place at digits far to the right of the decimal

point and do not show, unless the rounding happens to cascade into

the visible portion of the number.

STATUS

This behavior is by design.

References


PRACC9210: Opening Objects in Transactions Can Cause Rollback

 Article Number: Q96906

 CREATED: 30-MAR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   The following error message is displayed while attempting to open a

   second occurrence of a database object (such as a table, dynaset,

   form, and so forth) in a transaction:

      Invalid database object

CAUSE

   This error message results from a new occurrence of a database

   object overwriting a previous occurrence of a database object,

   which "orphans" the first object (that is, the first object's

   pointer to the database is destroyed).

   When Microsoft Access detects that an object is orphaned, it

   attempts to close it. Because the object is in a transaction,

   however, the close fails, and therefore Microsoft Access rolls back

   all levels of nested transactions so that the close succeeds.

   This implicit rollback causes all objects opened in transactions to

   be closed. As a result, any reference to an object closed by this

   process results in the "Invalid database object" error message.

RESOLUTION

   This problem occurs only when objects are implicitly closed (by the

   process mentioned above), and does not occur when the object is

   explicitly closed in a transaction.

   Thus, the keys to avoiding this problem are:

    - Always open objects outside of transactions.

    - Always explicitly close objects.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

Code to Reproduce the Problem

-----------------------------

   Sub Sub1()

     Dim db As Database, tb As Table

     Set db = CurrentDB()

     BeginTrans

        Set tb = db.OpenTable("table1") 'Table opened in transaction

        Call Sub2

        Debug.Print tb.recordcount   'Result: "! Invalid database

                                     'object."

        tb.Close

     CommitTrans

     db.Close

   End Sub

   Sub Sub2()

     Dim d as Database

     Set d = CurrentDB()

   End Sub  'd loses scope, does implicit rollback and close of db.

References


PRB: Zoom Box Accessible When Multiple Fields Are Selected

 Article Number: Q96969

 CREATED: 01-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You can open a Zoom box when multiple fields in a table are

   selected; however, the contents of only the first selected field

   are visible.

STATUS

   This behavior is by design.

More Information:

Although multiple fields in a table can be selected when opening a

Zoom box, only one field is displayed in the Zoom box.

Steps to Reproduce Behavior

---------------------------

1. Create a table containing multiple fields and open it in Design mode.

2. From the Edit menu, choose Select All.

3. Press SHIFT+F2.

Notice that the data you see in the Zoom box comes from only the first

selected item.

References


PRB: Weekday Disappears While Editing Long Date Format Field

 Article Number: Q96970

 CREATED: 01-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you edit a date field that is formatted as Long Date, the

   weekday disappears from the field. The weekday reappears when you

   exit the field.

CAUSE

   A date is stored as a number that is parsed to display the format

   that you choose. All data types have certain formats that Microsoft

   Access can parse. The weekday is not parsed, and therefore it is

   removed from the date when you begin to edit the date field.

STATUS

   This behavior is by design.

References


INF: How Access Variable-Length Fields Export to dBASE

 Article Number: Q96971

 CREATED: 01-APR-1993

 MODIFIED: 21-APR-1993

Summary:

Microsoft Access uses variable-length fields for tables. However, when

you export a table to dBASE, which uses fixed-length fields, the field

sizes in dBASE are set based on what the FieldSize property is set to

in Microsoft Access. For example, if you have a table with a text

field defined with a FieldSize property of 50, in the exported .DBF

file, that field will have a field length of 50 in dBASE.

References


PRACC9303: Access Hangs Importing Big Lotus 1-2-3 Spreadsheets

 Article Number: Q96972

 CREATED: 01-APR-1993

 MODIFIED: 25-JUN-1993

SYMPTOMS

The system stops responding ("hangs") when attempting to import a

large spreadsheet (more than 64,000 cells) into Microsoft Access.

CAUSE

The Lotus 1-2-3 spreadsheet import option in Microsoft Access is

limited to 64,000 formatted cells. By default, Lotus 1-2-3 formats

all cells with the general format if they are not explicitly set to

some other format by the user. As a result, if a Lotus 1-2-3

spreadsheet to be imported has more than 64,000 cells, then

Microsoft Access cannot import it and the system may hang during

the import process.

RESOLUTION

To import a Lotus 1-2-3 spreadsheet with more than 64,000 cells,

you must first split the spreadsheet into separate spreadsheets

so that the number of cells in each does not exceed 64,000.

The spreadsheet must be split--importing subranges from large

spreadsheets does not eliminate the problem.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

version 1.0. This problem was corrected in Microsoft Access

version 1.1.

References


INF: Validating Data with Values From Another Table

 Article Number: Q96973

 CREATED: 01-APR-1993

 MODIFIED: 23-APR-1993

Summary:

The text below presents two examples that demonstrate setting the

ValidationRule property to use values in a different table. You must

use the DCount or DLookup function to do this.

You can use a validation expression to compare the value entered by

the user with a value in one or more other tables. You can create a

validation rule to accept only values that exist in a second table or

to reject values that exist in a second table.

More Information:

Example 1: Using the DCount Function

------------------------------------

In the following example, the user can enter into "Table1" only those

values that exist in the "Field" field of "Table2."

   Table: Table1

   -------------

   Field Name: Field Name

   DataType:  Text

   Validation Rule: DCount("[Field]","Table2","[Field]='" &

                          [Field in Table1] & "'") > 0

In the following example, the user can enter into "Table1" only those

values that do NOT exist in the "Field" field of "Table2."

   Table: Table1

   -------------

   Field Name: Field Name

   DataType:  Text

   Validation Rule: DCount("[Field]","Table2","[Field]='" &

                          [Field in Table1] & "'") = 0

Example 2: Using the DLookup Function

-------------------------------------

In the following example, the user can enter into "Table1" only those

values that exist in the "Field" field of "Table2."

   Table: Table1

   -------------

   Field Name: Field Name

   DataType:  Text

   Validation Rule: DLookup("[Field]","Table2","[Field]='" &

                         [Field in Table1] & "'")Is Not Null

In the following example, the user can enter into "Table1" only those

values that do NOT exist in the "Field" field of "Table2."

   Table: Table1

   -------------

   Field Name: Field Name

   DataType:  Text

   Validation Rule: DLookup("[Field]","Table2","[Field]='" &

                         [Field in Table1] & "'")Is Null

Replace "Field" with the appropriate field name in your database (be

sure to preserve the quotation marks and square brackets). Replace

"Table2" with the name of the validation table in your database and

replace "Table1" with the name of the table in which you are entering

data.

DCount searches through the specified field in the validation table

and counts all records where the field name is equal to the value

entered in the table. If the function returns a value greater than

zero, the function found one or more matching records.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 45, 652.

References


PRB: Moving Row Down One Grid in Table and Macro Design

 Article Number: Q96984

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you design a table or a macro in Microsoft Access, selecting a

   row and moving it down will locate the selected row on the grid

   that is directly above the insertion point. However, moving the

   selected row up one or more lines will move it to the row directly

   below the insertion point.

CAUSE

   This behavior is by design. Microsoft Access will insert the row

   above the line the mouse cursor is over.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Create a new macro.

2. Select any macro action.

3. Select the row you just created.

4. With the mouse cursor, move the action down one row.

   The action is placed in the row directly above the insertion point.

5. With the mouse cursor, move the action up one row.

   The action is placed in the row directly below the insertion point.

References


PRB: All Data 'Lost' When Doing Save As from Design View

 Article Number: Q96985

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   In Design view, you choose Save As from the File menu to create

   another table with the same structure. You name the new table and

   switch to Datasheet view. The new table contains no records.

CAUSE

   Save As is designed to copy only the table structure, not the data.

RESOLUTION

   To copy both the table structure and the data, do the following:

   1. In the Database window, choose the Table button.

   2. Select the table you want to copy.

   3. From the Edit menu, choose Copy (or press CTRL+C).

   4. Choose a destination for your new table. To paste the table into

      an existing database, choose Open Database from the File menu. To

      paste the table into a new database, choose New from the File menu.

   5. From the Edit menu, choose Paste (or press CTRL+V). The Paste

      Table As dialog box is displayed.

   6. Choose Structure And Data.

   7. Type a name for the new table and choose the OK button.

Reference(s):

"Microsoft Access User's Guide," version 1.0, pages 32-33

References


PRB: NWIND Order Form Updates Order Amount Field with Zero

 Article Number: Q96986

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   On the Orders form in the sample database NWIND.MDB, if you change

   the Quantity field for a product in the Orders subform, a macro

   assigned to the BeforeUpdate property of the Orders form resets the

   value of the Order Amount field in the Orders table. This macro

   incorrectly updates this field to a zero value.

CAUSE

   The macro Orders.Write Order Amount sets the value of the Order

   Amount field in the table before the calculated field Orders

   Subtotal has calculated the new value on the subform.

RESOLUTION

   Create a function that will cause a delay in the macro assigned to

   the AfterUpdate property. The Orders.Write Order macro will need to

   be modified. The first macro action in this macro will be a RunCode

   action that calls this new function.

More Information:

In the sample database NWIND.MDB, you will create a new function that

will cause a delay so the system can properly update the Order Amount

field. This function will be added to the macro group called Orders in

the macro named Write Order Amount.

1. Modify this macro:

      Macro Name                    Action

      ------------------------------------------

      Orders.Write Order Amount     RunCode

                                    SetValue

      Write Order Amount Actions

      ------------------------------------------

      Runcode

         Function Name: OrderSet()

      SetValue

         Item: Forms![Orders]![Order Amount]

         Expression: Forms![Orders]![Orders Subform].Form![Order Subtotal]

2. Create the following function named OrderSet:

'===================================================================

'The following Function OrderSet() runs a loop with the DoEvents

'command inside to allow the calculated field to update before the

'Setvalue runs. The number of times the function needs to loop may

'vary based on the speed of the machine.

'===================================================================

Function OrderSet()

   For x = 1 to 100

   Doevents

   Next x

End Function

Steps to Reproduce Behavior

---------------------------

These steps demonstrate the problem that occurs in the Orders form.

1. Open the NWIND database.

2. Open the Orders form in Form view.

3. Change the Quantity field for one of the products listed in the

   Orders subform (note the order ID of the order you are changing).

4. Open the Orders table and find the record with the same order ID.

5. Check the Order Amount field.

References


PRB: Combo Box Displays Only 255 Characters of Memo Field

 Article Number: Q96987

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When looking at the contents of a Memo field in a combo box, the

   entire contents of the Memo field are not visible. Instead, only

   the first 255 characters of the memo field are visible.

CAUSE

   This behavior is by design.

RESOLUTION

   If you need to view the entire contents of a Memo field, use a text

   box instead of a combo box.

More Information:

Most data types are limited to 255 characters. Memo data type fields

are limited to 32,000 characters instead of 255 characters.

A combo box can display only 255 characters of data, regardless of the

underlying field's data type.

References


PRB: Not Enough Stack Memory When Opening Form

 Article Number: Q96988

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you open a form, it flashes repeatedly, and then the following

   message is displayed:

      Not Enough Stack Memory

CAUSE

   One possible cause is that a macro with a Requery action is assigned

   to the first control in the Tab Order on the form. Or, the macro is

   assigned to the OnCurrent property of the form. This creates an

   infinite loop, causing the form to requery until the stack memory is

   depleted.

RESOLUTION

   If the macro must be assigned to the first control, assign it to the

   BeforeUpdate property of the control.

More Information:

Note: In the sample Northwind Traders database (NWIND.MDB), use the

steps below to re-create this behavior.

Steps to Reproduce Behavior

---------------------------

1. Create a new macro with a single Requery action. You do not need to

   fill in any arguments for this macro action. Save the macro as

   MyRequery.

2. Open the Categories form in Design view.

3. Assign the macro MyRequery to the OnEnter property of the first

   control on the Categories form. This should be the text box control

   named Category ID.

4. Open the form in Form view.

The form flashes several times. After several seconds, you receive the

following error message:

   Not Enough Stack Memory

References


INF: How To Create a 'Please Wait' Message

 Article Number: Q96989

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

Sometimes you may want to display a status message to inform a user he

or she must wait for an action to be completed. For example, you may

want to display the text "Please Wait" while Microsoft Access is

initializing a database, running a long query, and so on. You can do

this by using a form and a macro. This article presents a simple

example using the Northwind Traders sample database (NWIND.MDB).

More Information:

To display a status message in Microsoft Access, do the following:

1. Create an unbound blank form named PLEASEWAIT. Add a label with the

   message you want to display. For example, type "Please Wait" (without

   the quotation marks) as the caption. The form properties should be set

   to the following:

      Form: PLEASEWAIT

      ----------------

      ScrollBars: Neither

      Popup: Yes

      Modal: Yes

      RecordSelectors: No

2. Create the following macro named Test1:

      Macro Name             Action

      -----------------------------

      Test1                  OpenForm

                             RepaintObject

                             OpenQuery

                             Close

      Test1 Actions

      -----------------------------

      OpenForm

         Form Name: PLEASEWAIT

         View: Form

         Date Mode: Read Only

         Window Mode: Normal

      RepaintObject

         Object Type: Form

         Object Name: PLEASEWAIT

      OpenQuery

         Query Name: <Daily Orders Total>

         View: Datasheet

      Close

         Object Type: Form

         Object Name: PLEASEWAIT

   Note: The above argument for OpenQuery is just an example of what you

   may want to run, this can be anything. The main macro actions in Test1

   are OpenForm, RepaintObject, and Close.

3. Run the macro. The PLEASEWAIT form should open. As soon as the

   query completes processing, the form disappears and the query results

   appear.

References


PRACC9303: GPF Hiding Control in Form Footer in Datasheet View

 Article Number: Q96990

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you have a control in the footer of a form and you then hide

   that control in an event, such as OnCurrent, and then view the form

   in Datasheet view, Microsoft Access may cause a general protection

   (GP) fault.

CAUSE

   In Datasheet view, Microsoft Access incorrectly assumes that a grid

   column is associated with the field being hidden. However, that is

   not true in this case, since the control is in the form's footer.

RESOLUTION

   Since forms with controls in the footer are normally meant to be

   used in Form view, set the Form's ViewsAllowed property to "Form"

   so that the form cannot be switched to Datasheet view.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRACC9303: GPF When Using ListParameters Method on Database

 Article Number: Q96991

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Illegally using the ListParameters method on a database object does

   not generate a compile-time error as expected, but rather a general

   protection (GP) fault.

RESOLUTION

   The ListParameters method is intended only for use with the

   QueryDef object.

   Use only methods legal for use on the database object:

      Close            CreateDynaSet

      CreateQueryDef   CreateSnapshot

      DeleteQueryDef   ListTables

      OpenQueryDef     OpenTable

   For more information, see Microsoft Access Help or the Microsoft

   Access "Language Reference."

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

Attempting to list parameters for a database object is illegal, but

instead of generating the expected compile-time error, it creates a GP

fault in Microsoft Access. For example, the following subroutine

causes a GP fault even though it should instead generate a

compile-time error:

Sub Test

   Dim db As Database

   Dim Snap As Snapshot

   Set db = CurrentDB()

   Set Snap = db.ListParameters()

End Sub

References


PRACC9303: Setup Leaves MS-SETUP.T Directory and Files on Disk

 Article Number: Q96992

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you request Microsoft Access SETUP.EXE to install SHARE.EXE and

   then choose the option to reboot your machine at the end of the

   installation process, Setup will not properly erase the temporary

   directory MS-SETUP.T and the files contained therein on your hard

   disk. This leftover directory contains data files totaling

   approximately 600K. Other than occupying disk space, these files

   have no affect on Microsoft Access or any other applications.

RESOLUTION

   Either do not choose the "Reboot Your Machine" option at the end of

   the installation process, or manually delete the temporary

   directory and files after the reboot process.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRACC9303: GP Fault Using Invalid IIf() as ControlSource

 Article Number: Q96993

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If you use the IIf() function as the ControlSource property of a

   form or report and do not provide the necessary parentheses around

   the parameter list, Microsoft Access may cause a general protection

   (GP) fault instead of returning an error message.

   For example, the following syntax is incorrect and will cause a GP

   fault:

      =IIf IsNull([Fld]),"NULL","NOT NULL"

   Note that the parentheses for the IIf() function are missing. As

   soon as you try to leave the property setting, the GP fault will

   occur.

RESOLUTION

   Ensure that all IIf() functions include the required parentheses

   around the parameter list. The following syntax is a corrected

   version of the one displayed above:

      =IIf(IsNull([Fld]),"NULL","NOT NULL")

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRACC9303: File Truncation on Password-Protected Servers

 Article Number: Q96994

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Using an incorrect Microsoft Windows for Workgroups driver with

   Microsoft Access can cause file truncation. If you have an early

   version of the Windows for Workgroups WFWNET.DRV file (dated before

   11/02/92), using the Network button in Microsoft Access dialog

   boxes to connect to password-protected servers may cause database

   files opened on that server to become truncated.

   NOTE: This problem was discovered before Microsoft Access was

   released and all copies of Microsoft Access include the updated

   Windows for Workgroups driver and installation instructions.

RESOLUTION

   Update the WFWNET.DRV driver file using the driver update program

   included with Microsoft Access. Complete instructions on how to do

   this are contained in the flier included in your copy of Microsoft

   Access.

References


PRB: Stacker 3.0 CHECK.EXE Reports Database Files as Corrupt

 Article Number: Q96995

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Running Stacker version 3.0's CHECK.EXE program with the /=D and /F

   switches often erroneously reports that Microsoft Access .MDB files

   are corrupt and should be deleted. The /=D and /F switches are

   meant only for development and debugging purposes and can

   incorrectly identify files as corrupt.

RESOLUTION

   Do not run CHECK.EXE with the /=D switch. If you do run CHECK.EXE

   with the /=D switch, answer "no" when prompted to delete "corrupt"

   files.

More Information:

STAC Electronics has created a document explaining the "lost sector

groups" reported by CHECK /=D. This document is referenced as

TEC042.DOC on CompuServe and on the STAC BBS, and as document #3003 on

STAC FAX, STAC Electronics' automated fax response service.

Stacker is manufactured by STAC Electronics, a vendor independent of

Microsoft; we make no warranty, implied or otherwise, regarding this

product's performance or reliability.

References


INF: How to Change the Font for the Zoom Box

 Article Number: Q96996

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

This article describes how to modify the system UTILITY.MDA database

to change the default font used in the Zoom box of Microsoft Access.

More Information:

To change the font for the Zoom box, do the following:

1. Before you open Microsoft Access, copy the UTILITY.MDA file to

   MYUTIL.MDA. The UTILITY.MDA file is generally stored in the root

   directory for your Microsoft Access program files.

2. Start Microsoft Access. From the File menu, choose Open Database,

   select MYUTIL.MDA, and choose the OK button.

   Note: When you open this database, you are prompted to choose the OK

   button in response to two error messages. These errors are caused by

   duplicate modules loaded from the UTILITY.MDA database. The error

   messages are:

      Tried to load module with duplicate procedure

      definition: BuilderZoom

     -and-

      Tried to load module with duplicate procedure

      definition: DDB

3. In Design view, open the ZoomForm form. Select the unbound text box

   control Zoom, and change the following properties to the ones noted

   below or to a font of your choice.

      FontName:    Microsoft Sans Serif

      FontSize:    12

      FontWeight:  Semi-bold

   Note: Select a font and a size that suite your needs.

4. Close the database and save your changes to the ZoomForm form. Exit

   Microsoft Access.

5. Use any ASCII text editor, such as NOTEPAD.EXE, to modify the

   MSACCESS.INI file in your Windows directory.

   Change the following line in your [Options] section from

      [Options]

      UtilityDB=C:\ACCESS\UTILITY.MDA

      to

      [Options]

      ;UtilityDB=C:\ACCESS\UTILITY.MDA

      then add the new line so that the section reads:

      [Options]

      ;UtilityDB=C:\ACCESS\UTILITY.MDA

      UtilityDB=C:\ACCESS\MYUTIL.MDA

   Save the MSACCESS.INI file.

When you next start Microsoft Access and use the Zoom box for editing,

the font, size, and weight reflect the changes you made.

References


PRB: Toolbar Disappears When Printing a Document

 Article Number: Q96997

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you print a form or report from Print Preview, the toolbar

   disappears when the Print dialog box is displayed. The toolbar

   reappears after the print job has been sent.

STATUS

   This behavior is by design. This behavior does not compromise any

   functionality of the toolbar because the toolbar is returned. This

   behavior may not be noticed unless you are processing a large print

   job.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Choose Print Preview for any report.

2. From the File menu, choose Print.

Notice that the Print dialog box appears and that the toolbar

disappears. If you print the report, the toolbar returns when the print

job has completed processing.

References


INF: Query Window Doesn't Always Scroll to Record

 Article Number: Q96998

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you click on a query's record selector field and press ENTER,

   the screen does not always scroll automatically to display that

   record.

RESOLUTION

   In order to get the window to scroll to a record, the selector

   field must first be altered.

STATUS

   This behavior is by design.

More Information:

If the record selector shows record 1, clicking on the record number

and pressing ENTER sends the cursor to that record but doesn't scroll

the screen to display record 1.

Steps to Reproduce Behavior

--------------------------

Follow these steps in the sample database Northwind Traders

(NWIND.MDB):

1. Run the query named Customer List.

2. Using the vertical scroll bar, scroll down the query. Notice that

   the record selector does not change from record 1.

3. Click the mouse just to the right of the record number 1 and press

   ENTER. The cursor disappears but the query window does not scroll to

   record 1.

4. Repeat steps 1-3, but this time erase the record number and retype

   it (1). Press ENTER.

Notice that this time the window scrolls to record 1. This is the

normal behavior with any record number you enter.

References


PRB: File Rename Dialog Still Enabled When No Filename Given

 Article Number: Q96999

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you have the Database window open, if you choose Rename from

   the File menu and do not enter a name for the selected object, the

   OK button is still enabled. If you choose the OK button, you will

   receive the following error message:

      Not a valid document name:

CAUSE

   Dialog boxes that are provided with Windows disable the OK button

   if an expected entry is not made. This particular dialog box is not

   provided by Windows. Microsoft Access does not disable the OK

   button in this dialog box when there is no entry in the field.

RESOLUTION

   You must enter a new name for the object.

STATUS

   This behavior is by design.

References


PRB: Incorrect Results Received with DSUM Function

 Article Number: Q97000

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Incorrect results received from DSUM function.

CAUSE

   If you do not surround the expression argument in the DSUM function

   with quotation marks, you will not receive correct results.

RESOLUTION

   Surround each argument in the DSUM function with quotation marks.

STATUS

   This behavior is by design.

More Information:

The DSUM() function returns a set of values in a specified set of

records (domain). Typically you might use this function in a text box

control on a report to total the values from a field in a table or

query.

If you omit the surrounding quotation marks from the expression

argument, you will not see the expected error message. Instead, you

see a value that is actually derived by taking the last value of the

field from the report and summing it x number of times (once for each

record in the table or query).

Steps to Reproduce Behavior

---------------------------

The following example is based on the sample database Northwind

Traders (NWIND.MDB):

1. Open the report Freight Charges.

2. Add a text box to the Company Name Footer section:

      Object: Text Box

      ----------------

      ControlName: MyDSUM

         ControlSource: =DSum([Freight],"Freight Charges")

3. Preview the report. The amount showing in this text box is

   incorrect (compare it to the text box control in the report footer

   section named Grand Total). Notice that the optional criteria

   expression is not included in this example. Therefore, you would

   expect to see the total of the Freight field from the Freight

   Charges query.

4. Change the ControlSource to:

      =DSum("[Freight]","Freight Charges")

6. Preview the report. Now the amount in the text box is correct.

Reference(s):

"Microsoft Access Language Reference," version 1.0, pages 159-160

References


PRB: 'Fieldname' Isn't an Index in This Table

 Article Number: Q97001

 CREATED: 04-APR-1993

 MODIFIED: 22-APR-1993

Summary:

SYMPTOMS

   When you run an Access Basic function that attempts to perform a

   Seek method on a table, you receive the following error message

      'Fieldname' isn't an index in this table.

   where 'Fieldname' is the name of a field in your table that has been

   defined as an index in your function. This field is also the primary

   key in the table.

CAUSE

   When you set the Index property in your function and you are

   referring to a primary key field, you should refer to the field as

   PrimaryKey; that is, don't refer to the field by the name of the

   field.

RESOLUTION

   Change the statement in your function that sets the current Index

   property. The correct syntax should resemble the following (note

   that the "Microsoft Access Introduction to Programming Guide

   incorrectly refers to PrimaryKey as one word):

      EMPTable.Index = "PrimaryKey"

More Information:

The following example is based on the sample database Northwind

Traders (NWIND.MDB):

Steps to Reproduce Behavior

---------------------------

1. Create a new module and enter the following function:

   '*********************************************

   'Declarations section of the module.

   '*********************************************

   Option Explicit

   '=============================================

   ' This FINDID function accepts one parameter.

   '=============================================

   Function FINDID (EMPLOYID As String)

      Dim db As Database, EMPTable As Table

      Set db = CurrentDB()

      Set EMPTable = db.OpenTable("Employees")

      EMPTable.Index = "EMPLOYEE ID"

      EMPTable.Seek "=", EMPLOYID

         If EMPTable.NoMatch Then

            MsgBox "Not a valid ID. Try another"

         Else

            MsgBox "This Employee ID is in the table!"

         End If

      EMPTable.Close

   End Function

2. From the View menu, choose the Immediate window.

3. Enter the following statement in the Immediate window:

      ? FINDID("1")

   You will see the following error message:

      'Employee ID' isn't an index in this table.

   Note: The Employee ID field has been defined as the primary key in

   the Employees table.

4. Change the EMPTable.Index statement to the following:

      EMPTable.Index = "PrimaryKey"

5. Repeat step 3.

   You will see the appropriate message box indicating whether you

   entered a valid number.

Reference(s):

"Microsoft Access Introduction to Programming," version 1.0, page 114

References


PRACC9303: GP Fault Referencing Form Dynaset w/ Form Variables

 Article Number: Q97002

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Form dynaset references do not always work properly when using form

   variables. If you reference a form dynaset with variables, you may

   receive a general protection (GP) fault.

RESOLUTION

   Always refer to a form dynaset with explicit references through the

   form. The first code fragment below shows how to reference a form

   dynaset safely, and the second code fragment shows what most likely

   will cause the problem:

   Safe

   ----

      Forms!TestForm.Dynaset!Col1="MyVar"

   May Cause Problems

   ------------------

      Dim MyForm As Form

      Set MyForm = Form!TestForm

      MyForm.Dynaset!Col1 = "MyVar"

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRACC9303: Can't Add Counter Columns to Tables w/ > 4 MB Data

 Article Number: Q97003

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You cannot add Counter data type columns to existing tables

   containing roughly greater than 4 megabytes (MB) of data.

CAUSE

   This problem occurs because of a current limitation in the

   Microsoft Access transaction model (transaction size limited to 4

   MB).

   The problem occurs with Counter columns because the table data for

   columns is updated when the new column is added. The update takes

   place in a transaction, and with large tables (greater than 4 MB),

   the update encounters the Microsoft Access transaction size limit.

   When this happens, the transaction rolls back and the Counter

   column is not successfully added.

RESOLUTION

   Use the following steps to add a Counter column to a large table:

   1. Copy/paste the table's structure (not the table's data) to a new

      table.

   2. Add a Counter data type column to the new table.

   3. Create an append query that transfers data from the old table

      into the new table.

   4. Verify that the new table has the correct data.

   5. Delete the old table.

   6. Rename the new table to the name of the old table.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Data Base as it becomes

   available.

References


PRACC9303: GP Fault on Update Query Due to Query Design Option

 Article Number: Q97004

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Update queries do not work correctly if you use the Options command

   on the View menu to set the Query Design option, Restrict Available

   Fields, to No (the default is Yes). In most cases, Microsoft Access

   causes a general protection (GP) fault; however, there have been

   isolated cases where the query completed and incorrectly updated

   the wrong columns in the table.

RESOLUTION

   Set Restrict Available Fields to No on a query-by-query basis by

   clearing the Restrict Available Fields check box on the Query

   Properties dialog box instead of using the Options/View menu method

   to set this option on a global basis.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRACC9303: Descending Sort Query Returns Wrong Number of Rows

 Article Number: Q97005

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When sorting data in descending order on an indexed column

   containing over 506 duplicate entries, Microsoft Access may return

   the wrong number of rows to the user.

   This occurs when the Index property for a column is set to "Yes (No

   Duplicates)" or "Yes (Duplicates OK)," but not when there is a

   primary key on the column. Nonprimary-key indexes can have multiple

   null entries.

RESOLUTION

   Remove the index from the column being sorted. This causes the

   query to execute more slowly but gives you correct results.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRACC9303: Bad Results Searching Multicolumn Paradox Indexes

 Article Number: Q97006

 CREATED: 04-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Using the Find command on the Edit menu to search Paradox fields

   for specific values does not work properly if all of the following

   are true:

    - The field being searched is part of a multicolumn index.

    - The field contains NULLs.

    - The Search Fields As Formatted option is disabled in the Find In

      Field dialog box on the Edit menu.

RESOLUTION

   To work around this problem, check the Search Fields As Formatted

   option in the Find In Field dialog box so that the index is not

   used in the search. Similarly, when querying on Paradox fields that

   are part of a multicolumn index containing NULL values, use the

   LIKE operator in places where you would normally use the

   equivalence operator. For example, avoid using

      SELECT *

      FROM TestTable

      WHERE ((FieldX=23));

   and instead use the following:

      SELECT *

      FROM TestTable

      WHERE ((FieldX Like 23));

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Based as it becomes

   available.

References


PRB: Only One Button Accepts Selection in Yes/No Option Group

 Article Number: Q97510

 CREATED: 13-APR-1993

 MODIFIED: 25-APR-1993

Summary:

SYMPTOMS

   When a database contains a form that has an option group bound to a

   Yes/No field and the option group contains two option buttons, one

   of which is assigned the option value 0 and the other the option

   value 1, only the second button can be selected.

CAUSE

   In Microsoft Access, the value (0) represents FALSE and any other

   value represents TRUE. In a field of data type yes/no, TRUE values

   are assigned the value (-1). If you select an option button that

   has the value (1), the yes/no field to which the option group is

   bound is changed to (-1), or TRUE.

   Actually, the option button attempts to put the value (1) into the

   yes/no field. But since the field is of data type yes/no, the field

   is set to (-1) for any value other than (0). The value of the

   option button is set to (1) and the yes/no field now contains a

   (-1), therefore the button does not appear to be selected.

RESOLUTION

   Change the option value for the second button from 1 to -1.

STATUS

   This behavior is expected.

More Information:

Steps to Reproduce Behavior

---------------------------

1. In a form, create an option group for a Yes/No field.

2. Add two radio buttons to the group.

3. Set the option value for Button1 to 0.

4. Set the option value for Button2 to 1.

5. Choose Form view. An attempt to select Button2 fails.

References


PRB: Unable to Add All Fields in Graph FormWizard

 Article Number: Q97511

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When creating a graph, you will receive the following error message

   if you try to include more than one date field in the graph:

      You can select only one date field.

   You will receive the following error message if you try to include

   more than three fields in the graph and more than one of those

   fields is a text field

      You can only select one non-numeric field if you want to use

      <number> fields for your chart.

   where <number> is the number of fields that you selected.

STATUS

   This behavior is by design.

More Information:

When you are creating a chart with the Graph FormWizard, the Add All

(>>) button, even though it is displayed as a choice, will return an

error message if your source table or query contains more than one

date field. You will also receive an error message when using the Add

All (>>) button if your source table or query contains more than one

text field for a chart that has more than three fields.

Steps to Reproduce Behavior

--------------------------

1. Open the NWIND.MDB sample database.

2. Use FormWizards to create a new form based on the Orders table.

2. When the FormWizard asks "Which AccessWizard do you want?" select

   Graph. Choose the Next button.

3. When the FormWizard asks "Which type of Graph do you want?" choose

   the Next button.

4. When the FormWizard asks "Which fields contain the data you want

   to graph and use for labels?" select all the fields. To select all

   the fields, choose the Add All (>>) button.

   When you choose the Next button, you will receive an error message

   indicating that only one date field can be in the graph.

   To receive the other error message, repeat steps 2-4, substituting

   the Customers table for the Orders table.

References


PRB: ValidationRule Parses Function Name w/o Parens to String

 Article Number: Q97512

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you type an expression containing a function name that has no

   parentheses or parameters in the ValidationRule property of a text

   box, the expression is evaluated as a string instead of a function.

RESOLUTION

   Put parentheses or parameters after all function names so they can

   be correctly evaluated as functions instead of text strings. For

   example, use

      =Date()

   instead of:

      =Date

     Note: For this example to work correctly, after putting

     parentheses after =Date, you also need to change the Format

     property of the text box to General Date.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

--------------------------

1. Start Microsoft Access and open the NWIND.MDB sample database.

2. Create a new, unbound blank form.

3. Place a new, unbound text box on the blank form.

4. From the View menu, choose Properties so that you can change the

   properties of the form and objects on the form.

5. In the ValidationRule property of the text box, type the following

   and then press the ENTER key:

      =Date

   Note that Microsoft Access automatically changes the expression you

   entered from =Date to ="Date".

6. From the View menu, choose Form.

7. Type a date in the text box.

   When you type a date such as 04/05/93 in the text box and then

   press the ENTER key, you get the message, "The value you entered is

   prohibited by the validation rule set for this field." However, the

   text box accepts the word "Date," which is the word changed by

   Microsoft Access in the ValidationRule property of the text box.

References


PRB: 'Table Exclusively Locked' Error Switching to Form View

 Article Number: Q97513

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   An attempt to switch from Design view to Form view fails and

   Microsoft Access generates the following message:

      Table <tablename> is exclusively locked

CAUSE

   The form's RecordSource property refers to a table that remains

   open in Design view.

RESOLUTION

   Perform one of the following three procedures to address this

   behavior:

    - Close the open table

    - Change the open table to Datasheet view

    - Open the form before opening the table (this opens the table in

      Design view for read-only access)

References


INF: Writing Functions to Be Called from Events or Expressions

 Article Number: Q97514

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

Functions can be used in a variety of places in Microsoft Access. How

you write your functions depends on where the functions are going to

be called from.

This article assumes that you are familiar with Access Basic and with

creating applications for Microsoft Access with the programming tools

provided with Microsoft Access.

More Information:

There are two main styles for writing Access Basic functions:

 - Functions can be called from event properties, such as the

   AfterUpdate property for a control on a form. Typically, you would

   call the function with a parameter. The function then acts on or

   modifies the parameter.

 - Functions can be used in expressions, such as calculated controls.

   The difference is in how the result is returned when the function

   exits.

The examples below use the Proper() function to illustrate the

differences between the two function styles. Proper() converts the

first letter of a word to uppercase and the other letters to

lowercase.

Calling a Function from an Event Property

=========================================

The Proper() function can be written so it can be called from an

event, such as the AfterUpdate property of a control on a form. In

this example we will call it ProperAU() as a reminder that it should

be called from the AfterUpdate property.

Enter the following function in a module:

   Function ProperAU(Field As Control)

      Field=UCase(Left(Field,1)) & LCase(Mid(Field,2))

   End Function

  Note: The result of the calculation updates the field that was

  passed as a parameter.

Example

-------

1. Open the Customers form in Design view.

2. View the Property sheet by choosing Properties from the View menu.

3. Add the following statement to the AfterUpdate property of the

   First Name field:

      Object: Text Box

      ----------------

      ControlName: First Name

      AfterUpdate: =ProperAU([First Name])

   Now, whenever the employees name is typed into the Employee form,

   it will be converted to the correct format when the user presses

   TAB or ENTER.

Calling a Function from an Expression

=====================================

The Proper() function can be written so it can be called from an

expression, or calculated control. In this example we will call it

ProperCC() as a reminder that it should be used in calculations.

Enter the following function in a module:

   Function ProperCC(Field)

      ProperCC=UCase(Left(Field,1)) & LCase(Mid(Field,2))

   End Function

  Note: The result of the calculation is assigned to the function.

  This way, it can be used in an expression or calculated control.

Example

-------

1. Open the Customers form in Design view.

2. Add the following calculated control to the form:

      Object: Text Box

      ----------------

      ControlName: Proper Last Name

      ControlSource: =ProperCC([Last Name])

   Now when you type in the Last Name field, you will see the correct

   capitalization in the Proper Last Name field.

     Note: You won't be able to type in the Proper Last Name field.

     ProperCC() doesn't change underlying data like ProperAU() does.

     For this reason, ProperCC() is useful in reports and expressions

     and can be used more places than ProperAU().

   You can use ProperCC in the same manner as any of the built-in

   functions listed in the "Language Reference," such as UCase, LCase,

   and so on.

Determining the Type of Function You Need

=========================================

   Where used                                   Function style

   -----------------------------------------------------------

   AfterUpdate, BeforeUpdate, and so on         Event

   RunCode macro action                         Event

   Calculated controls on forms and reports     Expression

   Calculated fields in a query                 Expression

   SetValue macro action expression             Expression

   Default values in a table or form            Expression

   Called from another function or sub          Expression

References


INF: Passing a Null Pointer to an External DLL

 Article Number: Q97515

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

The null value is a valid or required parameter for some dynamic-link

libraries (DLLs). To specify a null value, use 0&.

The text below assumes some familiarity with Access Basic and creating

and using Access Basic procedures.

More Information:

When your procedure calls a function and passes the expression 0&, the

ampersand (&) specifies a 32-bit (far) null pointer. In a function

declaration, an As Any parameter instructs Access Basic to omit type

checking for that parameter and to pass the value to the called

function.

The following code demonstrates the correct method to declare an

Access Basic function that passes a null parameter to a function in a

DLL. Open a new module or edit a previously created Module to contain

the following code.

'NOTE: In the following sample code, an underscore (_) is used as a

'line continuation character. Remove the underscore when re-creating

'this code in Access Basic.

'NOTE: Some functions of the Microsoft Windows application programming

'interface (API) may be declared in an existing Microsoft Access

'library. If so, the declarations below are duplicates. If the

'duplicate procedure name error occurs, remove or comment out the

'offending declare statement from your code.

'*********************************************************************

'Declarations section of the module.

'*********************************************************************

Option Explicit

'=====================================================================

' Declare the WriteProfileString API function from the external

'    Windows dynamic-link library "kernel."

'=====================================================================

Declare Function WriteProfileString% Lib "Kernel" (

                    ByVal lpApplicationName As Any,

                    ByVal lpKeyName As Any,

                    ByVal lpString As Any)

'=====================================================================

' Create the following FlushIniCache%() function in the Module. The

' following function calls the external function, specifying null for

' each argument. This causes WriteProfileString to flush its internal

' cache and writes to disk any changes to WIN.INI. NOTE: Using this

' function incorrectly can cause a general protection fault or modify

' your WIN.INI file.

'=====================================================================

Function FlushIniCache%()

   FlushIniCache = WriteProfileString% (0&, 0&, 0&)

End Function

References


PRB: Random Characters in Text Box Bound to OLE Object Field

 Article Number: Q97516

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   In Form view, when you set the ControlSource property for a text

   box to an OLE Object field, strange characters appear in the text

   box.

RESOLUTION

   Change the ControlSource for the text box to a field that is not an

   OLE Object and use an OLE Object Frame to display the contents of

   the OLE Object field.

More Information:

The text box displays random characters, such as vertical bar

characters or apostrophes, when a text box is bound to an OLE Object

field and the current record contains an OLE Object in that field. If

the OLE Object field in the current record is empty, no characters

appear in the text box.

References


INF: Print Total Number of Pages on Each Page of Report

 Article Number: Q97517

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

You can print the page number on each page of a report by using the

Page property in a text box control in the page footer. This article

explains how to also print the total number of pages of the entire

report on each page (for example, 1/20).

Note: This method will not work when placing the final text box

control, PageNum, in a page header.

This article assumes that you are familiar with Access Basic and

how to create and use Access Basic procedures.

More Information:

To print the total number of pages of a report at the bottom of each

page, do the following:

1. Open a new module or a previously created module, and enter

   the following code:

   Note: In the following sample code, an underscore (_) is used as a

   line-continuation character. Remove the underscore when re-creating

   this code in Access Basic.

   '*************************************************************

   'Declarations section of the module.

   '*************************************************************

   Option Explicit

   Global TotalPages as Integer

   '=============================================================

   ' Create the following GetTotalPages() function in the Module

   '=============================================================

   Function GetTotalPages()

      GetTotalPages = TotalPages

   End Function

   '=============================================================

   ' Create the following GotoEnd() function in the Module

   '=============================================================

   Function GotoEnd()

      TotalPages = 0

      SendKeys "%z{END}", False

   End Function

   '=============================================================

   ' Create the following SaveTotalPages() function in the Module

   '=============================================================

   Function SaveTotalPages(TotPgNum As Integer)

      If TotalPages = 0 Then

         TotalPages = TotPgNum

         SendKeys "{HOME}", False

      End If

   End Function

2. Open your report in Design view.

3. From the View menu, choose Properties to display the property

   sheet. Add the following function to the report's OnOpen event:

      OnOpen: =GotoEnd()

4. Place a text box control called MyPage in the Page Footer.

      Object: Text Box

      ----------------

      ControlName: MyPage

         ControlSource: =Page

         Visible: No

5. Change the Report Footer OnFormat property to the following:

      OnFormat: =SaveTotalPages([MyPage])

6. Place a text box control in the Page Footer as follows:

      Object: Text Box

      ----------------

      ControlName: PageNum

         ControlSource: =Page & "/" & GetTotalPages()

When you print your report, this text box control will print the page

number as 1/n where n is the total number of pages in the report.

References


INF: Multiple Selection List Box Example

 Article Number: Q97518

 CREATED: 13-APR-1993

 MODIFIED: 02-MAY-1993

Summary:

The text below demonstrates how to create a pair of list boxes to

imitate the multiple selection behavior used in AccessWizards.

More Information:

The steps below create a new form that contains two list boxes and

three command boxes. You can add or delete items from the list using

either the Add Item or Delete Items buttons or the properties of the

list boxes. Perform the following 7 steps.

1. Create the following table:

      Table: Table1

      ----------------------

      Field Name: List   [Primary Key]

         DataType: Text

         Field Size: 15 (This may vary)

         Caption: Items that will be provided in list

      Field Name: Selected

         DataType: Text

         Field Size: 5

         Caption: Indicates if the item has been selected

2. Choose Datasheet view and add five records. For each record, place

   some data into the List field (for example, a list of colors or

   cities). Set the Selected field to the word "YES" (without

   quotation marks).

3. Create two queries based on Table1:

      Query: Select Yes

      ---------------------

      Field Name: List

         Show: True

         Criteria: [selected] = "YES"

      Query: Select NO

      ---------------------

      Field Name: List

         Show: True

         Criteria: [selected] = "NO"

4. Create the following three functions:

   '=======================================================

   'The following function opens the table and changes the

   '   selected value from YES to NO.

   'Then the code executes the query for the two list boxes

   '   so they display the updated values.

   '=======================================================

    Function ADD ()

      Dim MyDB As Database

      Dim MyTable As Table

      Dim y As Control

      Set MyDB = CurrentDB()

      Set MyTable = MyDB.OpenTable("Table1")

      Set y = forms!SelectList.field0

      MyTable.index = "PrimaryKey"

      MyTable.Seek "=", y

      MyTable.Edit

      MyTable.[selected] = "no"

      MyTable.Update

      MyTable.Close

      DoCmd Requery "field0"

      DoCmd Requery "field1"

   End Function

  '========================================================

  'The following function opens the table and changes the

  '   selected value from NO to YES.

   'Then the code executes the query for the two list boxes

   '   so they display the updated values.

  '=======================================================

   Function Del ()

      Dim MyDB As Database

      Dim MyTable As Table

      Dim y As Control

      Set MyDB = CurrentDB()

      Set MyTable = MyDB.OpenTable("Table1")

      Set y = forms!SelectList.field1

      MyTable.index = "primarykey"

      MyTable.Seek "=", y

      MyTable.Edit

      MyTable.[selected] = "yes"

      MyTable.Update

      MyTable.Close

      DoCmd Requery "field0"

      DoCmd Requery "field1"

   End Function

   '=======================================================

   'The following function sets all values in the field

   '   "Selected" to yes.

   'Then the code executes the query for the two list boxes

   '   so they display the updated values.

   '=======================================================

   Function Clear ()

      Dim MyDB As Database

      Dim MyTable As Table

      Set MyDB = CurrentDB()

      Set MyTable = MyDB.OpenTable("Table1")

      On Error GoTo erhandle

      MyTable.MoveFirst

      Do Until MyTable.EOF

         MyTable.Edit

         MyTable.[selected] = "yes"

         MyTable.Update

         MyTable.MoveNext

      Loop

   erhandle:

      Resume Next

      DoCmd Requery "field0"

      DoCmd Requery "field1"

   End Function

5. Create a blank unbound form named SelectList.

6. Add two list box controls to the form and assign the following

   properties:

      Object: list box

      ----------------

      ControlName:    Field0

         ControlSource:

         RowSourceType: Table/Query

         RowSource: Select Yes

         On Dbl Click: =ADD()

      Object: list box

      ----------------

      ControlName:    Field1

         ControlSource:

         RowSourceType: Table/Query

         RowSource: Select No

         On Dbl Click: =Del()

   The first list box, Field0, displays the items to be selected. The

   second list box, Field1, displays items that are selected.

7. Add three command button controls to the form and assign the

   following properties:

      Object: command button

      ----------------------

      ControlName: Button One

         Caption: Clear

         OnPush: =Clear()

      Object: command button

      ----------------------

      ControlName: Button Two

         Caption: Add item

         OnPush: =Add()

      Object: command button

      ----------------------

      ControlName: Button Three

         Caption: Delete item

         OnPush: =Del()

References


INF: Correct Syntax for TransferDatabase to dBASE and Paradox

 Article Number: Q97519

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

When you attempt to export a Microsoft Access table to dBASE or

Paradox, you may encounter errors. The arguments for the

TransferDatabase action are not clear in Microsoft Access Help or on

pages 473-476 of the "Language Reference."

This article explains the correct argument syntax for exporting the

Categories table from the NWIND.MDB sample database to dBASE III using

the TransferDatabase macro action. The equivalent Access Basic syntax

is also explained.

More Information:

  Note: Both of the following examples export the Categories table to

  a dBASE file in the C:\DBASE directory. You need to enter a valid

  directory in your macro or you may receive the following error

  message when you run the macro or function:

     Not a valid path

Example 1 - Using the TransferDatabase Macro Action

---------------------------------------------------

Create a macro named Export1. This macro will export the Categories

table to a dBASE file.

   Macro Name     Action

   -------------------------------

   Export1        TransferDatabase

   Export1 Actions

   ---------------

   TransferDatabase

      Transfer Type:   Export

      Database Type:   dBASE III

      Database Name:   C:\dbase

      Object Type:     Table

      Source:          Categories

      Destination:     Test1.dbf

      Structure Only:  No

  Note: To use the TransferDatabase macro action to export to a

  Paradox table, you must choose "Paradox" for the Database Type

  argument and enter the Destination argument as "Test1.db".

Example 2 - Using an Access Basic Function

------------------------------------------

Create a new module and enter the following function:

   ' Note: The DoCmd statement should all be entered on one line.

   ' The line continuation character '_' improves the readability

   ' of the code.

      Function ExportdBASE ()

         DoCmd TransferDatabase a_export, "dBASE III", "c:\dbase", _

                  a_table, "Categories", "Test1.dbf"

      End Function

References


INF: Maximum Number of Rows in Table When Counter is the Key

 Article Number: Q97520

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

The maximum value of a Counter data type is the same as the maximum

value of a Long Integer. A Long Integer is 32 bits long and has a

maximum positive value of 2,147,483,647 and a minimum negative value

of -2,147,483,648. If you use a Counter as the primary key, a table

can contain up to four billion records. The maximum number of records

in the table is also limited by the maximum size of a database. For

more information, see Appendix A in the "Microsoft Access User's

Guide," version 1.0.

More Information:

Values in a Counter field increment from 1 to 2,147,483,647. The next

record receives the minimum negative value for a Long Integer,

-2,147,483,648. The Counter value for each subsequent record is one

greater than the previous value, until it reaches zero.

References


PRACC9303: Hang Importing .DBF Files Longer Than dBASE IV Max.

 Article Number: Q97521

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   CodeBase++ version 1.07 allows you to create .DBF files where the

   record length exceeds the dBASE IV maximum record length. Microsoft

   Access may hang (stop responding) when trying to import this type

   of .DBF file.

RESOLUTION

   Export the CodeBase++ .DBF file to delimited text, then import the

   ASCII file into Microsoft Access.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


INF: Sample DDE Macro Communicates with Microsoft Excel 4.0

 Article Number: Q97522

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

The text below demonstrates communication between two applications

through dynamic data exchange (DDE). Specifically, one example shows a

macro developed for Microsoft Excel version 4.0 for Windows that

starts Microsoft Access, loads a database and runs a macro. A second

example shows an Access Basic function that loads Microsoft Excel and

runs a macro.

More Information:

Running a Microsoft Access Macro from Microsoft Excel

-----------------------------------------------------

Perform the following three steps to demonstrate this behavior. These

steps assume that a "MESSAGE" macro already exists in Microsoft

Access.

1. In Microsoft Excel, choose New from the File menu, select Macro

   Sheet and choose OK.

2. Enter the following macro into the macro sheet. Substitute the

   appropriate location for files on your computer.

      =EXEC("c:\access\msaccess.exe c:\access\db4.mdb")

      Chan=INITIATE("MSACCESS","system")

      =APP.ACTIVATE("Microsoft Access")

      =EXECUTE(Chan,"MESSAGE")

      =TERMINATE(Chan)

      =RETURN()

3. To run the macro, select the first cell, select Run from the Macro

   menu and choose OK.

The EXEC function in the macro loads Microsoft Access minimized and

loads the DB4.MDB database. The macro initiates a DDE channel and

assigns it to the variable Chan. The APP.ACTIVATE switches to the

Microsoft Access window to show the macro actions running.

The EXECUTE function runs a macro named "MESSAGE," as follows.

   Name Summary:

   -------------

   Application Name :"MSACCESS:

   Window Title:"Microsoft Access"

   Topic: "System"

   Item: "Message"

Running a Microsoft Excel Macro from Microsoft Access

-----------------------------------------------------

Perform the following two steps to demonstrate this behavior. These

steps assume that a macro named "Message" already exists in a

Microsoft Excel macro sheet named "MACRO1.XLM."

1. In Microsoft Access, create a new function that contains the

   following text. Substitute the appropriate location for files on

   your computer.

      Function CallExcel ()

          Dim Chan

          x = Shell("c:\excel\excel.exe c:\excel\macro1.xlm", 1)

          Chan = DDEInitiate("Excel", "System")

          DDEExecute Chan, "[Run(""macro1.xlm!Message"")]"

          DDETerminate Chan

      End Function

2. Run the macro. For more information on how to run the macro, see

   the "Macros: running" topic using the Help menu.

The Shell function loads Microsoft Excel and the "MACRO1.XLM" macro

sheet full screen and leaves the focus on Microsoft Excel. The macro

initiates a DDE channel and assigns it to the variable Chan.

The EXECUTE function runs a macro named "Message".

      Name Summary:

      -------------

      Application Name :"Excel"

      Window Title:"Microsoft Excel"

      Topic: "System"

      Item: "[Run(""macro1.xlm!Message"")]"

The syntax for these two macros demonstrates that the correct syntax

for the "Item" depends on the target application.

Reference(s): Microsoft Access README.TXT

              Microsoft Excel "Function Reference" manual

References


INF: Displaying Start, Finish, and Elapsed Times on a Form

 Article Number: Q97523

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

The text below demonstrates creating command buttons to enter start

and finish times on a form. Elapsed time is also displayed on request.

This article assumes that you are familiar with Access Basic and with

creating applications using the programming tools provided with

Microsoft Access.

More Information:

The following seven steps use macros and Access Basic code to display

start and finish times on a form.

1. Create a new module called Module 1. Create the appropriate

   declaration section and add the following function. Enter each

   command on a separate line.

   'Note: In the following sample code, an underscore (_) is used

   'as a line continuation character. Remove the underscore when

   're-creating this code in Access Basic.

   '-----------------------------------------

   ' GLOBAL DECLARATION

   '-----------------------------------------

   Option Compare Database

   Option Explicit

   '=======================================================

   ' The following function calculates elapsed time.

   ' This function displays the total time elapsed in the

   ' following format:

   '    <hours>:<minutes>:<seconds>

   ' For example:

   '    48:57:04

   '=======================================================

   Function TimePassed (Startup, Done)

      TimePassed = Format(Int(Abs(Startup - Done)) * 24), "###:") + _

                      Format(Abs(Startup - Done), "nn:ss")

   End Function

2. Create a macro to set the elapsed time, as follows.

      Macro Name               Action

      -----------------------------------------------------

      Set Elapsed Time         Set Value

      Set Elapsed Time Actions

      -----------------------------------------------------

      Set Value

         Item: [Elapsed Time]

         Expression: TimePassed([Start Time],[Finish Time])

3. Create a macro to set the start and finish time, as follows.

     Macro Name     Condition                             Action

     ---------------------------------------------------------------

     SetTime  IsNull(Forms![Time Form]![Start Time])      Set Value

              Not IsNull(Forms![Time Form]![Start Time])  Set Value

      SetTime Actions

      -----------------------------

      Set Value

        Item: [Start Time]

         Expression: Now()

      Set Value

         Item: [Finish Time]

         Expression: Now()

4. Create a new blank, unbound form (do not select a table or query).

5. Add three text box controls to the form and assign them the

   following properties:

      Object: Text Box

      ----------------

      ControlName: Start Time

         Enabled: No

         Locked: Yes

      Object: Text Box

      ----------------

      ControlName: Finish Time

         Enabled: No

         Locked: Yes

      Object: Text Box

      ----------------

      ControlName: Elapsed Time

         Enabled: No

         Locked: Yes

6. Add three command button controls to the form, and assign them the

   following properties:

      Object: Command Button

      ----------------------

      ControlName: Begin

         Caption: Start

         OnPush: SetTime

      Object: Command Button

      ----------------------

      ControlName: Complete

         Caption: Finish

         OnPush: SetTime

      Object: Command Button

      ----------------------

      ControlName: Time Elapsed

         Caption: Time Elapsed

         OnPush: Set Elapsed Time

   Save the form as Time Form.

7. Choose Form view to test the example as follows.

   a. Choose the Start button. The current date and time display in

      both the start time and finish time boxes.

   b. Choose the Start button again. While the start time should not

      change, the finish time will update to the current data and

      time.

   c. Choose the Finish button to set or reset the finish time.

   d. Choose the Time Elapsed button to display the elapsed time in

      days, hours, and minutes.

Reference(s):

"Introduction to Programming", version 1.0, Chapter 3, "Access Basic

Essentials".

References


INF: Round or Truncate Values to Desired Number of Decimals

 Article Number: Q97524

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

The Format property of a control can round a number or currency field

to the desired number of decimal places. However, this does not change

the underlying data, which may contain additional digits that the

control does not display. If you add the values in these control, the

sum is based on the actual values and not the displayed values, which

can cause problem with perceived accuracy.

The text below presents four Access Basic functions that round or

truncate data to two decimal places so the displayed, formatted, value

and the actual numeric or currency data are the same.

More Information:

This article assumes that you are familiar with Access Basic code.

The functions are presented in two styles. The first style is

appropriate for the AfterUpdate property of a form control, to ensure

that the data entered matches the data displayed. The second style is

for use in expressions and calculated controls.

To round or truncate numbers to two decimal places, create a new

module in Microsoft Access, create an appropriate declaration section,

and add the following functions.

'******************************************************

'Declarations section of the module

'******************************************************

Option Explicit

Const Factor = 100

'=====================================================

' RoundAU and TruncAU are designed to be added to the

' AfterUpdate property on a form control.

'=====================================================

Function RoundAU(X)

   X = Int(X * Factor + 0.5) / Factor

End Function

Function TruncAU(X)

   X = Int(X * Factor) / Factor

End Function

'=====================================================

' RoundCC and TruncCC are designed to be used in

' expressions and calculated controls on forms and reports.

'=====================================================

Function RoundCC(X)

   RoundCC = Int (X * Factor + 0.5) / Factor

End Function

Function TruncCC(X)

   TruncCC = Int (X * Factor) / Factor

End Function

Examples of Using the Round and Truncate Functions

--------------------------------------------------

The following examples use the NWIND.MDB sample database provided with

Microsoft Access.

 - Add the TruncAU function to the AfterUpdate property of the Unit

   Price field in the Products form, as follows.

      Form: Products

      --------------

      ControlName: Unit Price

         AfterUpdate: =TruncAU([Unit Price])

   If the user accidentally enters $23.055 instead of $23.05, the

   TruncAu function catches the mistake and changes the value to

   $23.05. Instead, if you install RoundAu, the function changes the

   value to $23.06. If you use neither function, the value displays as

   $23.06 but the entered value, $23.055, is used in calculations.

 - Add TruncCC or RoundCC to expressions in a report or a SetValue

   macro action. The following example demonstrates using RoundCC in a

   report footer.

      Report: Summary of Sales By Year

      --------------------------------

      ControlName: Total Sales for Quarter

         ControlSource: =Sum(RoundCC([Order Amount]))

      ControlName: Total Sales for Year

         ControlSource: =Sum(RoundCC([Order Amount]))

   If you use RoundCC, the report Sums the values displayed in the

   report, even though the actual values may contain hidden digits.

NOTE: To change the number of decimal places used, change the value of

the global constant, Factor, as follows:

      10 = 1 decimal place

     100 = 2 decimal places

    1000 = 3 decimal places, etc.

References


INF: DoMenuItem Action in BeforeUpdate Property Causes Error

 Article Number: Q97525

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

If you create a macro that contains a DoMenuItem action that chooses

Undo Current Record from the Edit menu and run the macro from a form's

BeforeUpdate property, Microsoft Access generates the following

message when you edit data in the form:

   Command not available: UndoCurrentRecord.

However, if you select the Edit menu, Undo Current Record is available

and it works properly.

More Information:

Page 48 of the "Microsoft Access Language Reference," version 1.0,

discusses possible uses for this type of macro in the BeforeUpdate

property. Calling Undo Current Record causes the error message above,

but the SendKeys alternative does not cause the error.

Reference(s):

"Microsoft Access Language Reference," version 1.0, "BeforeUpdate,

AfterUpdate Properties", pages 47-48.

References


PRB: 'Circular Reference Caused by Alias' Error Message

 Article Number: Q97526

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   An attempt to run a query fails and Microsoft Access displays the

   following message:

      Circular reference caused by alias

      'field name' in query SELECT list.

CAUSE

   The alias, or label, of a calculated field cannot be identical to

   any of the field names used to calculate the field.

RESOLUTION

   Change the name of the calculated field or let Microsoft Access

   automatically assign a name for the field.

More Information:

Perform the following seven steps to demonstrate this behavior.

Steps to Reproduce Behavior

---------------------------

1. Open the NWIND.MDB sample database.

2. In the Database window, choose the Query button, then choose New. A

   query design screen appears, with a dialog box that prompts for a

   Table or Query to add to the query.

3. Select Catalog, then choose the Add button.

4. Choose the Close button to close the Add Table dialog window.

5. In the first field of the Query design grid, enter the following:

      unit price: [unit price]/100

6. From the Query menu choose Run. The following error occurs:

      Circular reference caused by alias 'unit price' in query

      definition's SELECT list.

7. Address this behavior, change the alias, or label, to resolve the

   error. For example, replace the unit price calculation with the

   following:

      price: [unit price]/100

References


PRACC9210: MS Access Ignores Paradox Private Directory Rules

 Article Number: Q97527

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Microsoft Access ignores Paradox private directory restrictions and

   allows you to examine and modify data in tables in them. Paradox,

   however, ignores any changes made by Microsoft Access, since it

   assumes the directories to be private.

RESOLUTION

   If the directory or directories in question are set as working

   directories, they work correctly.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

Paradox version 3.5 allows you to specify directories as "private

directories" (Paradox Menu: Tools/Net/SetPrivate). Private directories

are used to hold Answer tables and the results of queries, as well as

other types of data, and cannot be examined or changed by other users.

If another Paradox user attempts to do so, he or she receives the

error message, "This is a private directory, you are not allowed

access."

References


PRACC9210: Fast Search on Indexed Paradox Column Fails

 Article Number: Q97528

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A Fast Search on an indexed Paradox column fails, even when there

   is data to match the search criteria.

CAUSE

   This problem occurs when a Paradox column (field) name has the same

   name as the Paradox table it is contained in.

   In Paradox, the primary index is always stored in a table named

   <TABLENAME>.PX, and secondary indexes are stored in tables named

   <COLUMNNAME>.NXX. For example, with a table named "Authors" that

   contains fields named "Authors", "Books", and "Publisher", the

   primary index file is named AUTHORS.PX, and the secondary indexes

   are named BOOKS.N01, PUBLISHER.N02, AUTHORS.N03.

   When Microsoft Access performs a Fast Search, it ignores the file

   extensions for these indexes. As a result, if a column name is the

   same as a table name, Microsoft Access sees two indexes with the

   same name and assumes it to be a single multicolumn index instead

   of two separate single-column indexes. This results in strange

   behavior, such as not getting the results you would expect from a

   search or query.

RESOLUTION

   Be sure that the field names in the Paradox table differ from the

   table name.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRACC9303: GPF Using OpenForm Action to Hide Modal Pop-Up Form

 Article Number: Q97529

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   Using the OpenForm action to hide a modal pop-up form may cause a

   general protection (GP) fault.

RESOLUTION

   Instead of using the OpenForm action to hide a modal pop-up form,

   use the SetValue action to set the form's Visible property to

   False.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRACC9303: GPF When RunningSum Attempts to Evaluate #ERROR

 Article Number: Q97530

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If a report contains a control that evaluates to #ERROR, changing

   the RunningSum property to Over Group or Over All will cause a

   general protection (GP) fault.

CAUSE

   A common cause of this problem is placing the Sum() function in a

   text box used in the page footer. Aggregate functions, like Sum(),

   Count(), Avg() and so on, are not supported in the page header or

   page footer sections of a report and will return #ERROR if placed

   there. Adding the RunningSum property to a control using the

   aggregate of Sum() will cause the above GP fault as well as adding

   the RunningSum property to any control that returns #ERROR.

RESOLUTION

   Either correct the expression in the ControlSource property so that

   it evaluates correctly, or move the location of the control.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

For an example of placing totals in page headers and footers, see the

information starting on page 576 of the "User's Guide."

References


PRB: 'Internal Database Error (-5001)' Using the Btrieve NLM

 Article Number: Q97531

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You receive the following error message when using the Btrieve

   Network Loadable Module (NLM) with Microsoft Access:

      Internal Database Error (-5001)

CAUSE

   You do not have correct versions of BREQUEST.EXE, WBTRCALL.DLL, and

   WBTRVRES.DLL. In order for the Btrieve NLM to function properly

   with Microsoft Access, Microsoft recommends that the NLM requester

   (client) use the 6.0 versions of BREQUEST.EXE, WBTRCALL.DLL,

   WBTRVRES.DLL, and the 5.15 version of BTRIEVE.NLM.

RESOLUTION

   To obtain the correct versions of these files:

   1. Sign on to CompuServe.

   2. At the "!" prompt, type "GO NOVLIB" (without the quotation

      marks).

   3. Go into the BTRIEVE/XQL library section.

   4. Download the BT515.ZIP file.

   5. Use PKUNZIP.EXE to unpack the file.

   6. Unpack the BTRREQ.ZIP file that gets unpacked from step 5.

   7. Obtain the following files:

         WBTRCALL.DLL

         WBTRVRES.DLL

         BREQUEST.EXE

   8. Follow the readme notes to properly install and execute these

      files and for information on how to apply patches 1-65 to the

      BTRIEVE.NLM file on your server.

   9. Modify your WIN.INI file with the following lines:

         [BREQUESTDPMI]

         datalength=4096

         tasks=10

         local=no

         chkparms=no

More Information:

Btrieve and the Btrieve NLM are manufactured by Novell, Inc., a

company independent of Microsoft; we make no warranty, implied or

otherwise, regarding these products' performance or reliability.

References


PRACC9303: GPF Using Empty String with CVDate() or IsDate()

 Article Number: Q97532

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   If either the CVDate() or IsDate() function is called with an empty

   string as the expression, such as CVDate(""), Microsoft Access

   causes a general protection (GP) fault.

RESOLUTION

   Verify that you are passing valid date strings in the argument to

   CVDate() or IsDate().

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

The CVDate() function converts strings or numeric expressions to a

variant of data type date. The IsDate() function returns a value

indicating whether or not a variant argument can be converted to a

date.

References


PRACC9303: GPF Declaring New Object Variable During Break Mode

 Article Number: Q97533

 CREATED: 13-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   A general protection (GP) fault occurs you declare a new object

   variable such as a form or a table during break mode (when

   debugging Access Basic code) and then attempt to recompile the

   code. The following are examples of object variable declarations:

       Dim F as Form

       Dim T as Table

RESOLUTION

   Do not declare these types of variables while in break mode.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRB: Access Basic Does Not Support Yes and No Action Arguments

 Article Number: Q97622

 CREATED: 15-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you use the DoCmd statement in Access Basic, Microsoft Access

   does not recognize a Yes or No argument.

RESOLUTION

   Use True for the argument instead of Yes, and use False instead of

   No. True and False are reserved words in Access Basic.

STATUS

   This behavior is by design.

More Information:

Even though macro actions accept the Yes or No action argument, Access

Basic recognizes only True or False. However, the No argument will

actually work because Microsoft Access does not recognize No.

Therefore, a zero value is returned, which is interpreted as False.

However, a Yes argument will also return a zero value, or False.

Whether you use Yes or No, the argument will always be interpreted as

False.

Steps to Reproduce Behavior

---------------------------

1. Create the following module:

   '************************************************************

   'Declarations Section of the module.

   '************************************************************

   Option Compare database

   'Do not include the Option Explicit or you will receive an error

   'message stating that you did not declare your variable "no".

   'This is because Access Basic does not recognize "no" as a

   'reserved word.

   '=============================================================

   'The following function will run a macro action that will turn

   'warnings off, then attempt to turn them back on.

   '==============================================================

   Sub SetWarnings()

      DoCmd SetWarnings No     'Turn warnings off

      DoCmd SetWarnings Yes    'Turn warnings on

   End Sub

2. Run the sub procedure from the Immediate window by typing the

   following in the window and pressing ENTER:

      SetWarnings

3. Try to delete a form, report, or table. Note that you did not

   receive any warnings. The sub procedure turned off the warnings,

   but did not recognize the Yes argument, so it did not turn them

   back on.

4. Change the sub procedure to:

      Sub SetWarnings()

         DoCmd SetWarnings No

         DoCmd SetWarnings True

      End Sub

5. Run the sub procedure from the Immediate window again.

6. Try to delete a form, report, or table. Note that you will receive

   a warning. The sub procedure recognized the True argument and

   turned the warnings back on.

References


PRB: Cannot Edit Access Data Using Query with Attached dBASE

 Article Number: Q97623

 CREATED: 15-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   You are unable to edit fields in a Microsoft Access table through a

   query that joins an attached dBASE table to the Microsoft Access

   table. The query joins the tables on a key field in the Microsoft

   Access table.

CAUSE

   Since relationships can't be created with attached tables using the

   Edit Relationship dialog box, joins must be performed manually in

   the QBE grid. When a join is created between an attached dBASE

   table and a Microsoft Access table on the Primary key field,

   Microsoft Access assumes the type of relationship is one-to-many

   with the Microsoft Access table representing the "one" side. You

   cannot edit fields that come from the "one" side of a one-to-many

   relationship.

RESOLUTION

   Establish a main/subform setup with the subform based on the

   attached dBASE table and the main form based on the Microsoft

   Access table. You will be able to edit data from both tables

   through their respective forms.

More Information:

Even if the data in the dBASE table actually has a one-to-one

relationship with the Microsoft Access table, you will not be able to

edit fields from the Microsoft Access table using a query joining

these tables. If you create a single form based on this query, and set

the form's AllowUpdating property to Any Tables, you will not be able

to edit data in the Microsoft Access table.

References


INF: How to Synchronize Two Combo Boxes on a Form

 Article Number: Q97624

 CREATED: 15-APR-1993

 MODIFIED: 21-APR-1993

Summary:

The information below describes how to create two combo boxes so that

making a selection in one limits the list of available items in the

other. For example, suppose a user needs to enroll in a school course.

The user selects a class from one combo box and then selects from a

second combo box a time and location from a list of available times

for the class selected in the first combo box.

More Information:

The following example uses the NWIND.MDB sample database supplied with

Microsoft Access. One combo box will list the available product

categories; the second will list the available products for the

category selected in the first combo box.

1. Create a blank, unbound, form with two combo boxes where the

   properties are set to the following:

      Combo Box 1

      -----------

      ControlName:   Categories

      RowSourceType: Table/Query

      RowSource:     Categories

      ColumnCount:   1

      BoundColumn:   1

      After Update:  Refresh Products

      Combo Box 2

      -----------

      ControlName:   Products

      RowSourceType: Table/Query

      RowSource:     Category Combo Query

      ColumnCount:   2

      ColumnWidth:   0

      BoundColumn:   1

2. Save this form as "Categories and Products".

3. Create a new query based on the Products table.

4. Add the Product ID, Product Name, and Category ID fields to the

   query grid.

5. For the Category ID field, clear the Show check box and type the

   following in the criteria row:

      Forms![Categories and Products]![Categories]

6. Save this query as "Category Combo Query".

7. Create a new macro as follows:

      Action         Arguments

      ------------------------

      Requery        ControlName: Products

8. Save this macro as "Refresh Products".

Now, whenever a category is selected in the first combo box, the

second box will list the available products for the selected category.

How This Technique Works

------------------------

The second combo box is filled with the contents of Category Combo

Query. This query finds all products that have a Category ID that

matches the Category ID selected in the first combo box on the form.

Whenever a category is chosen from the first combo box, the

AfterUpdate property executes the Refresh Products macro, which forces

the second combo box to run Category Combo Query again. The macro

forces the second combo box to refresh its list of products based on

the new category selection. Without this macro, the user would have to

force the second combo box to refresh itself by pressing the F9

function key.

References


PRACC9304: Cue Cards Can't Be Started Because Incomplete Setup

 Article Number: Q97625

 CREATED: 15-APR-1993

 MODIFIED: 21-APR-1993

Summary:

SYMPTOMS

   When you attempt to run Cue Cards from a workstation setup for a

   network installation of Microsoft Access, you receive the following

   error message:

      Cue Cards Couldn't Be Started Because of Incomplete Setup.

CAUSE

   Microsoft Access has been set up to run from a network drive and

   the path that is used to execute MSACCESS.EXE uses the universal

   naming convention (UNC).

RESOLUTION

   The path used to execute MSACCESS.EXE from Program Manager must use

   the complete conventional path, including the drive letter, in

   order for Cue Cards to run on a workstation.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

More Information:

To correct this situation follow these steps:

1. From Program Manager select the Microsoft Access icon.

2. From Program Manager's File menu, choose Properties.

3. In the Command Line text box, type the complete path including the

   drive letter for MSACCESS.EXE (for example, F:\ACCESS\MSACCESS.EXE).

References


INF: How to Determine Number of Working Days Between Two Dates

 Article Number: Q97757

 CREATED: 20-APR-1993

 MODIFIED: 10-MAY-1993

Summary:

This article explains how to determine the number of work days between

to different dates.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access.

More Information:

There is no intrinsic function within Microsoft Access to determine

the number of work days between two given days. To determine the

number of days, you will need to call the Access Basic function shown

in the code below. The result of this function will include the

starting date and the ending date; therefore, if you try to determine

the number of days between 02/02/93 to 02/03/93 using this function,

it will return two days.

  Note: In the following sample code, an underscore (_) is used as a

  line-continuation character. Remove the underscore when re-creating

  this code in Access Basic.

Option Explicit

Function Work_Days (BegDate As Variant, EndDate As Variant) As Integer

   Dim WholeWeeks As Variant

   Dim DateCnt As Variant

   Dim EndDays As Integer

   BegDate = DateValue(BegDate)

   EndDate = DateValue(EndDate)

   WholeWeeks = DateDiff("w", BegDate, EndDate)

   DateCnt = DateAdd("ww", WholeWeeks, BegDate)

   EndDays = 0

   Do While DateCnt <= EndDate

      If Format(DateCnt, "ddd") <> "Sun" And _

                       Format(DateCnt, "ddd") <> "Sat" Then

         EndDays = EndDays + 1

      End If

      DateCnt = DateAdd("d", 1, DateCnt)

   Loop

   Work_Days = WholeWeeks * 5 + EndDays

End Function

Example

-------

To call the function you can either pass a valid string, or an actual

date value. Below are two examples of how to call this function from

the Immediate window:

   ?Work_Days("01/01/93", "12/31/96")

    1043

   ?Work_Days(#03/05/93#, #04/06/93#)

    23

References


INF: Access Workstation Setup (/N) Instructions Are Confusing

 Article Number: Q97771

 CREATED: 21-APR-1993

 MODIFIED: 25-MAY-1993

Summary:

When you set up Microsoft Access to run from a network server, the

on-screen instructions are misleading. This article explains what

files are copied to your hard disk drive (or user directory) when you

choose to run Microsoft Access from the network server.

More Information:

When you run the SETUP /N command to install Microsoft Access on a

workstation, Setup presents the following question:

   Do you want to install Microsoft Access on your hard disk?

To run from the network server instead of your local hard disk drive,

choose No. Setup then presents another dialog box, which says:

   Setup will install Microsoft Access in the following directory,

   which will be created if it doesn't already exist.

This is confusing because it implies that a full copy of Microsoft

Access will be installed on the local drive. However, this is not the

case. Only the files below are copied to your hard disk drive.

To the Access directory:

   DETCMD.DLL

   SETUP.INI

   STFSETUP.EXE

   STFSETUP.INF

   SYSTEM.MDA  <- Only if a workgroup is not joined

To the Windows directory:

   MSACCESS.INI

   WINHELP.EXE  <- If not Windows 3.1 or above

   WINHELP.HLP  <- If not Windows 3.1 or above

   WINHELP.INI  <- If not Windows 3.1 or above

To the WINDOWS\SYSTEM directory:

   CTL3D.DLL

   COMMDLG.DLL  <- If not Windows 3.1 or above

   DDEML.DLL    <- If not Windows 3.1 or above

   OLECLI.DLL   <- If not Windows 3.1 or above

   OLESRV.DLL   <- If not Windows 3.1 or above

   SHELL.DLL    <- If not Windows 3.1 or above

   VER.DLL      <- If not Windows 3.1 or above

These are the files necessary to run Microsoft Access from the

network.

References


PRB: Unable to Use Hexadecimal or Octal Values in Properties

 Article Number: Q97772

 CREATED: 21-APR-1993

 MODIFIED: 03-MAY-1993

Summary:

SYMPTOMS

   You cannot use hexadecimal or octal values referenced as &Hxxxx

   (for hex numbers) or &Oxxxx (for octal numbers) in a control's

   properties.

CAUSE

   Most control properties expect either a string expression or a

   decimal number.

RESOLUTION

   Use decimal numbers rather than hexadecimal or octal numbers.

   To determine the decimal equivalent of a hexadecimal or octal

   number, enter that number in the BorderColor property of a

   control (first write down the original value of the property so

   that you can easily restore it). Microsoft Access will convert

   hexadecimal and octal numbers (&H or &O format) entered in a

   control's color properties, and convert them to decimal numbers.

More Information:

If you enter a hexadecimal or octal number in a control property that

expects a string expression (for example: ValidationRule), Microsoft

Access will convert what you entered into a literal string.

If you enter a hexadecimal or octal number in a control property that

expects a number that is a long data type (for example: BackColor),

Microsoft Access will convert what you entered into a decimal number.

The following steps demonstrate how this applies to parameters that

you may wish to pass in a function.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database Northwind Traders (NWIND.MDB)

2. Open the Add Products form in Design mode.

3. Select the Product ID text box.

4. From the View menu, choose Properties.

5. In the property sheet, enter the following dummy function into the

   ValidationRule field:

      =mytest(&HFF)

   Microsoft Access converts this expression to:

     =mytest("&HFF")

References


PRB: Export Table to Other Database Type Doesn't Create Index

 Article Number: Q97773

 CREATED: 21-APR-1993

 MODIFIED: 03-MAY-1993

Summary:

SYMPTOMS

   You have a Microsoft Access table with a primary key field. When

   you export the table to any of the supported database formats the

   index is not created. Also, if you import a foreign database file

   that has an index or key, the Micrososft Access table will not

   have a primary key defined.

RESOLUTION

   When you export a Microsoft Access table to an external database

   format you will need to use the native application for that file

   type to define the index or key fields. Likewise, after a foreign

   database file is imported to your Microsoft Access database, you

   will need to open the table in Design view and define the primary

   key field(s).

CAUSE

   The Microsoft Access export facility only exports data, not index

   definitions.

STATUS

   This behavior is by design.

More Information:

The following database formats are supported by the Import and Export

facilities in Micrososft Access. You will have to use the native

product to create indexes on the file after it is exported from

Microsoft Access.

FoxPro 2.0

Paradox 3.x

dBASE III +

dBASE IV

Btrieve

SQL Server

References


INF: Graph May Not Hold Formatting

 Article Number: Q97774

 CREATED: 21-APR-1993

 MODIFIED: 03-MAY-1993

Summary:

When you create a graph on a Form or Report and make some changes

within Microsoft Graph to the formatting or to the data itself, these

changes may not show up in the Form or Report.

This article discusses the different sources of information that Graph

normally uses, and the hierarchy of graph changes.

More Information:

There are several sources of information for a graph: the Microsoft Graph

application, the contents of the graph object's RowSource property,

and the data in the underlying table or query.

Access re-generates the graph every time you switch to Form view,

Print Preview, or when you select Print. When Access re-generates the

graph it reads the SQL statement in the object's RowSource property.

>From this SQL statement Access obtains the name of the graph, and the

data to be graphed. Access obtains the format of the data from the

table or query that is the source of the graph's SQL statement.

The hierarchy of changes is as follows:

Anything that you change in Microsoft Graph can be over-written by

the SQL statement in the graph's RowSource property, or by the

underlying data itself. (Examples of what you can change in Microsoft

Graph include font, font size, font color, and the type of graph

selected.)

Anything that you change in SQL statement of the graph's RowSource

property can be overwritten by the underlying data. (Examples of what

you can change in the SQL statement include the title and labels.)

Anything that you change in the underlying data should always have

precedence over other changes. (An example of what you can change in

the underlying data is the actual format of the data. However, if the

SQL statement contains a calulated field such as

=Format([Start Date],"MMM") the format will be determined by the

result of this calculation, not by the underlaying data.)

For more information on customizing the title, labels, and data in a

graph, query on "Graph and Format and Label" or "Graph and Title".

Reference(s):

"Microsoft Graph User's Guide", version 3.0, Chapter 3, "Working with

a Chart", pages 71-101

References


PRB: Layout Changes to Subform in Datasheet View Not Saved

 Article Number: Q97775

 CREATED: 21-APR-1993

 MODIFIED: 03-MAY-1993

Summary:

SYMPTOMS

   You have a form that contains a subform, and the subform is

   displayed in Datasheet view. If you make changes to the width and/or

   order of the columns in the subform, the changes made to the subform

   will not be shown if you close and then reopen the main form.

CAUSE

   The modified subform must be reread by the mainform in order to

   recognize the changes you made.

RESOLUTION

   You should open the subform by itself, make the desired layout

   changes, and then save the subform. When the mainform is opened the

   modified subform will be displayed. Or, you must cause the mainform to

   reread the subform object while you are in design view of the

   mainform.

More Information:

Below are two methods you can use to commit subform changes to the

mainform. Follow these steps in the sample database Northwind Traders

(NWIND.MDB)

Steps to Reproduce Behavior

--------------------------

1. Open the Categories form in Form view. The Categories Subform

   has a field called Product Name.

2. Modify the subform by decreasing the width of the Product Name

   field. Reverse the order of the Unit Price and Quantity Per Unit

   fields.

3. Close and then reopen the the Categories form in Form view. Notice that

   your changes to the Categories Subform do not show up.

The steps below show how to commit subform changes to the Main form:

Method 1

--------

1. Open the Categories Subform. Switch the form to Datasheet view.

2. Make the same changes you made in step 2 of 'Steps to Reproduce

   Behavior'.

3. Choose Save Form from the File menu.

4. Open the Categories form in Form view and now the changes you made

   to the Categories Subform will show.

Method 2

--------

1. Open the Categories form in design view. Double-click the

   Categories Subform control to open the subform in design view.

2. Switch the Categories subform to Datasheet view.

3. Make the same changes you made in step 2 of 'Steps to Reproduce

   Behavior'.

3. Choose Save Form from the File menu. Close the Categories Subform

   and go back to the Categories form which should still be open in

   design view.

4. If the Categories Subform control is not still selected, click one

   time on the Categories Subform control to select the subform control.

5. Click a second time to move the cursor into the subform control.

   You should see the cursor blinking inside the control at this point.

6. Press ENTER to cause the main form reexamine the subform.

7. Switch to Form view of the Categories form and now the changes you

   made to the Categories Subform will show.

Reference(s):

"Microsoft Access Users Guide," version 1.0, Chapter 10, "Creating

Forms Based on More than One Table," page 275

References


INF: Executing an Access Macro from Visual Basic using DDE

 Article Number: Q97776

 CREATED: 21-APR-1993

 MODIFIED: 03-MAY-1993

Summary:

The following information provides some examples of how to use Visual

Basic to execute macros in Microsoft Access using DDE (Dynamic Data

Exchange).

More Information:

The following code example demonstrates how to run a macro called

"MyMacro" in Microsoft Access from a Visual Basic application.

   Sub Command1_Click()

      'the character between MSACCESS and System is the pipe symbol

      Text1.LinkTopic = "MSACCESS|System"

      ' Establish a manual DDE link to Access

      Text1.LinkMode = 2

      ' Run the macro called "MyMacro"

      Text1.LinkExecute "MyMacro"

      ' Terminate the DDE link to Access

      Text1.LinkMode = 0

   End Sub

To use this code, create a new Visual Basic program with a text box

and a command button with the following properties:

   Text box

   --------

      Name: Text1

   Command Button

   --------------

      Name: Command1

Double click on the command button and enter the code example listed above

between the "Sub Command1_Click ()" and "End Sub" lines.

When you run this example, be sure that Microsoft Access is running and

that a database is opened which contains a macro called "MyMacro". For

testing purposes, you may want to create a macro in Access called "MyMacro"

which contains a single MsgBox action.

NOTE: While the above example uses the Microsoft Access system Topic

listed in the LinkTopic line, Microsoft Access is capable of executing

a macro with virtually every valid topic it supports. For a list of

topics that Microsoft Access supports, query on the following keywords:

    b_waccess and dde and server and topics

References


PRACC9303: Multiple Users Adding Fields Causes Cross-Linking

 Article Number: Q97995

 CREATED: 28-APR-1993

 MODIFIED: 10-MAY-1993

Summary:

SYMPTOMS

   Incorrect data appears in tables when multiple users load and

   modify the same database within minutes of each other.

   A typical situation where this problem occurs:

      1. User1 opens a database and opens a table.

      2. User2 opens the same database and makes a change to the

         design of a table.

      3. Less than a minute later, User1 makes a change to the

         design of a table.

   Either user may then notice data corruption in the table. Problems

   can manifest themselves in one of the following ways:

      - The data from one field in the table may be displayed in a

        new field.

      - Data typed into a new or changed field may be displayed in a

        second field.

      - Attempting to copy the table with new or changed fields

        generates an error.

CAUSE

   This problem can occur because information about tables in a

   database is read from the system tables and cached into memory by

   Microsoft Access when a user opens a database. The information in a

   user's cache can become obsolete if another person has just made a

   change and that changed information is not re-read before the first

   user makes changes. If this happens, the table can become

   corrupted.

   For example, in the situation above, User1 has the information for

   the table cached, User2 makes a change, and then User1 makes a

   change before the system tables are read again and, as a result,

   the table can become corrupted.

   It is not necessary for both users to open or change the same table

   for corruption to occur. This is because the information for the

   table opened by User1 may be on the same page in the system table

   as the information for the table modified by User2, and if that

   page is cached by Microsoft Access, table corruption can occur.

RESOLUTION

   Information in the cache is discarded on a regular basis for tables

   not being used, so problems will not occur unless changes are made

   before Microsoft Access has had a chance to flush the cache. To

   ensure that information in the cache is flushed, wait at least one

   to two minutes after a user has modified a table before opening a

   table in Design view to allow Microsoft Access to flush the cache.

   If the database is corrupt, compacting the affected database

   usually corrects the problem. To do this, choose Compact Database

   from the File menu when no database is open.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. We are researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRACC9303: Password Is Case Sensitive But Verification Is Not

 Article Number: Q98223

 CREATED: 02-MAY-1993

 MODIFIED: 03-MAY-1993

Summary:

PROBLEM ID: 479

SYMPTOMS

   When changing your password from the Password option on the

   Security menu, the "Verify" text box is not case sensitive in

   comparing the verification to the password you typed into the "New

   Password" text box. However, the next time you enter Microsoft Access,

   the password you type in must exactly match the new password. The

   password dialog box is case sensitive.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.00. We are researching this problem and will post new

   information here as it becomes available.

More Information:

Steps to Reproduce Behavior

--------------------------

1. From the Security menu, choose Change Password.

2. Type the old password if one exists, or simply type in a new

   password in the New Password box. Type the new password in upper case

   letters.

3. Type the new password in the verify box in lower case letters.

   Select OK.

4. Exit Microsoft Access and restart it.

5. Try typing the password in lower case letters. You will receive the

   following error:

      Not a valid account name or password.

6. Type the password in all upper case to load Microsoft Access.

Reference(s):

"Microsoft Access User's Guide," version 1.0, page 624.

References


PRB: ErrMsg: Couldn't Open Table MSysAccounts

 Article Number: Q98224

 CREATED: 02-MAY-1993

 MODIFIED: 10-MAY-1993

Summary:

SYMPTOMS

   You receive the following error message when attempting to start

   Microsoft Access:

      Couldn't open Table 'MSysAccounts' in SYSTEM.MDA

CAUSE

   The SystemDB entry in the [Options] section of the MSACCESS.INI

   file points to a file other than a valid SYSTEM.MDA file.

RESOLUTION

   Use the Change Workgroup Icon in the Microsoft Access Group to

   reset the MSACCESS.INI file to the correct path for the SYSTEM.MDA

   file, or open the MSACCESS.INI file in Notepad and correct the

   entry.

More Information:

For example, a correct entry in the MSACCESS.INI file is:

   [Options]

   SystemDB=C:\ACCESS\SYSTEM.MDA

References


INF: Automatically Open a Combo Box Upon Entry

 Article Number: Q98225

 CREATED: 02-MAY-1993

 MODIFIED: 03-MAY-1993

Summary:

When you are entering a lot of data, you don't want to have to type

additional keystrokes or stop and use the mouse to open a combo box.

This article presents a generic Macro that can be used to cause a

combo box to open when you set the focus to the control by Tabbing to

it or clicking the mouse on the control.

More Information:

A macro with a single action, SendKeys, will be used. You can use the

same Macro for all combo boxes on your form.

1. Create a Macro called Open combo box.

Macro: Open combo box

---------------------

   Action: SendKeys

      Keystrokes: %{DOWN}

      Wait: Yes

2. Open your Form in Design view.

3. Add the macro Open combo box to the OnEnter property of your combo

   box.

Reference(s):

"Microsoft Access Language Reference," version 1.0,pages 434-435

Key codes listed in  "SendKeys Statement"

References


PRB: Err Msg: Macro '' Not Found

 Article Number: Q98226

 CREATED: 02-MAY-1993

 MODIFIED: 10-MAY-1993

Summary:

SYMPTOMS

   When you are entering data using a form, you get the following

   error message:

      Macro '' not found

CAUSE

   This is may be caused by one or more spaces having been

   inadvertently typed in either the form's or a control's event

   properties, such as OnCurrent or AfterUpdate.

RESOLUTION

   Open the form in Design view and remove the offending space(s).

More Information:

Microsoft Access doesn't trim the macro name when trying to find the

macro, but does trim it when displaying the error message, so you will

just see two single quotation marks (no space separating them), which

looks like one double quotation mark.

You should be able to determine whether the space is located in a

control's event property or a form's event property based on what

actions trigger the message.

For example, if the error occurs in one of the following situations:

1. Opening the form

   - Check the form's OnOpen or OnCurrent property.

   - Check the OnEnter property for the first control that receives the

     focus when the form is opened.

2. Typing in a control

   - Check the control's BeforeUpdate or AfterUpdate property.

3. Saving a record

   - Check the form's BeforeUpdate or AfterUpdate property.

4. Moving to a new record

   - Check the form's OnCurrent property (also see #3).

Once you have determined which property is causing the problem, open

the form in Design view and remove the space from that property. If

you're still not sure which property is causing the problem, move to

each blank property and press the DEL key.

  Note: You may have spaces in multiple properties so it is a good

  idea to check them all.

Steps to Reproduce Behavior

--------------------------

  Note: This example uses the NWIND.MDB sample database.

1. Open the Employees form in Design view.

2. Display the property sheet by choosing Properties from the View

   menu.

3. Select the Last Name control and type a single space in the

   AfterUpdate property.

4. Change to Form view and type data in the Last Name control.

   When you attempt to exit this field, you will receive the error

   message.

References


INF: Explanation of Option Compare Database

 Article Number: Q98227

 CREATED: 02-MAY-1993

 MODIFIED: 03-MAY-1993

Summary:

The manual describes Option Compare Binary and Option Compare Text.

However, the manual's description of Option Compare Database is

not so clear. The following is the description:

   Comparison is based on the characters' relative postion according

   to the sort order specified when the database was created or

   compacted.

More Information:

Option Compare Database has to do with the value of one character

compared to another at it is defined in the View->Options menu. For

example, if you had Option Compare Binary, then the following

expression...

   "a" > "Z"

..would be True because the ASCII value of "a" is greater than the

ASCII value of "Z". However, with Option Compare Text, it would return

False because "Z" comes after "a" in the alphabet. Option Compare

Database means that the comparison depends on whatever setting you

have for the 'New Database Order' option in the View->Options dialog.

When you bring up the View->Options dialog, one of the items available

is 'New Database Sort Order'. Option Compare Database makes it so

that the order of one value compared to another depends on whatever is

set for this option.

References


INF: Can't Create Relationships with Attached Tables

 Article Number: Q98228

 CREATED: 02-MAY-1993

 MODIFIED: 03-MAY-1993

Summary:

You cannot create a relationship with an attached table. Relationships

can only be created with Microsoft Access tables.

To establish a relationship between two tables switch to the Database

window for an opened database. From the Edit menu, choose

Relationships. When you drop down the list box to select the Primary

Table, attached tables will not appear in the list. Any joins

involving attached tables must be created in the QBE grid.

For more information, search for "relationships between tables", then

"Defining Relationships Between Tables" using the Help menu.

References


INF: How to Determine What View a Form is Displayed

 Article Number: Q98229

 CREATED: 02-MAY-1993

 MODIFIED: 03-MAY-1993

Summary:

There are no internal functions or properties within Microsoft Access

to determine if a form is in either Form view or Datasheet view. To

determine if a form is in Datasheet view or Form view, you will need

to call a series of Windows API functions.

This article assumes that you are familiar with Access Basic and with

creating Access applications with the programming tools provided with

Access.

More Information:

To determine the view that a form is presently in, call the function

listed below and pass the form as an argument to the function such

as:

   X% = Is_FormView (Forms!Form)

If the form is in Form view, the returned value will be a nonzero

number. If the form is in Datasheet view, zero will be the returned

value.

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

Note: You may have some Windows API functions defined in an existing

Microsoft Access library, therefore your declarations may be

duplicates. If you receive the duplicate procedure name error, remove

or comment the declare statement from your code.

Option Explicit

Declare Function GetWindowWord% Lib "User" (ByVal hwnd%,

                    ByVal nIndex%)

Declare Function GetWindow% Lib "User" (ByVal hwnd%, ByVal wCmd%)

Declare Function IsWindowVisible% Lib "User" (ByVal hwnd%) As Integer

Declare Function GetClassName% Lib "User" (ByVal hwnd%,

                    ByVal lpClassname$, ByVal nMaxCount%)

Const GW_SiblingHwnd% = 2

Const GW_CHILD = 5

Function Is_FormView (F As Form)

   Dim SiblingHwnd%, CName$, CNameLen%

   'get the first child window of the specied form

   SiblingHwnd% = GetWindow(F.hwnd, GW_CHILD)

   'enumerate through the forms child windows until exhausted

   'or you find a visible sub-window with the classname of

   '"OFormSub".

   Do While SiblingHwnd%

      'allocate temporary space.

      CName$ = Space$(128)

      'get the class name of the specified window.

      CNameLen% = GetClassName(SiblingHwnd%, CName$, Len(CName$))

      'peel off the extra characters in the padded string.

      CName$ = Mid$(CName$, 1, CNameLen%)

      ' if the window is visible, and the classname is OFormSub

      ' then the form is either in Design view, or Form view and

      'not in Datasheet view.

      If IsWindowVisible(SiblingHwnd%) And CName$ = "OFormSub" Then

         Exit Do

      End If

      'get the next sibling window.

      SiblingHwnd% = GetWindow(SiblingHwnd%, GW_SiblingHwnd%)

   Loop

   Is_FormView = SiblingHwnd%

End Function

Reference(s):

"Microsoft Windows 3.1 Programmer's Reference," Volume 2

References


INF: Identify Records with Duplicate Data in Primary Key

 Article Number: Q98230

 CREATED: 02-MAY-1993

 MODIFIED: 25-MAY-1993

Summary:

When you import data from other databases, records may contain

duplicate information in the primary key (which can be composed of one

or more fields). You can run a Make Table query to eliminate the

duplicate information, but if two or more records have the same value

in the primary key, you may want to manually reconcile the information

in the records to make the records unique.

This article includes sample queries that show how to list duplicates

for primary keys that contain a single field and those that contain

multiple fields.

More Information:

Example 1 - A Single-Field Primary Key

--------------------------------------

This example uses a table called MyTable, with the Name field as the

primary key.

1. For performance reasons, open MyTable in Design view and give Name

   an index:

      Table: MyTable

      --------------

      Field:   Name

      Indexed: Yes (Duplicates OK)

2. Create a query called Find Duplicates.

3. Add MyTable to the query.

4. From the View menu, select View Totals.

      Query: Find Duplicates

      ----------------------

      Field: Name

      Total: Group By

      Field: Name

      Total: Count

      Criteria: >1

   The equivalent SQL statement is:

      SELECT DISTINCTROW

         Name, Count(Name) As CountOfName

      FROM

         MyTable

      GROUP BY

         Name

      HAVING

         Count(Name)>1

      WITH OWNERACCESS OPTION;

5. Run the query. In the first column, the duplicate key values

   appear. In the second column, the number of occurrences of the

   duplicate value appears.

Example 2 - Multiple-Field Primary Key

--------------------------------------

This example uses a table called MyTable, with the First Name and Last

Name fields as the primary key.

1. For performance reasons, open MyTable in Design view and give First

   Name and Last Name an index:

      Table: MyTable

      --------------

      Field:   First Name

      Indexed: Yes (Duplicates OK)

      Field:   Last Name

      Indexed: Yes (Duplicates OK)

2. Create a query called Find Duplicates.

3. Add MyTable to the query.

4. From the View menu, select View Totals.

      Query: Find Duplicates

      ----------------------

      Field: Last Name

      Total: Group By

      Field: First Name

      Total: Group By

      Field: First Name

      Total: Count

      Criteria: >1

   Note: On the query grid, set the Total field to Group By for all

   fields in the key except the final one. Set the final field to Count.

   The equivalent SQL statement is:

      SELECT DISTINCTROW

         [Last Name], [First Name],

         Count([First Name]) As [CountOfFirst Name]

      FROM

         MyTable

      GROUP BY

        [Last Name], [First Name]

      HAVING

        Count([First Name])>1

      WITH OWNERACCESS OPTION;

5. Run the query. In the first two columns, the duplicate key values

   appear. In the third column, the number of occurrences of the

   duplicate values appears.

For more information, query on the following words in the Microsoft

Knowledge Base:

   filter and unique and query

References


PRB: Empty Row of List Box can be Selected

 Article Number: Q98298

 CREATED: 02-MAY-1993

 MODIFIED: 03-MAY-1993

Summary:

SYMPTOMS

   An Empty or Null Row of a list box can be selected.

CAUSE

   Null is a valid selection in Microsoft Access.

STATUS

   This behavior is by design.

More Information:

It is also possible to select an Empty or Null value in a combo box.

Steps to Reproduce Behavior

--------------------------

1. Create a new Form.

2. Create a list box on the form with the following properties:

      Object: list box

      ----------------

      RowSourceType: Value List

      RowSource: 1;2;;4

3. Choose Form from the View menu.

You can select the empty row between 2 and 4.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 9, "Designing

Forms" pages 233-243

References


PRB: Empty Subforms Will Not Be Visible in Print Preview

 Article Number: Q98299

 CREATED: 02-MAY-1993

 MODIFIED: 03-MAY-1993

Summary:

SYMPTOMS

   When you preview a form containing a subform, the subform area is

   completely blank. However, the subform control does appear in the

   design view of the main form.

CAUSE

   If you have a subform that does not have any data in it, the

   subform will show up in Form view with just the structure. However, no

   part of the subform will be visible in Print Preview mode.

STATUS

   This behavior is by design.

References


INF: Finding Out What User You Are Logged

 Article Number: Q98300

 CREATED: 02-MAY-1993

 MODIFIED: 03-MAY-1993

Summary:

Here are two quick ways to find put what user you are logged in under.

One way is going through the database menu bar.

1. In the database window, select Change Password from the Security

   menu.

2. In the Change Password dialog window, Microsoft Access will show

   the account you are currently logged in under.

You can also call the User() function from Access Basic. The example below

shows how this can be done:

1. Create a new module in your database.

2. Select the Immediate window from the View menu.

3. In the Immediate window type "?User()" (omit the quotes).

4. The user name will be displayed on the next line in the Immediate

   window.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 25,

   "Administering a Database System"

"Microsoft Access Language Reference," version 1.0 page 489, "User

   Function"

References


PRACC9302: Syntax Error When "(" is First Chr in Criteria Cell

 Article Number: Q98301

 CREATED: 02-MAY-1993

 MODIFIED: 03-MAY-1993

Summary:

PROBLEM ID: 985

SYMPTOMS

   User receives the message "Syntax error" when they try to execute

   their query.

CAUSE

   A parenthesis is the first character in a Criteria cell in the

   query grid.

RESOLUTION

   Depending on the Where clause desired, the user can restructure the

   query so there is not a leading parenthesis in a Criteria cell. See

   below under More Information for an example.

   Or, the user can enter the Where clause directly in the View SQL

   dialog box. If the leading parenthesis is placed in the Criteria cell

   by Microsoft Access, it will work. However, it will only work until

   the user makes a change to the query. For example, if the user then

   removes a column unrelated to the criteria from the query grid, the

   syntax error will occur.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. Microsoft is researching this problem and will post

   new information here as it becomes available.

More Information:

A typical situation where the user might want to have a leading

parenthesis in a Criteria cell is when searching a text or memo field

for several key words. For example, a Where clause such as the

following may be desired:

   (Textcol Like "*performance*" Or Textcol Like "*speed*") And

   (Textcol Like *start*" Or Textcol Like "*run*")

It is easier to enter this as one criteria in a single Criteria cell.

However, it can also be entered as multiple rows in the Criteria

section of the query grid. Place the Textcol column in the QBE grid

twice. One or both instances of the column may have the Show box

unchecked. The Criteria section of the grid would appear as follows:

          Textcol                 Textcol

          ---------------------   -----------------------------

Criteria: Like "*performance*"    Like "*start" Or Like "*run*"

      or: Like "*speed*"          Like "*start" Or Like "*run*"

Steps to Reproduce Problem

--------------------------

1. Create a new query on the Employees table in the sample database

   Northwind Traders (NWIND.MDB)

2. Drag the Last Name and First Name fields to the query grid.

3. In the Criteria cell under Last Name, enter:

        (Like "*a*")

4. Tab off the cell and you will receive the "Syntax error" message.

   After you choose OK from the error message dialog, "*a*" will be

   highlighted.

References


INF: How to Create Synchronized Combo Boxes

 Article Number: Q98660

 CREATED: 11-MAY-1993

 MODIFIED: 14-JUN-1993

Summary:

This article describes how to create a combo box that is filtered to

list only items that are related to an item selected in a prior combo

box.

More Information:

The following example is created using the sample database NWIND.MDB.

With the steps below, you can create an unbound form with two combo

boxes on it. The first combo box lists the category names from the

Categories table. The second combo box lists the product names from

the Products table. When you select a category name, you can see only

the product names for that category.

1. Create a new query named Category Lister and add the Categories

   table:

      Query: Category Lister

      ----------------------

         Field name: Category ID

         Show: True

         Field name: Category Name

         Show: True

         Sort: Ascending

2. Create a new query named Product Lister and add the Products table:

      Query: Product Lister

      ---------------------

         Field name: Product ID

         Show: True

         Field name: Product Name

         Show: True

         Sort: Ascending

         Field name: Category ID

         Show: True

         Sort: Ascending

         Criteria: IIF(IsNull([Forms]![Selector Form]![Category _

                   Selection]),[Category ID],[Forms]![Selector _

                   Form]![Category Selection)

   Note: In the example above, the underscore characters are used as

   line-continuation characters only.

   The use of the IIF() and IsNull() functions allows a listing of all

   products if no category is chosen.

3. Create a new macro named Reset Product Selection:

      Macro Name                 Action        Argument

      ----------------------------------------------------------

      Reset Product Selection    Requery       Product Selection

                                 GoToControl   Product Selection

4. Create a new, unbound blank form named Selector Form.

5. Place two unbound combo boxes on the form:

      Object: combo box

      ----------------------------------------

         ControlName: Category Selection

         RowSourceType: Table/Query

         RowSource: Category Lister

         ColumnCount: 2

         ColumnWidths: 0 in;1 in

         BoundColumn: 1

         After Update: Reset Product Selection

      Object: combo box

      ----------------------------------------

         ControlName: Product Selection

         RowSourceType: Table/Query

         RowSource: Product Lister

         ColumnCount: 3

         ColumnWidths: 0 in;1 in; 0 in

         BoundColumn: 1

6. Switch the Selector Form to Form view and perform the following

   test:

   - Use the category combo box to select a category, then use the product

     combo box. Only products for the selected category are listed. Use the

     category combo box to make a different selection. The product combo

     box is reset.

For more information, search for "requery" using the Help menu.

Reference(s):

"Microsoft Access Users Guide," version 1.0 pages 237, 541

References


PRB: Formatting Yes/No Data Type Example

 Article Number: Q98662

 CREATED: 11-MAY-1993

 MODIFIED: 11-MAY-1993

Summary:

SYMPTOMS

   A format string typed into the format property of a text box where

   the contol source is a Yes/No datatype appears in the text box when

   in Form view instead of expected data. Additionally, no error message

   is generated.

CAUSE

   The Format property in the text box is incorrect. This can occur if the

   illustration example on page 219 of the Language Reference manual is

   followed. The illustration currently reads:

     ";Always [Blue] ;Never [Red]"

RESOLUTION

   Instead, the example should read:

     ;"Always" [Blue];"Never" [Red]

Reference(s):

"Microsoft Access Language Reference Manaul", version 1.0, page 219

References


PRB: Exporting To Fixed Width Text File Left Justifies Numbers

 Article Number: Q98663

 CREATED: 11-MAY-1993

 MODIFIED: 11-MAY-1993

Summary:

SYMPTOMS

   When exporting a table containing a number or currency field to a

   fixed-width text file, the numbers in the table become left

   justified.

CAUSE

   Since the numbers are being exported to a fixed-width text file,

   Microsoft Access pads zeroes to the right of the number until it

   meets the proper field width.

RESOLUTION

   To get the numbers to decimal justify and pad zeros to the left

   instead of the right, you first must determine the maximum length

   of the number or currency field. Use this number of zeros in the

   Format function below. Next, you must determine the number of

   decimal places the field in question uses. Use this value to

   determine how many zeros to place after the decimal point in the

   Format function below. Now create a query based on the following

   Access SQL statement:

      SELECT DISTINCTROW

         Format([MyNumber],"0000.00")

      AS [Expr1]

      INTO [MyNewTable]

      FROM [MyOldTable];

   For this example, this SQL statement assumes that you have the

   following table:

      Table: MyOldTable

      -----------------

         FieldName: MyNumber

         DataType: Currency

   It also assumes that the longest value in the MyNumber field is 7

   characters in length (including the decimal and decimal places) and

   that each value has two decimal places. The above Access SQL

   statement, when typed into the SQL window in the Query-By-Example

   (QBE) grid, makes a new table called MyNewTable with the MyNumber

   field padded to the left with zeros.

   When you use the above Access SQL statement in a query, the data

   from MyOldTable is formatted with decimal justification and placed

   into a new table called MyNewTable.

STATUS

   This behavior is by design.

More Information:

Steps to Reproduce Behavior

--------------------------

1. Create the following table:

   Table: MyOldTable

   -----------------

      FieldName: MyNumber

      DataType: Currency

2. Enter the following numbers into the table: 34.5, 123.56, 4578.90.

3. Choose Export from the file menu, and choose the Text (Fixed Width)

   option. Export MyOldTable.

4. Open the exported text file with a utility such as Windows

   NOTEPAD.EXE and view the numbers. They should be:

      34.5000

      123.560

      4578.90

References


INF: Deleting Duplicate Records from Two Tables

 Article Number: Q98664

 CREATED: 11-MAY-1993

 MODIFIED: 20-MAY-1993

Summary:

This article describes how to delete duplicate records from two tables

and retain the most current information (records). In addition, the

article shows how to merge the results of these two tables.

More Information:

This article walks you through creating two tables, TEST-1 and TEST-2,

with duplicate records. After adding additional nonduplicate records

to both these tables, you will delete the duplicate records from the

TEST-2 table. Finally, you will update the TEST-1 table to include

nonduplicate information from the TEST-2 table.

Steps to Reproduce Behavior

---------------------------

 1. Open the sample database NWIND.MDB.

 2. In the Database window, highlight the Shippers table.

 3. From the Edit menu, choose Copy.

 4. From the Edit menu, choose Paste.

 5. In the Paste Table As dialog box, type TEST-1 in the Table Name

    field. Choose OK.

 6. Repeat steps 4 and 5, this time pasting the table as TEST-2.

 7. Open the TEST-1 table and add the following two additional company

    names:

       ABC Shipping

       XYZ Express

    Close the TEST-1 table.

 8. Open the TEST-2 table and add the following two new company names:

       Jiffy Ship

       Hurry Package

    Close the Shippers table.

 9. From the Database window, select the Query button and then choose

    New.

10. Add the TEST-1 table and the TEST-2 table to the query, then close

    the Add Table dialog box.

11. Join the tables on the Company Name field.

12. From the Query menu, choose Delete.

Note: For this example, the TEST-1 table will be considered the most

current information; therefore, duplicate information will be deleted

from the TEST-2 table.

13. From the TEST-1 table, drag Shipper ID and Company Name down to the

    QBE grid. Notice that the word "Where" appears on the Delete line

    in the QBE grid.

14. Bring the * down from the TEST-2 table. Notice that the word

    "From" appears on the Delete line in the QBE grid.

15. From the Query menu, choose Run.

16. You will receive a message that three rows will be deleted. Choose

    OK.

17. Open the TEST-2 table. The only two records that remain are the

    nonduplicate records that you added in step 8 above. All the duplicate

    records have been deleted.

The remaining steps append the remaining nonduplicate records from the

TEST-2 table to the TEST-1 table.

19. Open the TEST-2 table.

20. From the Edit menu, choose Select All Records.

21. From the Edit menu, choose Copy.

22. Close the TEST-2 table and then open the TEST-1 table.

23. From the Edit menu, choose Paste Append. You will receive a

    message that two rows have been pasted into this table. Choose OK

    to complete the Paste Append.

Your most current information, without duplicates, is now in one table

(TEST-1).

References


INF: Sorting Titles Without Including Leading Articles

 Article Number: Q98665

 CREATED: 11-MAY-1993

 MODIFIED: 24-JUN-1993

Summary:

This article explains how to sort titles in text fields without

including the leading articles "the," "an," or "a."

More Information:

The following is a list of book titles:

   Aztec Indians

   The Ant People

   Beast Man

   The Baseball Club

   An Attempt At Fun

   Apple Valley

If you sort the above list using a custom Microsoft Access function in

a query, the following new list results:

   The Ant People

   Apple Valley

   An Attempt At Fun

   Aztec Indians

   The Baseball Club

   Beast Man

Create the following Access Basic function that returns a book title

without the leading article:

     Option Explicit

     Function Gettitle (Titles) As String

         sp = InStr(1, Titles, Chr$(32))

         If sp > 0 Then

             Select Case Left(Titles, sp - 1)

                 Case "An", "A", "The"    ' add any other articles here!

                     Gettitle = Mid(Titles, sp + 1)

                 Case Else

                     Gettitle = Titles

             End Select

         Else

             Gettitle = Titles

         End If

     End Function

To sort a table on the Titles field, create a query with the following

two columns in the query grid:

   Query

   -----

   Field: Sorted List: Gettitle([Titles])

      Sort: Ascending

      Show: Yes

   Field: [Titles]

      Show: No

The first column is a calculated field that extracts the text of the

Titles field, but omits the leading article. The results of this

calculation are sorted in ascending order. The second Show check box

is cleared so that the query result is not displayed.

References:

"Language Reference," version 1.0, pages 276-277, 404

References


INF: "Form is read only" error

 Article Number: Q98666

 CREATED: 11-MAY-1993

 MODIFIED: 11-MAY-1993

Summary:

SYMPTOM:

   The following error message is displayed

      Form is read only

   when trying to update data, but the form property DefaultEditing

   is not set to Read Only.

CAUSE:

   If your form is based on a query that is Read Only, you will not be

   able to edit from a from based on that query.

More Information:

Steps to reproduce behavior

---------------------------

1. Create a new query based on the table orders in the example database,

   Northwind Traders(NWIND.MDB).

      Query:  Orders

      --------------

      Type:  Select Query.

      Join:  None (only one table involved)

      Field: Quantity

         Total:  Group By

      Field:  Unit Price

         Total:  Group By

      Field:  Expr1: [Unit Price]*[Quantity]

         Total:  Expression

2. Run query and try to change the Unit Price in one of the records.

   You get a beep. Notice that the status bar displays

      Form is read only.

   As expected, you get the same results when you use a form based on

   this query.

   Click on the Totals button to remove the Total line in the QBE. Run

   the query. You may now change the records.

Workaround:

   A workaround would depend on what you are trying to accomplish by

   using the query. The Microsoft Access User's Guide contains

   information on designing queries which may be used to update records.

Reference(s):

   Microsoft Access User's Guide, Designing Queries for Updating

   Records, pp. 156-157

   Microsoft Access User's Guide, Creating a Query for Updating

   Two Tables, p. 158

References


INF: Default Properties Don't Carry Over on Attached Tables

 Article Number: Q98669

 CREATED: 11-MAY-1993

 MODIFIED: 11-MAY-1993

Summary:

When you attach to an Microsoft Access table in another database the

default values don't come across.

More Information:

For example: If you have Table1 in DB1.MDB and in that table there is

a field with DataType Number and a Default Value of 5 and you attach

to that table from DB2.MDB when you go to add records to the attached

table 5 will NOT show up in new records as you would expect in a

normal situation. This limitation is due to the fact that properties

of an attached table are not read in Microsoft Access version 1.x.

Reference(s): "Microsoft Access User's Guide", chapter 4 pp. 69+

References


INF: Improved Print Merge Feature In Microsoft Access 1.1

 Article Number: Q98673

 CREATED: 11-MAY-1993

 MODIFIED: 14-JUN-1993

Summary:

This article discusses a new feature of Microsoft Access version 1.1:

the ability to directly use Microsoft Access tables in a Microsoft

Word for Windows print merge.

More Information:

To use data from a Microsoft Access database in Word for Windows, the

data must be converted to a format that Word for Windows recognizes.

In Microsoft Access version 1.0, this is done by exporting the data

from Microsoft Access as text, or copying tables and queries from

Microsoft Access and pasting them into a Word for Windows document.

A new feature of Microsoft Access version 1.1 is the ability to select

Word for Windows Merge directly from the Export Data Destination

dialog box.

The following steps, performed in Microsoft Access version 1.1,

explain how to convert your table into a data document for Word for

Windows:

 1. From the Database window, choose Export from the File menu.

 2. Select Word for Windows Merge from the Export Data Destination

    Dialog box.

 3. Select the Table or Query that contains the information you want.

 4. Microsoft Access will enter a default file name for export. You

    can either accept the default filename or enter a new filename

    that you want to export to.

 5. Microsoft Access will provide an Export Word Merge Options window

    that you may want to customize if you are exporting date/time

    fields.

 6. Minimize Microsoft Access and start Word for Windows.

 7. Open the main document in Word for Windows.

 8. From the File menu, choose Print Merge.

 9. Choose the Attach Data File button.

10. Select the exported text file that you created in step 4.

    Note: Word for Windows will only show *.DOC files by default. You

    will need to specify *.TXT files in the List Files of Type combo

    box contained in the Attach Data File dialog box.

11. Use the Insert Merge Fields, Edit Data Field, Check, and Print

    Merge features of Microsoft Word for Windows to complete the

    document.

For more information on print merge capabilities in Microsoft Access

version 1.0, query on the following words in the Microsoft Knowledge

Base:

   Access and Word and Merge and 1.0

References


INF: SQL Server Views Read Only When Attached

 Article Number: Q98786

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

Microsoft SQL Server supports updateable views. Microsoft Access can

attach to these views Read Only because SQL Server views do not have

indexes. Microsoft Access requires a unique index on the attach

object for update/delete/insert capability. Please refer to Knowledge

article Q90100 for further information on Microsoft Access and

updating attached SQL Server tables

References


PRACC9304: Query Progress Meter Reports Status Incorrectly

 Article Number: Q98787

 CREATED: 13-MAY-1993

 MODIFIED: 17-MAY-1993

Summary:

SYMPTOMS

   When running an append query that appends a large number of records to

   an existing table, the progress meter may incorrectly reflect the

   status of the query. The progress meter may increase quickly to 98

   percent complete and then continue slowly until reaching 100 percent.

CAUSE

   The progress meter does not take into account time for the sorting

   phase. If the sorting phase takes a long time, the progress meter does

   not correctly reflect the progress of the query.

STATUS

   Microsoft is researching this problem and will post new information

   here in the Microsoft Knowledge Base as it becomes available.

More Information:

This problem is highly dependent on the query and the sorting phase

necessary for that query.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 7, "Designing

Action Queries and Parameter Queries," pages 170-174

References


INF: Number of Times a Custom Function Executes in a Query

 Article Number: Q98788

 CREATED: 13-MAY-1993

 MODIFIED: 17-JUN-1993

Summary:

A custom function called from a query will execute as follows:

 - One (1) time per record if the expression does not reference a field

 - One (1) time per record if the expression does reference a field

 - Two (2) times per record if there are criteria on the expression

More Information:

To optimize a query, Microsoft Access will not re-execute a custom

function unless the value passed to it changes. If the function

accepts a field as a parameter, Microsoft Access must re-execute the

custom function for each record, since the data may change from record

to record. If criteria are placed on the result of the function,

Microsoft Access must re-execute the function when applying the

criteria.

The examples below (Examples A, B, and C) demonstrate each of the

three scenarios, using a custom function designed to number the

records in a query.

  NOTE: These examples are simplified to demonstrate the results you

  can expect when you use custom functions in a query. Many variables

  can affect the number of times Microsoft Access re-executes a custom

  function. For example, if you first minimize and them maximize

  Microsoft Access, the process of repainting the screen also includes

  re-executing any custom function that is part of the query result.

Complete the following steps to use Examples A, B, and C:

1. Create a new module called RecordNumbers in the sample database

   NWIND.MDB (Northwind Traders).

2. Add the following to the Declarations section:

      Global RecordNum

Example A: An Expression That Calculates Only Once Per Query

-------------------------------------------------------------

1. Add the following function to the module you created in the

   previous procedure:

      Function ShouldIncrement ()

         RecordNum = RecordNum + 1

         ShouldIncrement = RecordNum

      End Function

2. Create a new query based on the Categories table. Drag the

   Last Name field to the query grid and add a column with

   the following expression:

      RecordNumber: ShouldIncrement()

3. Run the query. You will obtain the following result:

      Last Name    RecordNumber

      -------------------------

      Davolio      1

      Fuller       1

      Leverling    1

      Peacock      1

      Buchanan     1

      Suyama       1

      King         1

      Callahan     1

      Dodsworth    1

   Note that the function IncrementRecNum() is executed only once.

Example B: An Expression That Calculates Once Per Record

--------------------------------------------------------

1. Add the function DoesIncrement() to the module RecordNumbers you

   created in the first procedure:

      Function DoesIncrement (AnyValue)

         RecordNum = RecordNum + 1

         DoesIncrement = RecordNum

      End Function

2. Create a new query based on the Employees table. Drag the Last

   Name field to the query grid and add a column with the following

   expression:

      RecordNumber: DoesIncrement([Employee ID])

3. Run the query. You will obtain the following result:

      Last Name    RecordNumber

      -------------------------

      Davolio      1

      Fuller       2

      Leverling    3

      Peacock      4

      Buchanan     5

      Suyama       6

      King         7

      Callahan     8

      Dodsworth    9

Example C: An Expression That Calculates More Than Once Per Record

------------------------------------------------------------------

1. Create a new query based on the Employees table. Drag the

   Last Name field to the query grid and add a column with

   the following expression:

      RecordNumber: DoesIncrement([Employee ID])

     NOTE: You will need to complete Step 1 of Example B in order to

     have the DoesIncrement() function available.

2. Open the module RecordNumbers in Design view. From the View menu,

   choose Immediate Window. Type the following statement to initialize

   the variable RecordNum:

      RecordNum = 0

3. Run the query. You will obtain the following result:

      Last Name    RecordNumber

      -------------------------

      Davolio      1

      Fuller       2

      Leverling    3

      Peacock      4

      Buchanan     5

      Suyama       6

      King         7

      Callahan     8

      Dodsworth    9

4. Repeat Step 2 in this example (Example C).

5. Add the following criteria under RecordNumber:

      >=0

6. Run the query.  You will now obtain the following result:

      Last Name    RecordNumber

      -------------------------

      Davolio      10

      Fuller       11

      Leverling    12

      Peacock      13

      Buchanan     14

      Suyama       15

      King         16

      Callahan     17

      Dodsworth    18

   In this case, Microsoft Access runs the expression twice, once to

   create the dynaset and again to check the criteria you specified.

For more information on creating custom counters for forms and

queries, query on the following words in the Microsoft Knowledge Base:

   custom counter

References


INF: Nulls Allowed in Foreign Key With Ref. Integrity

 Article Number: Q98789

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

Microsoft Access allows a null value in a field that is the

foreign key in a relationship with referential integrity

enforced.

More Information:

Steps to Reproduce

------------------

1. Open the example database, the sample database Northwind

   Traders (NWIND.MDB)

2. Select Relationships... from the Edit menu.

3. Under Primary Table, select Customers.

4. Under Related Table, select Orders.

5. Note:

   a. PrimaryKey Fields and Select Matching Fields

      both display "Customer ID".

   b. Enforce Referential Integrity is checked.

   c. The Add button is grayed out.

   This indicates that there is an existing relationship

   between Customers and Orders which specifies that you

   will not be able to make an entry in the Customer ID

   field of the Orders table which is not the ID of a

   customer which actually exists in the Customers table.

6. Close the Relationships dialog and open the Orders table.

7. Change the Customer ID field of the first order to "XXXX"

   and try to move to the next record. You receive the error

   message:

      "Can't add or change record, Referential Integrity rules

       require a related record in the table 'Customers'."

8. Press OK.

9. Delete the entry in the Customer ID field, leaving it

   completely empty. Move to the next record.

References: For more information on Referential Integrity in

            Microsoft Access refer to page 54 of the User's Guide.

References


INF: Print a Sequential Number For Each Detail Line

 Article Number: Q98790

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

You can place a text box control in the detail section of a report

that will print a sequential number for each record included in the

report. This number can be reset so that each group prints its own set

of numbers.

This article shows how to do this by modifying a report in the sample

database Northwind Traders (NWIND.MDB)

More Information:

If you want to print a incremented counter number for each record in a

report group, place an unbound text box control in the detail section

of the report. To begin the numbering sequence with the number one (1)

all you have to do is set the ControlSource to =1. This will act as a

counter, counting the detail records in the report. Then set the

RunningSum property to OverGroup.

Steps to Follow:

----------------

1. Open the report named 'List of Products by Category' in design view.

2. Place the following text box control in the detail section before

   the Product Name control.

      Object: Text Box

      ----------------

      ControlName:   MyLineNumber

      ControlSource: =1

      RunningSum:    OverGroup

3. Preview the report. You will see each group's records sequentially

   numbered beginning with the number one.

You can change the RunningSum property to OverAll so every record will

print a unique sequential number.

Note: You can also increment the counter number for each group in the report.

      You can do this by making minor modifications to step 2 above.

2. Place the following text box control in the "Category Name Header" section

   before the Category Name control.

      Object: Text Box

      ----------------

      ControlName:   MyLineNumber2

      ControlSource: =1

      RunningSum:    OverAll

Reference(s):

"Microsoft Access User's Guide," version 1.0, page 575

References


INF: Part 1: DDE in Visual Basic to Request Data from Access

 Article Number: Q98791

 CREATED: 13-MAY-1993

 MODIFIED: 17-MAY-1993

Summary:

This article explains how to use Microsoft Visual Basic to request

data from Microsoft Access using dynamic data exchange (DDE).

For information that goes into greater detail and demonstrates how to

parse the requested data in a Visual Basic array and then populate a

grid control with the data, query on the following words in the

Microsoft Knowledge Base:

   dde and vb and part two

More Information:

This article provides a Visual Basic code example demonstrating how to

request information from the Employees table in the sample database

NWIND.MDB.

The following code example demonstrates how to fill a Visual Basic

text box with the entire contents of an Microsoft Access table,

including field names.

In Visual Basic, create a new form, add the following controls, and

set the appropriate properties for each control:

   Text Box

   --------

      Name:       Text1

      Multiline:  True

      Scrollbars: 3 - Both (vertical and horizontal)

   Command Button

   --------------

      Name:       Command1

   Note: Size the text box large so that data can be seen and scrolled

         easily following the DDE request.

Double click the command button and enter the following code between

the "Sub Command1_Click ()" and "End Sub" lines:

   Sub Command1_Click()

      Text1.LinkTopic = "MSACCESS|NWIND;TABLE Employees"

      Text1.LinkMode = 2     ' Establish a manual DDE link to Access

      Text1.LinkItem = "All" ' Setup the DDE request item to get ALL the

                             ' .. data from the Employees table,

                             ' .. including field names.

      Text1.LinkRequest      ' Request the data into the Text1 text box

      Text1.LinkMode = 0     ' Terminate the DDE link to Access

   End Sub

In this example, the first line specifies "MSACCESS" as the

application to communicate with and "NWIND;TABLE Employees" as the

topic of the DDE conversation. We could also specify an SQL statement

as the topic of the conversation. The following line of code is

functionally equivalent to the first line above:

   Text1.LinkTopic = "MSACCESS|NWIND;SQL Select * From Employees;"

In this example, the item "All" tells Microsoft Access to supply

Visual Basic with the entire contents of the Topic, including field

names. Microsoft Access supports a rich set of other items and topics.

For a list of supported topics and items, query on the following words

in the Microsoft Knowledge Base:

   dde and server and topics

When you run this example, be sure that Microsoft Access is running

and has the NWIND database opened.

When you run this code, the text box will be filled with the entire

contents of the Employees table. Each field will be delimited by a tab

character, Chr$(9), and each record row will end with a newline

character (a carriage return followed by a linefeed character).

References


INF: Use of Constants as Field Names in a Query

 Article Number: Q98792

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

If you use a constant (Yes, No, True, False, On, Off, or Null) as a

field name in a table, and then create a query that uses any of those

fields, you will receive the following error message:

   Invalid use of '.', '!', or '()' in query expression <Table.Field>

Where <Table> is the name of the table you are using in the query and

<Field> is the name of the field in question.

More Information:

A constant represents a numeric or string value that doesn't change.

In some respects, a constant is like a variable or a reserved word.

Unlike a variable, however, the value of a constant cannot change

during program execution.

If you receive the above error message, you will need to change your

field name at the table level.

For more information search for "Constants" using the Help menu.

References


INF: Restrictions on Compound Indexes

 Article Number: Q98793

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

Queries using restrictions on multiple field (compound) indexes must

include the first field of the index for the index to be used. If the

restriction is placed on a field other than the first field, the query

optimizer will chose a table scan rather than use the indexes. The

use of a table scan will be slower than an index search for most

queries.

More Information:

By default, when a compound index is created in Microsoft Access, no

individual indexes are assigned to the fields included in the compound

index. This is by design. In order for the query optimizer to use the

index, either a comparison of the complete index value must be used,

or a comparison with the first field in the compound index must be

used.

For Example:

Create a table called T1 which has two fields, key_part1 and key_part2,

in the primary key. Neither field is indexed individually.

Select * from T1 where key_part2 = <value>

will not use the index, while

Select * from T1 where key_part1 = <value>

will use the index.

This also applies to usage of criteria in the Find method in Access Basic.

The fields are not prohibited from having indexes on them so

individual indexes can be built for each field, thus allowing

comparisons on those fields using index searches. The only caveat is

that indexes will take up as much, or more, space than the data.

References


PRACC9304: Invalid Results in Subreport When CanGrow = Yes

 Article Number: Q98794

 CREATED: 13-MAY-1993

 MODIFIED: 17-MAY-1993

Summary:

SYMPTOMS

   If a control in a subreport uses an expression or aggregate

   function and its CanGrow property is set to Yes, Microsoft Access

   does not calculate the value of the field correctly.

   For example, assume your database contains a table named "Test" that

   has a text field called "TestColumn" containing the following values:

      TestColumn

      ----------

      Mickey

      Donald

   If you create a report with a single text box (Field1) containing

   the expression

      =IIf(IsNull([TestColumn]),"N/A",[TestColumn])

   and you set the CanGrow property for Field1 to Yes and then embed that

   report as a subreport, you get the following incorrect results:

      Donald

      Donald

   If the calculated subreport field contains an aggregate function,

   instead of a text-based expression as above, the subreport

   displays incorrect numeric values.

RESOLUTION

   Make sure that the CanGrow property of subreport fields that use

   expressions or calculations is set to No.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. Microsoft is researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRB: Form may Lose Focus When Using Shift+F8

 Article Number: Q98795

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

SYMPTOMS

   When you use SHIFT+F8 to reverse an Extend mode selection (F8),

   your cursor may disappear. Your form no longer has the focus.

CAUSE

   This scenario will only occur when you have first selected a record

   using the Shift+Spacebar key combination rather than using the F8

   function key to turn Extend mode on.

   Microsoft Access saves previous focus information when you use the

   F8 keyboard command, but not when you use Shift+Spacebar. Therefore,

   Microsoft Access is unable to 'return' focus to your form when you

   press Shift+F8.

RESOLUTION

   Use F8 instead of Shift+Spacebar to select the record, or click

   anywhere on your form to recover the focus.

More Information:

This behavior only appears in Form view, not in Datasheet view.

Pressing Shift+Spacebar selects the current record or cancels your

record selection.

Pressing F8 turns Extend mode on (EXT appears in the status bar). Once

Extend mode is on, pressing F8 repeatedly extends the selection to the

word, the field, the record (in Datasheet and Form view), and all

records (in Datasheet and Form view). Pressing Shift+F8 reverses the

selection.

Steps to Reproduce Behavior

--------------------------

1. Open the sample database Northwind Traders (NWIND.MDB).

2. Open the Employees form.

3. From the View menu, choose Datasheet.

4. Use your tab key to select the Last Name field (Davolio).

5. Press Shift+Spacebar to select the entire record.

6. Press Shift+F8 to cancel the selection.

Note that focus remains on the Last Name field.

7. From the View menu, choose Form.

8. Repeat steps 5-6 above.

Note that the form no longer has focus. Click anywhere on the form to

restore focus.

For more information search for "selection keys" using the Help menu.

References


INF: Data Type of Value Overrides Data Type of Variable

 Article Number: Q98796

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

Microsoft Access internally converts values with implicit data type

definitions before assigning that value to a variable. This may result

in unexpected rounding of numbers, or in the following error message:

   Invalid Number

More Information:

You can implicitly define the data type of a value by appending a

type-declaration character at the end of the value. For example,

x=1234& implicitly defines 1234 as a Long data type (four-byte

integer).

Steps to Reproduce Behavior

---------------------------

1. Open a new module.

2. Add the following line underneath the Option Declare Database line:

      Dim v as Currency

3. Press Enter.

4. From the View menu, choose Immediate Window.

5. In the Immediate window, type:

      v=123456789123.3456789#

6. Press enter, and then enter the following line:

   debug.print v

   and then press enter.

The value of the variable "v" is now 123456789123.346. The # symbol

implicitly defined the value as a double-precision value. Microsoft

Access internally converted the value to that data type before

assigning it to the currency variable.

7. Repeat steps 5-6, replacing the # symbol with other type-

   declaration characters (&, !, @).

The @ symbol defines the currency data type, which is limited to 4-

decimal places. When you try to define a number with more than 4-

decimal places as currency, you will get an "invalid number" error.

Reference(s):

"Language Reference," version 1.0, Part 2, "A-Z Reference," pages 25

and 26.

"Introduction to Programming," version 1.0, Chapter 5, "Variables,

Constants, and DataTypes," pages 49-51.

References


INF: How to Import a Microsoft Windows Cardfile Data File

 Article Number: Q98797

 CREATED: 13-MAY-1993

 MODIFIED: 14-JUN-1993

Summary:

Microsoft Access does not have any importing routines to import a

Windows Cardfile *.CRD file. To import an *.CRD file, you must use

Access Basic. The following article describes the Access Basic

function needed to import a Windows Cardfile *.CRD file.

More Information:

The function below can be used to import a Microsoft Windows Cardfile

data file. To use this function, you will need to add this function

to a new or existing Microsoft Access module. You can run the code

from the Immediate window, or you can call it from a command button by

setting the following properties such as:

   Command Button

   --------------

   OnPush: =Import_CRD()

In this function, you will need to specify the correct path and

filename of you actual *.CRD file. As an alternative, you could pass

the file name as a string to the function.

   Option Explicit

   Type CRD_Header

      Signature As String * 3 'always MGC

      Number as Integer

   End Type

   Type CRD_Record_Type

      Reserved As String * 6

      Position As Long

      Flag As String * 1

      Index As String * 40

      EndOfRecord As String * 1

   End Type

   Dim I As CRD_Record_Type

   Function Import_CRD ()

      Const FIRST_REC = 6

      Dim MyDB As Database

      Dim MyTable As Table

      Dim FileNum#

      Dim NumberOfCards%, NextRecord%, I%

      Dim CRD_Record As CRD_Record_Type

      Dim Message$

      Set MyDB = CurrentDB()

      Set MyTable = MyDB.OpenTable("CardFile")

      FileNum# = FreeFile

      'supply the actual path and name of the file you want to convert

      Open "msaccess.crd" For Binary As FileNum#

      'The number of files in the CRD file is at the 4 bytes offset

      Get #FileNum, 4, NumberOfCards%

      NextRecord% = FIRST_REC

      For I% = 1 To NumberOfCards%

         Get #FileNum, NextRecord%, CRD_Record

         NextRecord% = NextRecord + &H34

         Message$ = Space$(512)

         Get #FileNum, CRD_Record.Position + 5, Message$

         MyTable.AddNew

            MyTable.Title = Mid$(CRD_Record.Index, 1)

            MyTable.Comment = Mid$(Message$, 1, InStr(Message$, Chr$(0)))

         MyTable.Update

      Next I%

      Close

   End Function

References:

For more information on the actual details of the *.CRD file format,

query on the following words in the Microsoft Knowledge Base:

   cardfile and format and graphic and absolute and hexadecimal

References


INF: Mail Merge Using Reports in Microsoft Access

 Article Number: Q98798

 CREATED: 13-MAY-1993

 MODIFIED: 24-JUN-1993

Summary:

To execute a mail merge with Microsoft Access data, you can export or

copy your data to a word processor. But you can also create a

Microsoft Access report to generate simple mail-merge documents. This

article explains the latter process.

More Information:

The following example produces a business letter. (All values shown in

angle brackets (<>) can be found in an underlying table.)

----------------------------------------------

KB Advertising Agency

<February 5th, 1993>

<John Doe>

<123 E. Main Street>

<Middle Town, OH 44044>

Dear <Mr. Doe>,

We are pleased to announce our new line of office furniture. As a

<valued> customer, you are entitled to a <10>% discount off our

catalog prices.

Call us today toll-free at (800) 555-1212 and receive a free

full-color catalog detailing all our top-of-the-line office products.

Sincerely,

J. Grant

Manager, Office Products

----------------------------------------------

Example

-------

1. Create the following table:

   Table: Customer

   ---------------

      FieldName: Salutation

      DataType: Text

      FieldName: First Name

      DataType: Text

      FieldName: Last Name

      DataType: Text

      FieldName: Address

      DataType: Text

      FieldName: City

      DataType: Text

      FieldName: State

      DataType: Text

      FieldName: ZIP

      DataType: Text

      FieldName: Customer Type

      DataType: Text

      FieldName: Discount Pct

      DataType: Number

2. Enter the following records:

   Salu-      First  Last                                      Cust    Disc

   tation     Name   Name   Address   City       State  ZIP    Type    Pct

   ------     -----  -----  --------  ---------  -----  -----  ------  ----

   Mr. John   Doe    123 Main  Middleton  OH     44044  Valued    10

   Mrs.Sally  White  52A Elm   Florence   KY     45123  Special    5

   Dr. Fred   Weiss  Box 456   Camden     SC     29332  Super     25

3. Create a new, blank report. (Do not use a ReportWizard.)

a. Turn Report Header/Footer and Page Header/Footer off.

b. Add all of the controls to the Details section.

c. Delete the default labels on text boxes.

d. Press CTRL+ENTER to force new lines and paragraphs in the

  label controls.

   Report: Merge Letter

   --------------------

      RecordSource: Customer

   Section: Detail

   ---------------

      ForceNewPage: After Section

      CanGrow: Yes

   Control: Label

   --------------

      ControlName: Company Label

      Caption: KB Advertising Agency

   Control: Text Box

   -----------------

      ControlName: Todays Date

      ControlSource: =Date()

      Format: Long Date

   Control: Text Box

   -----------------

      ControlName: Name Line

      ControlSource: =[First Name] & " " & [Last Name]

   Control: Text Box

   -----------------

      ControlName: Address Line

      ControlSource: =[Address]

   Control: Text Box

   -----------------

      ControlName: CSZ Line

      ControlSource: =[City] & ", " & [State] & " " & [ZIP]

   Control: Text Box

   -----------------

      ControlName: Salutation Line

      ControlSource: ="Dear " & [Salutation] & " " & [Last Name] & ","

   Control: Text Box

   -----------------

      ControlName: Para 1

      ControlSource: ="We are pleased to announce our new line of office

                       furniture. As a " & [Customer Type] & "customer,

                       you are entitled to a" & [Discount Pct] & "%

                       discount off our catalog prices."

      CanGrow: Yes

   Control: Label

   --------------

      ControlName: Rest of Letter

      Caption: Call us today toll-free at (800) 555-1212 and receive a

               free full-color catalog detailing all our

               top-of-the-line office products.

      Sincerely,

      J. Grant

      Manager, Office Products

4. Size and position the controls and then set the font styles and

   sizes.

5. Save the report. Open the report in Print Preview to see the

   results of the merge.

Summary and General Notes

--------------------------

 - Fixed paragraphs should be entered in a label control.

 - Variable paragraphs should be entered in a text box control.

 - Margins are determined by the width of the control. The text will

   wrap within the width of the control, not the width of the letter.

- Control Names for the various controls must be different from the

   field names in your table. If not, your control name will print as

   a #Error? message.

Limitations

------------

 - You cannot change the formatting (font, underline, bold, and so

   forth) of individual words. You can only change the formatting of

   the control.

 - You are limited to 255 characters in the ControlSource of a text

   box. For long paragraphs, create one or more invisible text boxes

   to contain the bulk of the text, then concatenate them together in

   a visible text box.

References


PRB: Ctrl+C Does Not Copy SQL Statement

 Article Number: Q98799

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

SYMPTOMS

   The EDIT menu does not work while inside dialog boxes, so if you want

   to copy the SQL text from a query, you must use the CTRL+C accelerator

   key instead of EDIT-COPY. However, this does not work if you are

   running Access under Windows 3.0.

CAUSE

   This is because, even though Microsoft Access shows CTRL+C in the

   EDIT menu, this accelerator key is defined by Windows and not by

   Microsoft Access. CTRL+C is a Windows 3.1 accelerator. In Windows 3.0

   use CTRL+INS instead.  Note: CTRL+INS also works in Windows 3.1.

STATUS

   This behavior is by design.

More Information:

   Edit Accelerator Keys:

   Command      Win 3.0     Win 3.1

   -------      -------     -------

   Edit/Cut     SHIFT+DEL   CTRL+X or SHIFT+DEL

   Edit/Copy    CTRL+INS    CTRL+C or CTRL+INS

   Edit/Paste   SHIFT+INS   CTRL+V or SHIFT+INS

References


INF: Tile and Cascade Items Inconsistent with Program Manager

 Article Number: Q98800

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

The order of the Tile and Cascade items under the Window menu are not

the same as they appear in the Program Manager. Also, Shift+F4 and

Shift+F5 are not shortcut keys for Tile and Cascade in Microsoft

Access.

More Information:

The Tile and Cascade menu choices function exactly the same way as in

Program Manager.

For more information, search for "shortcut keys", using the Help menu.

References


INF: How to Print a Single Record from a Form in a Report

 Article Number: Q98801

 CREATED: 13-MAY-1993

 MODIFIED: 23-JUN-1993

Summary:

This article explains how to select a single record on a form and

print it in a report.

More Information:

The following procedure explains how to print only the record you

select from the Customers form in the sample database NWIND.MDB.

1. Create the following select query based on the Customers table:

      Query: PrintRecordQuery

      -----------------------

      Table: Customers

      Field: Customer ID

      Criteria: Forms![Customers]![Customer ID].

2. In the Query Properties dialog box, clear the Restrict Available

   Fields check box.

   When you run the query from the form, the resulting dynaset

   contains only the record you selected on that form.

3. Create a report called PrintRecordReport based on the query

   PrintRecordQuery.

4. Create the following macro to open the report:

      Macro: PrintRecordMacro

      -----------------------

      OpenReport

         ReportName: PrintRecordReport

         View: Print Preview

5. Add a command button with the following properties to the Customers

   form to run the macro:

      Command Button

      --------------

      ControlName:  PrintRecord

      Caption: Print Record

      OnPush: PrintRecordMacro

   When you press the command button, you open the report and run the

   query based on it. The record selected by the cursor position on

   the form is returned by the query and is printed in the report.

Additional Information:

If you want to print more than one record, page 558 of the "Microsoft

Access User's Guide" describes a way to restrict which records you

print by changing either the Filter Name or Where Condition arguments

in the macro.

If you do not want to use a report, page 543 of the "Microsoft Access

User's Guide" describes a way to to print the current record directly

from the form using a macro.

References


INF: Automatic Date Fill When Tabbing Out

 Article Number: Q98802

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

Microsoft Access will automatically fill out the complete date when

you enter a partial date when the underlying data type is Date/Time.

More Information:

When entering data for the Date/Time format it is not necessary to

type in the year, if you want to use the current year. This will work

in both tables and forms, as long as the field is formatted as

Date/Time.

Steps to Reproduce Behavior

---------------------------

1. Create a new table:

      Table: DateTable

      ---------------------

      FieldName: My Date [Primary key]

      DataType: Date/Time

2. From the View menu, choose Datasheet.

3. Enter 1/1, then press TAB to leave the field.

The value you entered will be displayed as 1/1/93.

References


PRB: Access Can Not Find DESKEDIT.EXE

 Article Number: Q98803

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

SYMPTOMS

   Attempting to open the Microsoft Access README.TXT or clicking on

   the Microsoft Access Q&A icons may produce the following error

   message:

      Can not find DESKEDIT.EXE.

CAUSE

   This error results when Norton Desktop for Windows has been deleted

   from your computer. This causes Microsoft Windows to lose the

   association with the .TXT files.

RESOLUTION

   Using File Manager, re-associate you text files with Notepad.

More Information:

The following steps detail how to re-associate your text files with

Notepad:

1. Open File Manager.

2. Open the Access directory within File Manager.

3. Highlight README.TXT in the Access directory.

4. Choose Associate from the File menu.

5. Choose Text File (NOTEPAD.EXE) in the Associate dialog box, then

   press Enter.

References


INF: Can't use Analyzer.MDB as Output Database from Analyzer

 Article Number: Q98804

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

The name Analyzer is reserved for the Database Analyzer utility that

ships with Microsoft Access. You cannot use this name as an output

database from the database Analyzer.

More Information:

You can create a database named Analyzer (ANALYZER.MDB) without any

problems. But you cannot use this database as an output destination

when running the database Analyzer utility.

You will not receive any error messages if you attempt to use

ANALYZER.MDB as an output database, but the object(s) that you

selected will not be analyzed.

Reference(s):

For more information about the Database Analyzer utility, refer to

Question #23 in the PSSKB.TXT. You can open this text file (located in

your Access directory) from Notepad.

References


PRB: Internal Database Error (-5207) When Attaching Tables

 Article Number: Q98805

 CREATED: 13-MAY-1993

 MODIFIED: 17-MAY-1993

Summary:

SYMPTOMS

   When attaching to a French version Paradox file, the following

   error message may appear:

      Internal Database Error -5027

CAUSE

  The MSACCESS.INI file settings are incorrect for reading the

  international file.

RESOLUTION

   Set CollatingSequence entry in the [Paradox ISAM] section of the

   MSACCESS.INI to International as follows:

      [Paradox ISAM]

      CollatingSequence = International

More Information:

For more information search for "MSACCESS.INI," then "Customizing

MSACCESS.INI Settings" using the Help menu.

References


PRB: Seek Method is Faster Than Find Method

 Article Number: Q98806

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

SYMPTOMS

   When using Access Basic to find a record in an indexed field, the

   Seek method may be faster than the Find method, especially on a large

   table.

CAUSE

   This behavior is by design.

RESOLUTION

   Use the Seek method on indexed fields to optimize the speed of your

   search.

More Information:

When doing a Seek, you are directly opening a table and moving to the

record based on an index value. When you create a dynaset and perform

a Find, you are checking the value of the field in every record until

you find a match.

Steps to Reproduce Behavior

--------------------------

1. Open the sample database Northwind Traders (NWIND.MDB)

2. Create a new module and enter the following two functions:

   '*********************************************

   'Declarations section of the module.

   '*********************************************

   Option Explicit

   '=============================================

   'The following function uses the Seek method.

   'It quickly returns the Customer ID where the

   '   PrimaryKey field = 11070.

   '=============================================

   Function Faster ()

      Dim db As Database, tbl As Table

      Set db = CurrentDB()

      Set tbl = db.OpenTable("Orders")

      tbl.Index = "PrimaryKey"

      tbl.Seek "=", 11070

      Debug.Print tbl("customer id")

      tbl.Close

   End Function

   '=============================================

   'The following function uses the Find method.

   'It is slightly slower in returning the Customer

   '   ID where the PrimaryKey field = 11070.

   '=============================================

   Function Slower()

      Dim Criteria As String, MyDB As Database, Myset As Dynaset

      Set MyDB = CurrentDB()

      Set Myset = MyDB.CreateDynaset("Orders")

      Criteria = "[Order id] =" & 11070

      Myset.FindNext Criteria

      Debug.Print Myset("Customer id")

   End Function

3. From the View menu, choose Immediate window

4. In the Immediate window, type

      ?Faster()

    and press ENTER. Then type

      ?Slower()

    and press ENTER.

The Faster() function, which uses Seek, is slightly faster than the

Slower() function, which uses FindNext.

Reference(s):

"Microsoft Access Language Reference", version 1.0, pages 187-188 and

pages 426-427

References


PRB: Access Database Analyzer Error Message

 Article Number: Q98807

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

SYMPTOMS

   You may receive the following error message when attempting to

   start the Database Analyzer:

      (2046) An error has occurred in Analyzer at:

      Command not available: OpenForm

CAUSE

   This behavior is by design.

RESOLUTION

   Make sure that you always have a database open before starting the

   Database Analyzer. You will only receive this error if you start the

   Database Analyzer without a database open.

More Information:

Steps to Reproduce Behavior

---------------------------

1. Add the Database Analyzer to your help menu bar.

For information about adding the Database Analyzer to your menu bar,

query on the following words in the Microsoft Knowledge Base:

   database and analyzer and help and menu

2. Open Microsoft Access, but do not open a specific database.

3. You should see only a File menu and a Help menu. Choose Database

   Analyzer from the Help menu. You will see the above error message.

4. Open any database and repeat step 3. you will not get the above

   error message, and you will be able to use the Database Analyzer.

References


PRB: Not Part of Aggregate Function or Grouping

 Article Number: Q98808

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

SYMPTOMS

   If a select query that contains an expression is converted to a totals

   query, the following error message will be generated when the query

   is run:

     <expression> not part of aggregate function or grouping.

CAUSE

   When a select query is converted to a totals query, all expressions

   are assumed to contain an aggregate function and will default to

   expression.

RESOLUTION

   To workaround this problem, choose GROUP BY for the expression field

   or add an aggregate function to the expression:

      Query: Query Name

      -------------------------------

      Field name: <expression>

      Total: Group By

More Information:

Steps to Reproduce Behavior

--------------------------

In the sample database Northwind Traders (NWIND.MDB):

1. Open the query [Employee List] in design view, by choosing Query

   in the Database window, highlighting the [Employee List] query and

   choosing Design.

2. Convert the query to a totals query by selecting Totals from the

   View menu.

3. Run the query by selecting Run from the Query menu.

   The following error message will be generated:

      '[Last Name] & ", " & [First Name]'not part of aggregate function or

      grouping.

4. To workaround this error, choose Group By for the expression:

     Query: Employee List

     -------------------------------

     Field name: Employee Name:[Last Name] & ", " & [First Name]

     Total: Group By

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 6, "Designing Select

Queries," pages 141-149

References


INF: Operators as Field Names in Query Cause Error Message

 Article Number: Q98809

 CREATED: 13-MAY-1993

 MODIFIED: 13-MAY-1993

Summary:

If you use a logical operator as a field name in a table, and then

create a query that uses any of those fields, you receive the

following error message:

   Syntax error in query expression 'Table.Field'.

Where Table is the name of the table you are using in the query and

Field is the name of the field that is causing the problem.

More Information:

To correct this situation open the table in design mode and change the

name of the field that was listed in the error message to have a name

that is not one of the logical operators.

The following are logical operators:

   And, Between, Eqv, IIF, Imp, In, Is, Like, Mod, Not, Or, and Xor

For more information search for "logical operators" using the Help

menu.

References


PRACC9304: GPF Printing Subreport with Datasheet Default View

 Article Number: Q98810

 CREATED: 13-MAY-1993

 MODIFIED: 17-MAY-1993

Summary:

SYMPTOMS

   Reports do not have a Datasheet view as forms do; however, forms

   created with a default Datasheet view can be saved as reports.

   This can cause problems in Microsoft Access.

   If you save a form with the DefaultView property set to Datasheet as a

   report and that report is subsequently embedded as a subreport,

   Microsoft Access generates a general protection (GP) fault when the

   report is previewed or printed.

   This problem can occur only if you create the subreport using the Save

   As Report command on the File menu. (To see this command, you must be

   in Design view of the form.)

RESOLUTION

   When using the Save As Report command to create a report from a form,

   be sure the DefaultView property of the form is NOT set to Datasheet.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. Microsoft is researching this problem and will post new

   information here in the Microsoft Knowledge Base as it becomes

   available.

References


PRB: Paste Link into Excel Displays First Field Name Only

 Article Number: Q99316

 CREATED: 26-MAY-1993

 MODIFIED: 26-MAY-1993

Summary:

SYMPTOMS

   When you paste link a table from Microsoft Access into Microsoft

Excel versions 3.0 and earlier, only the first field name of that

table appears in the spreadsheet.

CAUSE

   Microsoft Excel version 3.0 and earlier needs to know the exact

area dimensions prior to paste linking.

RESOLUTION

   In order to paste link a table into Microsoft Excel versions 3.0

and earlier, you should first highlight the entire area on the

spreadsheet. Another option is to use the Paste command, rather than

Paste Link.

More Information:

The following steps will result in an unsuccessful paste link using

Microsoft Excel versions 3.0 and earlier. These same steps will

successfully paste link a table into later versions of Microsoft

Excel.

Steps to Reproduce Behavior

---------------------------

1. Open the sample database Northwind Traders (NWIND.MDB).

2. Highlight the Customers table in the Database window.

3. From the Edit menu, choose Copy.

4. Open Microsoft Excel, and create a new worksheet.

5. In Microsoft Excel, choose Paste Link from the Edit menu.

Reference(s):

"Microsoft Excel Users Guide," version 3.0, Chapter 8, "Working with

Data from Multiple Documents," pages 318-319

References


INF: Using WordPerfect Print merge Secondary Files in Access

 Article Number: Q99317

 CREATED: 26-MAY-1993

 MODIFIED: 26-MAY-1993

Summary:

This article describes how to export data from a WordPerfect print merge

secondary file for use in Microsoft Access.

More Information:

A WordPerfect secondary file contains records of information, typically

names and addresses, used in a print merge with a primary file, which is

usually a form letter or mailing label document. In order to use data

from a WordPerfect secondary file, the information must be saved in a

comma or tab delimited (separated) unformatted text file. WordPerfect

secondary files are neither comma or tab delimited.

A typical comma delimited text file might look like the following:

    "Joe","Smith","123 Main Street","Seattle, WA 98033"

    "Martha","Jones","4523 Williams Ave","","Redmond, WA 98052"

The equivalent WordPerfect secondary file looks like the following:

    Joe{END FIELD}

    Smith{END FIELD}

    123 Main Street{END FIELD}

    Seattle, WA 98033{END FIELD}

    {END RECORD}

    <CRLF>

    Martha{END FIELD}

    Jones{END FIELD}

    4523 Williams Ave{END FIELD}

    {END FIELD}

    Redmond, WA 98052{END FIELD}

    {END RECORD}

    <CRLF>

The <CRLF> above represents a hard page break.

Problems with secondary files with multi-line field entries

-----------------------------------------------------------

WordPerfect allows you to have multiple lines of data in a single field

for merging. The following record has only 2 fields, one for the name,

the other for the address:

    Joe Smith{END FIELD}

    123 Main Street

    Suite 101

    Seattle, WA 98033{END FIELD}

    {END RECORD}

    <CRLF>

Delimited text files use carriage returns to mark the end of a record

and cannot be included in field information. Each line in the secondary

file MUST be made into a unique field before it can be prepared as a

delimited file. Be careful, that by adding the {END FIELD} code to a

record which creates a new field, that this new field is represented in

every record in the file. Each record must contain the same number of

fields, and each field should contain the same type of information or be

empty.

Using the {FIELD NAMES} section in a secondary file

---------------------------------------------------

Fields in a secondary file can be referenced from a primary file by

number, which is the position of the field numbered from top to bottom,

or by a name which is assigned in a {FIELD NAMES} section appearing at

the top of the secondary file. This section is optional, appearing at

the top of the secondary file, and can look like the following:

    {FIELD NAMES}

    Name~

    Address~

    ~{END RECORD}

or all on one line:

    {FIELD NAMES}Name~Address~~{END RECORD}

Referencing by number, the Name field would be 1, and the Address field

would be 2. A hard page break falls between this section and the first

record of data.

Preparing the Comma Delimited Secondary File

============================================

WordPerfect for Windows

-----------------------

WordPerfect for Windows can save secondary files directly to a comma

delimited format. However, if you have a {FIELD NAMES} section in the

file and wish to preserve these names when used in Access, you must

reformat it so that each name is separated by a comma and not the tilde

character. Also, the fields should not appear on separate lines followed

by carriage returns. The following {FIELD NAMES} section:

    {FIELD NAMES}

    Name~

    Address~

    Phone~

    ~{END RECORD}

should be editing to look like:

    {FIELD NAMES}Name,Address,Phone{END RECORD}

To create the comma delimited file:

1. From the File menu choose Save As.

2. In the Save As box, type a unique file name, preferably with a TXT

   extension.

3. In the Format box choose "ASCII Delimited Text (DOS)" , then choose

   the Save button.

WordPerfect for DOS

-------------------

WordPerfect for DOS cannot save secondary files directly to a delimited

format like the Windows version. Although the following technique can be

used, it is preferable to use the Windows version to prepare the file.

To create the comma delimited file, a primary file will need to be

created into which the secondary information will be merged. The primary

document will have the fields situated in a comma delimited format. Once

the data is merged, hard page breaks will need to be removed separating

each record. The resulting document can be saved as a text file which

Access can import.

Creating the Primary File

-------------------------

1. Press F7, No, then No to create a new Wordperfect document.

2. Type an open quote mark. Press Shift+F9, then 1 (Field). In the

   "Enter Field:" prompt, type the name of the first field if a {FIELD

   NAMES} section appears in the secondary file, or 1, if there is no

   {FIELD NAMES} section. Press Enter. Type a closing quote mark,

   followed by a comma.

3. Repeat step 2 for each field in the secondary file changing only the

   field name or field position number appropriately. Do not put a comma

   after the last field.

4. Press Enter to place a hard return at the end of the record.

5. Press F10 and type a unique file name after "Document to be saved:"

   and press Enter.

The primary document might look like the following when completed:

     "{FIELD}name~","{FIELD}address~","{FIELD}phone~"

Note: It is OK if the lines word wrap on the screen.

Merging the Primary and Secondary Files

---------------------------------------

1. Press F7, No, then No to create a new WordPerfect document.

2. Press Ctrl+F9, then 1 (Merge). For the "Primary file:" type the

   primary file name and press Enter. For the "Secondary file:" type the

   name of the secondary file and press Enter.

Removing the Residual Hard Page Breaks

--------------------------------------

1. Press Alt+F2, then N to not confirm replaces.

2. At the "-> Srch:" prompt, press Ctrl+Enter to place a [HPg] code.

3. Press Alt+F2 twice to skip past the "Replace With:" prompt.

Saving as an Unformatted Text File

----------------------------------

1. Press Ctrl+F5, then 1 (DOS Text), then 1 (Save).

2. Type a valid document name, preferably with a TXT extension, at the

   "Document to be saved (DOS Text):" prompt, and press Enter.

Reference(s): "WordPerfect" DOS Version 5.1 pages 460-470

              "WordPerfect 5.1 Reference" pages 420-431

References


PRACC1115: ApplyFilter Action Causes Form To Be Read-Only

 Article Number: Q99318

 CREATED: 26-MAY-1993

 MODIFIED: 07-JUN-1993

Summary:

SYMPTOMS

   Running a macro that contains an ApplyFilter action may cause a form

   to become read-only. This problem occurs if the form is based on a

   query that contains two tables with a one-to-many relationship and

   only records from the one side are included in the output of the

   query.

RESOLUTION

   There is no way to prevent the ApplyFilter action from making the form

   read-only. However, you can use one of the following methods to filter

   the records displayed in a form:

   - Base the form on a parameter query. The user will then be prompted

     for the criteria with which to filter the records each time the form

     is opened. For more information on parameter queries, refer to pages

     178-181 in the "User's Guide."

   - Place the form in another form as a subform. Set up the LinkMaster

     and LinkChild properties so that one or more fields in the main form

     filter the data in the subform. For more information on subforms,

     refer to the pages 272-278 in the"User's Guide."

   - Use Access Basic code to control the records displayed in the form.

     For more information, refer to pages 106-107 in the "Introduction to

     Programming" manual.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0. This problem was corrected in version 1.1.

Steps to Reproduce Problem

--------------------------

1. In the sample database, NWIND.MDB, create a new query based on the

   Customers and Orders tables. Join the tables on [Customer ID].

2. Drag all fields from the Customers table to the query grid. Drag

   down [Order ID] from the Order table. Add the criteria: >10080 and

   clear the Show box.

3. Save the query and create a new form based on it. Drag several

   fields from the field list to the form.

4. Create a macro with an ApplyFilter action. Set the macro's Where

   Condition argument to

      [Company Name] Like "c*"

5. Save the macro and drag it onto the form.

6. Switch to Form view. Verify that you can edit fields.

7. Press the macro button to apply the filter.

You can no longer edit or add records.

References


INF: Finding the OLE Class of an Embedded Object

 Article Number: Q99319

 CREATED: 26-MAY-1993

 MODIFIED: 26-MAY-1993

Summary:

Microsoft Access places a wrapper of information around the OLE Object

before it stores the object in a table. The Name and ClassKey of the

object start at byte count 21 and are stored as two zero-terminating

strings from there. By reading the field as if it were a text field you

can obtain this information and parse out the ClassKey.

This article describes how to get the OLE ClassKey of an OLE data

type with Access Basic.

More Information:

When an OLE object is stored in a table, The OLE ClassKey is the

second Null terminated string after the 20th byte in the object. It

can be read as text with the following code in Access Basic:

Function GetObjectClass$ ()

   If IsNull(screen.activeform!Photo) Then

      GetObjectClass$ = "n/a"

   Else

      MyChunk$ = Mid(screen.activeform!Photo, 21, 40)

      NullOne% = InStr(1, MyChunk$, Chr$(0))

      NullTwo% = InStr(NullOne% + 1, MyChunk$, Chr$(0))

      GetObjectClass$ = Mid(MyChunk$, NullOne% + 1, NullTwo% - NullOne% - 1)

   End If

End Function

The GetObjectClass$() function first checks to see if the object is

null and returns "n/a" if if is. If it is not null it assigns bytes

21 through 40 of the OLE Object to the string MyChunk$.

It then searches for the first Null character, and then the next Null

character from that point on. Finally it sets the function

GetObjectClass$ equal to the string between the two Null characters.

Example:  Using the function provided above, a constrol on the

Employees form of the sample database Northwind Traders (NWIND.MDB)

with the following properties would display the OLE ClassKey for the

Photo control.

ControlName:    ObjClassKey

ControlSource:  =GetObjectClass()

This example should return 'PBrush' for the first photo in the

Employees table.

There are several different ways that this information can be used.

The Windows DLL function RegQueryValue can use the ClassKey to obtain

the information about that class from the REG.DAT file.

Reference(s): KB Article INF: OLE Object Storage in Access; Microsoft

Windows 3.1 Programmer's Reference Volume 2, p. 282.

References


PRACC1405: System Hangs When Minimizing Access Window

 Article Number: Q99320

 CREATED: 26-MAY-1993

 MODIFIED: 03-JUN-1993

Summary:

SYMPTOMS

   Your system stops responding (hangs) when you have switched away from

   Microsoft Access, started another application, switched back to

   Microsoft Access, and pressed the Minimize button.

   This problem occurs only if Microsoft Access is running with Windows

   for Workgroups.

WORKAROUND

   Clicking anywhere in the Microsoft Access window other than the

   Minimize button does not cause the system to hang. After clicking

   anywhere else, you can use the Minimize button without hanging the

   system.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   versions 1.0 and 1.1. Microsoft is researching this problem and will

   post new information here as it becomes available.

Steps to Reproduce Problem

--------------------------

1. Start Microsoft Access.

2. From the Help menu, choose Cue Cards.

3. Select the first option, Design a Database with Tables.

   Note: You must be at a Cue Card screen with a gray background.

4. Switch to Program Manger and start Calculator.

5. Press CTRL+ESC to bring up Task List and choose Microsoft Access.

6. Press the Minimize button.

Your system now stops responding; you must reboot your computer.

References


INF: Query Optimizing Tips for Attached SQL Database Tables

 Article Number: Q99321

 CREATED: 26-MAY-1993

 MODIFIED: 28-MAY-1993

Summary:

Special considerations must be made for performance optimization of

queries built on attached SQL database tables. A SQL database, for

this article, is defined as any client/server database that supports

some level of ANSI SQL as an intrinsic part of the database's

programming language. Optimal query strategy for these queries is to

ensure that all query operations are performed on the server. This

article outlines tips on how to ensure that queries against attached

SQL database tables are performed on the server.

This article assumes a basic understanding of client/server computing

environments and architectures.

More Information:

The key to improving query performance on attached SQL database tables

is to ensure that no data is filtered on the client. Filtering data on

the client increases network traffic and does not allow for leveraging

of advanced server hardware, essentially turning a client/server

system into a file server system. To this end, keeping the query

evaluation on the server reduces overhead and keeps an application

running as fast as possible.

Generic query optimization techniques should not be ignored when you

are using attached SQL database tables. "WHERE clause" restrictions,

such as equality or range comparisons, and sorting should still be

performed on indexed fields. For more information on query

optimization, call Microsoft Consumer Sales at (800) 426-9400 to

order a "white paper" on SQL Server optimization. Other SQL database

vendors may provide the same information for their customers.

Use care when implementing intrinsic or user defined functions (UDFs)

in query fields or when using criteria that are not supported on the

server. Generally, SQL databases have functionality that corresponds

to most standard Microsoft Access functions, but each server will be

different.

Many intrinsic Microsoft Access functions have direct back-end

correspondents. Microsoft Access asks the ODBC driver about intrinsic

function support and performs the appropriate mappings.

You can use UDFs and Microsoft Access intrinsic functions without server

equivalents when they are accompanied by server-capable restrictions

that prune down the data. For example, the following query

    Query1a: SELECT * FROM MillionRowTable WHERE Funk1(col1) = 10

returns the whole table and evaluates Funk1(col1) = 10 locally, whereas

the following query

    Query1b: SELECT * FROM MillionRowTable WHERE Funk1(col1) = 10

                       AND LastName BETWEEN 'g' AND 'h'

sends the BETWEEN 'g' AND 'h' restriction to the server, returns the

qualifying rows, and evaluates Funk1(col1) on only those rows.

Non-remote-capable SELECT list items don't force a query to be

executed locally, unless they are used with unique values or a totals

query (DISTINCT/GROUP BY). For example, the following query

    Query2a: SELECT * FROM MyTable WHERE Format(col1, ...) = 10

returns the whole table and causes the WHERE clause to be evaluated

locally. However, the following query

    Query2b: SELECT Format(col1,...) FROM MyTable WHERE col2 = 10

sends "SELECT col1 FROM MyTable WHERE col2 = 10" to the server,

presumably returning far less data over the network. It then locally

evaluates Format() on the col1 values returned.

Of the following two queries, Query3a is sent completely to the

server. Query3b sends "SELECT col1 FROM MyTable" and performs the

Format() function, and therefore the DISTINCT clause, locally.

    Query3a: SELECT DISTINCT col1 FROM MyTable

    Query3b: SELECT DISTINCT Format(col1,...) FROM MyTable

The following two queries are performed as follows: Query4a is sent

completely to the server. Query4b sends "SELECT col1 FROM MyTable" and

performs the StdDev() aggregate function locally, since it's not a SQL

standard function.

    Query4a: SELECT Sum(col1) FROM MyTable

    Query4b: SELECT StdDev(col1) FROM MyTable

Crosstab queries present unique restrictions, some pertinent to all

queries, some to crosstab queries only:

1. Only standard aggregate functions, such as Count(), Sum(), Min(),

   Max(), and Avg(), can be used.

2. Aggregate functions can't be used as row or column headers.

3. Only one aggregate function can be used in the "value."

4. Nothing can be sorted.

5. If a fixed-value list of column headers is supplied, the value

   can't be embedded in an expression.

Restriction #1 applies to all queries against SQL databases from

Microsoft Access. Except for #4, the others are uncommon and are

crosstab/SQL database specific. Crosstab queries aren't SQL standard,

and aren't generally supported on SQL database servers. However, if

the rules above aren't violated (which is the case for most simple

crosstab queries), Microsoft Access can reformulate the query as a

standard GROUP BY query, send it remotely, return only the aggregation

result, and transform it into a crosstab locally.

Open-ended restrictions do not use indexes on SQL databases.

Typically, a SQL WHERE clause reading

   WHERE col1 > 1000

will be slower than

   WHERE col1 between 1000 and 1000000000

This is a server problem, not a Microsoft Access problem, but it can

affect Microsoft Access performance when a SQL database is used as a

back end.

When you are using wildcard characters, take special care to ensure

that the correct wildcards are used. SQL Server supports the use of %

and _ rather than ? and * for wildcards. For more information, query

on the following words in the Microsoft Knowledge Base:

    parameter and queries and wildcards and SQL

References


INF: Calling RegQueryValue() to get an OLE Object Class Name

 Article Number: Q99322

 CREATED: 26-MAY-1993

 MODIFIED: 26-MAY-1993

Summary:

The Windows function in SHELL.DLL called RegQueryValue can use an

OLE ClassKey, such as "PBRUSH" or "MSGRAPH" to obtain the information

about that class from the REG.DAT file.

This article describes the way this function can obtain the Object

Class Name from the OLE Registration Database called REG.DAT, located

in the Windows Directory.

While only getting the Object Class Name is described, other

information, including the current location of the OLE Server and the

types of <VERBS> available to the object can also be obtained. For

more information regarding the use of RegQueryValue, consult the

Microsoft Windows 3.1 Programmer's Reference Volume 2, p. 282.

More Information:

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

Declare Function RegQueryValue Lib "shell" (ByVal hkey&,_

   ByVal SubKeyStr$, ByVal QueryStr$, Buffsize&) As Long

Function GetObjectName$ (TheClassKey$)

   Dim ClassName$

   ClassName$ = Space$(255)

   X& = CLng(Len(ClassName$))

   cb = RegQueryValue(1, TheClassKey$, ClassName$, X&)

   GetObjectName$ = ClassName$

End Function

This function dimensions a string to pass as a parameter for a

return value in RegQueryValue. RegQueryValue has 4 parameters:

HKEY:       The handle to a Key that defines what type of

            information you want to retrieve.

lpszSubKey: A String that contains the ClassKey that you want

            to look up.

lpszValue:  A String to place the result value in.

lpcb:       The maximum length of the result string

To use the function mentioned above, create a control on a form

with the following properties.

ControlName:    ObjName

ControlSource:  =GetObjectName ("PBRUSH")

Any appropriate OLE ClassKey in the REG.DAT OLE database can

be passed to the function. For information on finding the

ClassKey of an Embedded object see the article:

INF: Finding the OLE Class of an Embedded Object

Reference(s): KB Article INF: OLE Object Storage in Access; Microsoft

Windows 3.1 Programmer's Reference Volume 2, p. 282.

References


PRB: Paradox Character Translation Different in Win 3.0 & 3.1

 Article Number: Q99397

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAY-1993

Summary:

SYMPTOMS

   When importing, attaching to, or exporting Paradox tables, certain

   characters translate differently when using Microsoft Windows

   version 3.0 instead of Microsoft Windows version 3.1.

CAUSE

   Microsoft Windows versions 3.0 and 3.1 use different versions of

   the Windows API function OemToAnsi.

STATUS

   This behavior is by design in Microsoft Windows versions 3.0 and

   3.1.

More Information:

When importing Paradox data, Microsoft Windows version 3.0 translates

ASCII characters 246, 251, and 256 differently than does Microsoft

Windows version 3.1. Below are the differences:

   ASCII    Win 3.0    Win 3.1

   ----------------------------

   246 ÷       95 _      247 ÷

   249 ·      183 ·      149 o

   254 o      168 Ï      95 _

References


INF: Formatting Axis Labels in Graphs

 Article Number: Q99398

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAY-1993

Summary:

The Graphing Wizard in Microsoft Access does not give users the

option to format the labels of the graph's axis. You can modify the

labels in Microsoft Graph but this change is not permanent. The next

time the graph is updated the formatting will be lost.

This article describes the steps to change the format permanently by

modifying the information that Microsoft Access sends to Microsoft

Graph.

More Information:

When a graph is created using the Graphing Wizard, an SQL statement

is built. This statement is placed in the RowSource property of the

graph object. Each time the form or report the graph resides in is

refreshed, this SQL statement is re-executed and the results are sent

to Microsoft Graph.

This SQL statement can be modified by the user. It is recommend that

you copy it to a new query window where you can test the changes that

you make.

The example below describe the steps to change the format of the

labels in a graph based on the Orders table in the example database

Northwind Traders.

I. Create the Graph

-------------------

1. Open the database NWIND.MDB.

2. In the database container, select the table Orders.

3. Press the New Form button on the Tool bar.

4. Select FormWizards.

5. Choose Graph and press OK.

6. To accept the defaults at the screen: "Which Type of Graph do you

   want?", press Next.

7. At the next screen, "Which fields contain the data...", choose

   the field Order Date from the Available Fields list and press

   the right arrow to add it to the Selected Fields list.

8. Then, select Order Amount and add it to Selected Fields.

9. Go to the next screen, "How do you want to group the data?" and

   press Next twice to accept the default: Group [Order Date] by: Year.

10. At the final screen, press Open.

Note that the labels for the axis are: 1990, 1991, 1992

II. Changing the Format of the Labels

-------------------------------------

1. Switch the form to design mode.

2. Select the chart object and show the property sheet.

3. Place your cursor in the RowSource property.

4. Press SHIFT+F2 to open the Zoom window.

5. Select the entire SQL Statement and press CNTL+C to copy it

   to the clipboard.

6. Create a new query.

7. From the View menu, choose SQL.

8. Highlight all text in the SQL dialog and press CNTL+V to

   paste in the contents of the clipboard, replacing the existing

   text.

9. Press OK.

10. The fields [Order Date] and [Order Amount] will be placed

    in the query grid.

11. Change the field [Order Date] to =Format([Order Date],"YY")

12. Execute the query to verify that the years in the Order Date

    column are formatted as: 90, 92, 93.

13. Switch back to design mode, choose View SQL, and copy the

    contents of the SQL dialog to the clipboard.

14. Go back to the form, select the chart object, and paste

    the contents of the clipboard into the RowSource property.

15. Switch to Form view. The labels of the axis should now

    be: 90, 91, and 92.

References


PRB: Strange Characters Appear in Imported DBASE IV Memo Data

 Article Number: Q99399

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAY-1993

Summary:

SYMPTOMS

   Strange characters appear in a memo field of an imported dBASE IV data at

   approximately every 65th character. Specifically, Chr(236) and Chr(10).

CAUSE

   This is actually a part of the dBASE IV data. dBASE IV uses these

   characters so that its memo editor word-wraps. dBASE IV's memo

   editor has a fixed line length of 65 characters, so the mechanism is

   stored in the data rather than requiring the editor to force the

   word-wrap.

RESOLUTION

   You can remove these characters without damaging the data even if you

   want to eventually export the data back out to dBASE IV. You remove

   the characters using the procedure at the bottom of this article.

More Information:

   To use this procedure:

   1. Copy the DB4MEMOFIX procedure listed at the bottom of this article

      in to a new  module in your database.

   2. Save the module by choosing Save from the File menu.

   3. With the module window still open, choose Immediate window from

      the View menu.

   4. In the Immediate window, type...

      DB4MemoFix <tablename>, <fieldname> where <tablename> is the

      name of the imported dBASE IV table and <fieldname> is the name

      of the memo field that contains the bad characters. For example:

         DB4MemoFix "CUST", "NOTES"

   Once the process is completed, the word 'Done' will appear in the

   Immediate window and the characters will have been stripped.

   The DB4MemoFix procedure follows:

      Sub DB4MemoFix (TableName As String, FieldName As String)

         Dim D As Database, T As Table

         Set D = CurrentDB()

         Set T = D.OpenTable(TableName)

         T.MoveFirst

         Do Until T.EOF

            oldmemo$ = Trim(T(FieldName))

            newmemo$ = ""

            For i = 1 To Len(oldmemo$)

               If Mid(oldmemo$, i, 2) = (Chr(236) & Chr(10)) Then

                  i = i + 1

               Else

                  newmemo$ = newmemo$ & Mid(oldmemo$, i, 1)

               End If

            Next

            T.Edit

            T(FieldName) = newmemo$

            T.Update

            T.MoveNext

         Loop

         D.Close

         Debug.Print

         Debug.Print "Done"

   End Sub

Reference(s):

References


INF: How to Confirm Editing of a Field

 Article Number: Q99400

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAY-1993

Summary:

This article describes how to prompt the user to confirm changes to a

field. It makes use of a conditional macro.

More Information:

This following example uses the Employees Form in the sample database

Northwind Traders (NWIND.MDB).

1. Create the following new macro by choosing the Macro button in the

   Database window and then choose New.

     Macro Name  Condition                        Action       Defined Below

     --------------------------------------------------------  -------------

     AreYouSure  MsgBox("Commit changes?",1)=2   CancelEvent        1.

                    ...                          SendKeys           2.

     AreYouSure Actions

     ------------------

     1. CancelEvent

     2. SendKeys

           Keystrokes: {esc}

           Wait: NO

The ellipses in the Condition column are required for the second

action. Microsoft Access evaluates macro conditions as true or false.

If the expression is true, Microsoft Access performs the action. If

it's false, Microsoft Access ignores the action. The ellipses in the

Condition column force Microsoft Access to perform the action on that

line if the condition on the preceding line is true. This macro should

be saved as AreYouSure.

2. Open the Employees Form in Design view by clicking the Form button

   in the Database window, highlighting the Employees form, and choosing

   Design.

3. To display the Property sheet, select Property from the View menu.

4. Highlight the text box control [Hire Date] to display this text

   box's properties.

5. Set the following properties for the Employees form and [Hire Date]

   text box control:

     Form:  Employees

        Caption:  Employees Form

        Controlsource:  Employees

     Text box: Hire Date

        ControlName:  Hire Date

        ControlSource:  Hire Date

        Before Update:  AreYouSure

6. View the Form by choosing Form from the View menu. When the date in the

   [Hire Date] field is edited, a message box will appear to confirm your

   change. Choose OK to confirm the change. Choose Cancel to cancel the

   change.

Note:  This example uses the MsgBox statement instead of the MsgBox

action. The MsgBox action only has an OK Button whereas the MsgBox Statement

can include a CANCEL button.

Reference(s):

"Microsoft Access Language Reference," version 1.0, "MsgBox Statement"

pages 316-320

"Microsoft Access User's Guide," version 1.0, Chapter 22, "Using

Macros with Forms," pages 528-554

References


INF: How First Line of Data is Used to Import Delimited Text

 Article Number: Q99401

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAY-1993

Summary:

The first line of data is extremely important when importing delimited

text files. Microsoft Access uses the first line of data to determine:

1. The number of fields

2. The data type for each field

For this reason, it is important to verify that the first line of data

correctly reflects the rest of the data in the table. This article

discusses some of the common problems that may be encountered when the

first line of data is incorrect and how to workaround them.

More Information:

To specify the structure that Microsoft Access should use, instead of

relying on the first line of data, you can:

1. Create a table in Microsoft Access that has the correct number of

   fields and the correct data type for each field.

2. Select Import from the File menu.

3. Select Text (delimited) from the Data Source list and choose OK.

4. Select the text file and choose OK.

5. In the Import Text Options dialog, choose Append to Existing Table

   and specify the table you created in step 1. Choose OK to import the

   file.

Determining the Number of Fields

--------------------------------

Microsoft Access scans the first line of data to determine the number

of fields in the text file. If successive records contain more fields,

they will be ignored, and no error message will be given. For example,

suppose you have a text file that looks like the following:

   5959,"John Doe","123 Main Street"

   5960, "George Brown","55 Orange Avenue","MainTown","WA","USA"

Because the first line only contains three fields, Microsoft Access

will create the following table:

   Col 1     Col 2             Col 3

   --------------------------------------------

   5959      John Doe          123 Main Street

   5960      George Brown      55 Orange Avenue

Note that the additional fields were ignored and no error message was

generated.

Determining the DataTypes

--------------------------

Microsoft Access will scan the first line to determine the data type

for each field. If the data type in the field is invalid, a Type

Conversion Failure error will be generated in the Import Errors Table.

For example, if the following text file is imported:

   5959,"John Doe","123 Main Street",8/12/90

   5960,"George Brown","55 Orange Avenue",81290

   ABCD,"Jane Bell","78 West Street",8/12/90

Microsoft Access will detect four fields with the following data

types:

   Field      DataType

   -------------------

   1          Number

   2          Text

   3          Text

   4          Date/Time

The second record fails to convert because the number 81290 in the fourth

field is not a date/time value as determined by the first record value

8/12/90. The third record fails because ABCD in the first field is not a

number. As a result Access reports Type Conversion Errors for each case.

Other Workarounds

-----------------

In addition to import appending the text file to an existing table,

it is also possible to use a text editor to edit the first line of data to

correctly reflect the number of fields and data types in the file.

If a field in the first row contains a number which is suppose to go into a

text field, place double quotes around the number in the first row. Access

will then correctly interpret the field as a text field.

Reference(s):

"Microsoft Access User's Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 72-79

References


PRB: Incorrect Btrieve Error Message, [Btrieve ISAM] section

 Article Number: Q99402

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAY-1993

Summary:

SYMPTOMS

   An incorrect error message may be returned when attempting to

   Attach or Import a Btrieve file. The error message returned is:

      Invalid entries in [Btrieve ISAM] section in WIN.INI

   The correct wording should refer to the [Btrieve] section and not

   [Btrieve ISAM].

CAUSE

   This error message is generated when Microsoft Access tries to

   Attach or Import a Btrieve file and the settings in the [Btrieve]

   section are incorrect.

RESOLUTION

   Search for the [Btrieve] section in the WIN.INI file instead of the

   [Btrieve ISAM] section.

More Information:

Additional information can be found by searching for Btrieve, WIN.INI

References


INF: Sending a MAPI Mail Message from Microsoft Access

 Article Number: Q99403

 CREATED: 27-MAY-1993

 MODIFIED: 23-JUN-1993

Summary:

The following example includes a Microsoft Access module which

demonstrates how to send a MAPI (Mail Application Programming

Interface) message to multiple TO recipients, carbon copies (CC), and

blind CC destinations with multiple attachments.

More Information:

The following procedure explains how to use this sample module:

1. Create a form with the following controls:

   Form:  Test

   -----------

   Caption:  TestForm

   Text box:  Subject

      ControlName:  Subject

   Text box:  To

      ControlName:  To

   Text box:  CC

      ControlName:  CC

   Text box:  BCC

      ControlName:  BCC

   Text box:  Attach

      ControlName:  Attach

   Text box:  Message

      ControlName:  Message

   Command button: Button0

      Caption: Send Message

      OnPush: =Mail()

2. Open either a new module or a previously created module and enter

   the following code:

   NOTE: In the following sample code, an underscore (_) is used as a

   line continuation character for easier reading. Remove the

   underscore when re-creating this code in Access Basic.

'*************************************************************

'Declarations section of the module.

'*************************************************************

Option Explicit

Option Compare Database   'Use database order for string comparisons

Type MAPIMessage

    Reserved As Long

    Subject As String

    NoteText As String

    MessageType As String

    DateReceived As String

    ConversationID As String

    Flags As Long

    RecipCount As Long

    FileCount As Long

End Type

Type MapiRecip

    Reserved As Long

    RecipClass As Long

    Name As String

    Address As String

    EIDSize As Long

    EntryID As String

End Type

Type MapiFile

    Reserved As Long

    Flags As Long

    Position As Long

    PathName As String

    FileName As String

    FileType As String

End Type

Declare Function MAPISendMail Lib "MAPI.DLL" Alias "BMAPISendMail" _

(ByVal Session&, ByVal UIParam&, Message As MAPIMessage, Recipient _

As MapiRecip, File As MapiFile, ByVal Flags&, ByVal Reserved&) As Long

Global Const SUCCESS_SUCCESS = 0

Global Const MAPI_TO = 1

Global Const MAPI_CC = 2

Global Const MAPI_BCC = 3

Global Const MAPI_LOGON_UI = &H1

'*************************************************************

' End of declarations section

'*************************************************************

'*************************************************************

' FUNCTION NAME: Mail

'

' PURPOSE:

'   Passes information on the active forms To, Subject, CC, BCC,

'   Attach, and Message text boxes to the SendMail function.

'   It ensures that each box does not have a NULL value. It also

'   displays an error message if SendMail fails.

'   This function is called from the OnPush property of the form.

'

' INPUT PARAMETERS:

'   None

'

' RETURN

'   None

'*************************************************************

Function Mail ()

    Dim F As Form, Result

    Set F = Screen.ActiveForm

    ' Make sure user has something in the To: box

    If IsNull(F!To) Or F!To = "" Then Exit Function

    ' Make sure no Null values are in the other boxes

    If IsNull(F!Subject) Then F!Subject = ""

    If IsNull(F!CC) Then F!CC = ""

    If IsNull(F!BCC) Then F!BCC = ""

    If IsNull(F!Attach) Then F!Attach = ""

    If IsNull(F!Message) Then F!Message = ""

    ' Send the message, passing information from the form

    Result = SendMail((F!Subject), (F!To), (F!CC), (F!BCC), _

                (F!Attach), (F!Message))

    ' Test the result for any errors

    If Result <> SUCCESS_SUCCESS Then

        MsgBox "Error sending mail: " & Result, 16, "Mail"

    Else

        MsgBox "Message sent successfully!", 64, "Mail"

    End If

End Function

'*************************************************************

' FUNCTION NAME: SendMail

'

' PURPOSE:

'   This is the front-end function to the MAPISendMail function. You

'   pass a semicolon-delimited list of To, CC, and BCC recipients, a

'   subject, a message, and a delimited list of file attachments.

'   This function prepares MapiRecip and MapiFile structures with the

'   data parsed from the information provided using the ParseRecord

'   sub. Once the structures are prepared, the MAPISendMail function

'   is called to send the message.

'

' INPUT PARAMETERS:

'   sSubject: The text to appear in the subject line of the message

'   sTo:      Semicolon-delimited list of names to receive the

'             message

'   sCC:      Semicolon-delimited list of names to be CC'd

'   sBCC:     Semicolon-delimited list of names to be blind CC'd

'   sAttach:  Semicolon-delimited list of files to attach to

'             the message

' RETURN

'   SUCCESS_SUCCESS if successful, or a MAPI error if not.

'*************************************************************

Function SendMail (sSubject As String, sTo As String, sCC As String, _

                   sBCC As String, sAttach As String, sMessage As String)

    Dim i, cTo, cCC, cBCC, cAttach          ' variables holding counts

    Dim MAPI_Message As MAPIMessage

    ' Count the number of items in each piece of the mail message

    cTo = CountTokens(sTo, ";")

    cCC = CountTokens(sCC, ";")

    cBCC = CountTokens(sBCC, ";")

    cAttach = CountTokens(sAttach, ";")

    ' Create arrays to store the semicolon delimited mailing

    ' .. information after it is parsed

    ReDim rTo(0 To cTo) As String

    ReDim rCC(0 To cCC) As String

    ReDim rBCC(0 To cBCC) As String

    ReDim rAttach(0 To cAttach) As String

    ' Parse the semicolon delimited information into the arrays.

    ParseTokens rTo(), sTo, ";"

    ParseTokens rCC(), sCC, ";"

    ParseTokens rBCC(), sBCC, ";"

    ParseTokens rAttach(), sAttach, ";"

    ' Create the MAPI Recip structure to store all the To, CC, BCC

    ' .. information to be passed to the MAPISendMail function

    ReDim MAPI_Recip(0 To cTo + cCC + cBCC - 1) As MapiRecip

    ' Setup the "TO:" recipient structures

    For i = 0 To cTo - 1

        MAPI_Recip(i).Name = rTo(i)

        MAPI_Recip(i).RecipClass = MAPI_TO

    Next i

    ' Setup the "CC:" recipient structures

    For i = 0 To cCC - 1

        MAPI_Recip(cTo + i).Name = rCC(i)

        MAPI_Recip(cTo + i).RecipClass = MAPI_CC

    Next i

    ' Setup the "BlindCC:" recipient structures

    For i = 0 To cBCC - 1

        MAPI_Recip(cTo + cCC + i).Name = rBCC(i)

        MAPI_Recip(cTo + cCC + i).RecipClass = MAPI_BCC

    Next i

    ' Create the MAPI File structure to store all the file attachment

    ' .. information to be passed to the MAPISendMail function

    ReDim MAPI_File(0 To cAttach) As MapiFile

    ' Setup the file attachment structures

    MAPI_Message.FileCount = cAttach

    For i = 0 To cAttach - 1

        MAPI_File(i).Position = -1

        MAPI_File(i).PathName = rAttach(i)

    Next i

    ' Set the mail message fields

    MAPI_Message.Subject = sSubject

    MAPI_Message.NoteText = sMessage

    MAPI_Message.RecipCount = cTo + cCC + cBCC

    ' Send the mail message

    SendMail = MAPISendMail(0&, 0&, MAPI_Message, MAPI_Recip(0), _

                  MAPI_File(0), MAPI_LOGON_UI, 0&)

End Function

'*************************************************************

' SUB NAME: CountTokens

'

' PURPOSE:

'   Given a string of delimited items and the delimiter, the number

'   of tokens in the string will be returned. This function is useful

'   for dimensioning an array to store the delimited items prior to

'   calling ParseTokens.

'

' INPUT PARAMETERS:

'   sSource: A delimited list of tokens

'   sDelim:  The delimiter used to delimit sSource

'

' RETURN

'   The number of tokens in sSource, which is the number of delimiters

'   plus 1. If sSource is empty, 0 is returned.

'*************************************************************

Function CountTokens (ByVal sSource As String, ByVal sDelim As String)

    Dim iDelimPos As Integer

    Dim iCount As Integer

    ' Number of tokens = 0 if the source string is empty

    If sSource = "" Then

        CountTokens = 0

    ' Otherwise number of tokens = number of delimiters + 1

    Else

        iDelimPos = InStr(1, sSource, sDelim)

        Do Until iDelimPos = 0

            iCount = iCount + 1

            iDelimPos = InStr(iDelimPos + 1, sSource, sDelim)

        Loop

        CountTokens = iCount + 1

    End If

End Function

'*************************************************************

' SUB NAME: GetToken

'

' PURPOSE:

'   Given a string of delimited items, the first item will be

'   removed from the list and returned.

'

' INPUT PARAMETERS:

'   sSource: A delimited list of tokens

'   sDelim:  The delimiter used to delimit sSource

'

' RETURN

'   sSource will have the first token removed. The function

'   returns the token removed from sSource.

'*************************************************************

Function GetToken (sSource As String, ByVal sDelim As String) _

As String

    Dim iDelimPos As Integer

    ' Find the first delimiter

    iDelimPos = InStr(1, sSource, sDelim)

    ' If no delimiter was found, return the existing string and set

    ' .. the source to an empty string.

    If (iDelimPos = 0) Then

        GetToken = sSource

        sSource = ""

    ' Otherwise, return everything to the left of the delimiter and

    ' .. return the source string with it removed.

    Else

        GetToken = Left$(sSource, iDelimPos - 1)

        sSource = Mid$(sSource, iDelimPos + 1)

    End If

End Function

'*************************************************************

' SUB NAME: ParseTokens

'

' PURPOSE:

'   Extracts information from a delimited list of items and places

'   it in an array.

'

' INPUT PARAMETERS:

'   Array(): A one-dimensional array of strings in which the parsed tokens

'            will be place

'   sTokens: A delimited list of tokens

'   sDelim:  The delimiter used to delimit sTokens

'

' RETURN

'   None

'*************************************************************

Sub ParseTokens (Array() As String, ByVal sTokens As String, ByVal _

                 sDelim As String)

    Dim i As Integer

    For i = LBound(Array) To UBound(Array)

        Array(i) = GetToken(sTokens, sDelim)

    Next

End Sub

References:

"Microsoft Mail Technical Reference," chapter 4.

References


PRACC9304: SQL Delete Triggers Function Incorrectly

 Article Number: Q99404

 CREATED: 27-MAY-1993

 MODIFIED: 03-JUN-1993

Summary:

SYMPTOMS

   Microsoft Access appears to delete a record in an attached SQL

   table, but the record is not actually deleted. The record will

   reappear when you requery the table.

CAUSE

   The Microsoft SQL Server driver that comes with Microsoft Access

   version 1.0 incorrectly indicates that the result of the SQL delete

   action is successful.

RESOLUTION

   To correct this problem, you must DROP the current trigger and CREATE

   a new delete trigger on the SQL Server that uses the RAISERROR command

   instead of the PRINT command. This method causes Access version 1.0 to

   not delete the record and display the following error messages:

      ODBC - delete failed.

      [Microsoft][ODBC SQL Server Driver][SQL Server] <MESSAGE> (#-31073)

   where <MESSAGE> is the message you specified in the RAISERROR command.

STATUS

   Microsoft has confirmed this to be a problem in Microsoft Access

   version 1.0.

More Information:

If you try to delete a record from an attached SQL table that has a

delete trigger that performs a ROLLBACK and a PRINT action on the SQL

Server, Microsoft Access version 1.0 appears to delete the record and

then displays a message box asking you to verify your deletion. The

record is actually not deleted and reappears when you requery the

table by pressing SHIFT+F9, choosing Show All Records from the Records

Menu, or closing and reopening the table.

In Microsoft Access version 1.1, the RAISERROR method works the same

way that it does in version 1.0. The PRINT method works similarly to

the way it does in version 1.0.

In version 1.0, the PRINT method appears to let you delete the record

without a warning, then later the record reappears. In version 1.1,

the PRINT method still does not display the message specified by the

PRINT command; however, it does not remove the record, and it does

display the following error message:

   ODBC - call failed.

Steps to Reproduce Problem

--------------------------

1. Create a trigger on a SQL Server table that uses the SQL commands

   ROLLBACK and PRINT.

2. Attach to the SQL table that the delete trigger was created for by

   choosing Attach from the File menu.

3. Once the Table is attached, open it in Datasheet view.

4. Select a record by clicking the gray record selector to the left of

   the record or by choosing Select Record from the Edit menu.

5. Delete the record by pressing the DEL key or by Choosing Delete

   from the Edit menu.

6. Choose Yes in the Confirmation dialog box that is now displayed.

The record appears to now be deleted from the table. Requery the table

by pressing SHIFT+F9. The record reappears.

Reference(s):

"Microsoft SQL Server Language Reference," version 4.2, pages 88-93,

137, 203-204, and 214-216

References


INF: Part 2, DDE in Visual Basic to Request Data from Access

 Article Number: Q99405

 CREATED: 27-MAY-1993

 MODIFIED: 03-JUN-1993

Summary:

This is the second in a series of two articles containing an advanced

example that demonstrates how to use Visual Basic to request data from

Microsoft Access by using dynamic data exchange (DDE).

More Information:

The following Visual Basic example demonstrates how to use DDE to

request information by using SQL statements and the rich set of items

supported by Microsoft Access to navigate tables. Further, a

subroutine that assists in parsing data from the tab-delimited records

that are requested is provided.

Specifically, the example does the following:

1. Gets the number of records and fields in the table using the

   "FirstRow" and "FieldCount" items.

2. Creates an array to store the records when they are retrieved.

3. Requests the data from a table, one record at a time, using the

   "FirstRow" and "NextRow" items.

4. Requests a list of field names using the "FieldNames" item.

5. Uses a subroutine to parse each tab-delimited record requested from

   Access and places the data in the array mentioned above. (A separate

   array holds the field names).

6. This step is optional. Once all the data is placed in the array, a

   Visual Basic grid control will be populated with the array contents.

   Further, the grid columns will be populated with the names of the

   fields.

When you run this example, be sure that Access is running and the

sample database NWIND.MDB is open.

To use this example, create a new Visual Basic program with a text

box, a command button, and a grid control with the following

properties:

   Text Box

   --------

      Name: Text1

   Command Button

   --------------

      Name: Command1

   Grid

   ----

      Name: Grid1

Note: The grid control is available in the Professional Toolkit for

Visual Basic version 1.0 and ships with version 2.0 of the

Professional Edition of Microsoft Visual Basic for Windows.

Double-click the command button and type the code that follows between

the Sub Command1_Click () and End Sub lines.

Note: In the following sample code, an underscore (_) is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

   Dim CntRows, CntCols As Integer ' Row and column count in the table

   Dim Row, Col As Integer         ' Current row/column being filled.

   Dim Record As String            ' Record read from employees table.

   ' Get the number of records in the Employees Table

   Text1.LinkTopic = "MSACCESS|NWIND;SQL Select Count(*) As _

      EmployeeCount From Employees;"

   Text1.LinkItem = "FirstRow"   ' Setup to get the first row of data

   Text1.LinkMode = 2            ' Establish a manual link

   Text1.LinkRequest             ' Request the data into the Text1

   Text1.LinkMode = 0            ' Terminate the link

   CntRows = Val(Text1.Text)     ' Convert the result to a number

   ' Establish a DDE Link to the Employees table

   Text1.LinkTopic = "MSACCESS|NWIND;SQL Select * From Employees;"

   Text1.LinkMode = 2            ' Establish a manual link

   ' Get the number of columns in the Employees Table

   Text1.LinkItem = "FieldCount" ' Setup to get count of fields/cols

   Text1.LinkRequest             ' Request the data into Text1

   CntCols = Val(Text1.Text)     ' Convert the result to a number

   ' Create the arrays to hold employee information and field names.

   ReDim Employees(CntRows, CntCols) As String

   ReDim FieldNames(1, CntCols) As String

   ' Get the field names in the Employees table from Access

   Text1.LinkItem = "FieldNames" ' Setup to get the field names

   Text1.LinkRequest             ' Request the data into Text1

   ' Parse the tab delimited list of field names and copy it into the

   ' .. FieldNames array. (ParseRecord subroutine is listed latter)

   ParseRecord FieldNames(), 1, (Text1.Text)

   ' Request each tab delimited record of data one at a time.

   For Row = 1 To CntRows

      If Row = 1 Then

         Text1.LinkItem = "FirstRow"  ' Setup for the first record

      Else

         Text1.LinkItem = "NextRow"   ' Setup for the next record

      End If

      Text1.LinkRequest          ' Request the data into Text1

      ' Parse the tab delimited record and store it in Employees array

      ParseRecord Employees(), Row, (Text1.Text)

   Next Row

   Text1.LinkMode = 0  ' Terminate link, arrays are filled with data

   ' OPTIONAL: The following code populates a grid control with the contents

   '           of the Employees and FieldNames arrays.

   ' Setup the Grid with the correct number of Rows and Cols

   Grid1.Rows = CntRows + 1      ' Add 1 for the row selector buttons

   Grid1.Cols = CntCols + 1      ' Add 1 for the column header buttons

   ' Fill the Grid column header with the data in the FieldNames array

   Grid.Row = 0                  ' Move to the column header row

   For Col = 1 To CntCols

      Grid.Col = Col                   ' Move to the column

      Grid.Text = FieldNames(1, Col)   ' .. and fill it with data

   Next Col

   ' Fill the Grid control rows with the data in the Employees array

   For Row = 1 To CntRows

      Grid.Row = Row                    ' Move to the row

      For Col = 1 To CntCols

        Grid.Col = Col                  ' Move to the column

        Grid.Text = Employees(Row, Col) ' Fill it with array data

      Next Col

   Next Row

End Sub

The following subroutine, ParseRecord, is used to extract the tab-

delimited data from a record and place the data in an array in the

specified row. The subroutine takes the following three arguments:

   Array()  - A two-dimensional array of strings to store data into.

   Row      - The row position in the array to store the parsed data.

   Record   - A string with tab delimited information to parse.

Create a new module in Visual Basic with the following subroutine:

Sub ParseRecord (Array() As String, ByVal Row As Integer, _

   ByVal Record As String)

   Dim Start As Integer    ' Start position of field in record

   Dim TabStop As Integer  ' Position in the record of the next tab.

   Dim CntCols As Integer  ' The number of columns in the Array

   Dim Col As Integer      ' The current column (field) being parsed

   CntCols = UBound(array, 2)   ' Get count of columns in the array

   Start = 1       ' Start parsing with first character

   ' Find the first tab stop (ASCII character 9) in the record.

   TabStop = InStr(Start, Record, Chr$(9), 0)

   ' Loop until we fill up all but the last column (Col < CntCols)

   ' .. or until there are no more columns to read (TabStop <> 0 means

   ' .. that no tab was found)

   Col = 1

   While Col < CntCols And TabStop <> 0

      ' extract the field from the string and store it in the array

      Array(Row, Col) = Mid$(Record, Start, TabStop - Start)

      Start = TabStop + 1        ' Increment start to next tab stop

      TabStop = InStr(Start, Record, Chr$(9), 0) ' Find next tab stop

      Col = Col + 1              ' Increment to next column in array

   Wend

   Array(Row, CntCols) = Mid$(Record, Start)  ' Get last col of data

End Sub

References


PRB: Importing an Informix Delimited Export File

 Article Number: Q99406

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAY-1993

Summary:

SYMPTOMS

   When you attempt to import an Informix delimited text file that

   uses the pipe symbol as a delimiter, you will receive the following

   error message:

      Name " contains invalid characters

CAUSE

   When you export in Informix as text delimited, and you specify the

   pipe symbol as the delimiter , Informix will add an extra pipe

   symbol at the end of the line. When you import this file into

   Microsoft Access, specifying 'First row contains field names',

   Microsoft Access assumes that there is another field after the last

   pipe symbol. Since this is a null value, Microsoft Access will return

   the above error.

RESOLUTION

   1. Depending on the size of the file, you can open it in a text

      editor and add a dummy name after the last pipe symbol. After

      import, you can delete this dummy field.

   2. Do not specify 'First row contains field names' when you import

      the file. After import, you can manually delete the first row of

      the table (which contains field names instead of data) and modify

      the field names in the table's design mode.

More Information:

The pipe symbol is usually located above the backslash "\" key on

your keyboard. It's location may differ depending upon your particular

keyboard.

When viewed on your keyboard, the pipe symbol appears as two dashes (-

-) rotated 90 degrees.

Steps to Reproduce Behavior:

---------------------------

1. Create a text file in notepad with the following information:

      A|B|C|

      1|2|3|

   Where there is a pipe symbol between each character such as the "A" and

   the "B".

2. Save the file as INFORMIX.TXT

3. Open a database in Microsoft Access.

4. From the File menu, choose Import.

5. Select Text (delimited) for your Data Source, and choose Import.

6. Select the INFORMIX.TXT file that you created in step #1, and

   choose OK.

7. The import options dialog box will appear. Select the 'First Row

   Contains Field Names' check box, and then choose the 'Options>>'

   button.

8. In the Field Separator combo box, enter the pipe symbol and then

   choose OK. The above error message appears.

References


INF: How to Execute Macro Actions Using DDE

 Article Number: Q99407

 CREATED: 27-MAY-1993

 MODIFIED: 07-JUN-1993

Summary:

Microsoft Access version 1.1 supports the execution of individual

macro actions over a dynamic data exchange (DDE) channel.

More Information:

The only macro actions that you can execute over a DDE channel to

Microsoft Access are those supported by the DoCmd function in Access

Basic. For this reason, the following macro actions cannot be

executed:

   AddMenu

   MsgBox

   RunApp

   RunCode

   SendKeys

   SetValue

   StopAllMacros

   StopMacro

The syntax for macro actions executed through DDE is the same as the

syntax for macro actions called by the DoCmd function, that is:

   MacroActionName Argument1,Argument2,...,ArgumentN

You can't use the predefined constants that are available inside

Access Basic, such as A_NORMAL, as arguments when you are executing

macro actions with DDE. Instead, you must use the actual values of the

constants. The values of the constants are determined by using the

following procedure:

1. Open a macro in Design view.

2. Select the macro action you want to use from the list of macro

   actions in the Action column.

3. Go to the Action Arguments section of the macro in Design view and

   locate the argument for which you need to supply a value.

4. In the list box associated with that argument, locate the option

   that you want to use.

5. Count down the list, starting at zero (0), until you reach that

   option.

The number you reach will be the number that you need to supply as the

argument when executing the macro action over a DDE channel. For

example, if you wanted to supply the third option on a list as your

argument, you would use the number "2" (see step 5 above).

The following example creates a macro in Microsoft Excel that

demonstrates how to execute macro actions in Microsoft Access.

Note: This macro will not work in Microsoft Access version 1.0.

Sample DDE Macro from Microsoft Excel to Microsoft Access

---------------------------------------------------------

1. Open Microsoft Access.(This macro only works if Microsoft Access is

   already running.)

2. Open a new macro sheet in Microsoft Excel. Enter the following

   macro:

   Cell    Command

   ---------------------------------------

   A1     MacroActionDDE

   A2

   A3    chan=INITIATE("MSACCESS","SYSTEM")

   A4    =APP.ACTIVATE("Microsoft Access",FALSE)

   A5    =EXECUTE(chan,"[opendatabase nwind.mdb]")

   A6    =EXECUTE(chan,"[beep]")

   A7    =EXECUTE(chan,"[openform categories,,,,,2]")

   A8    =EXECUTE(chan,"[beep]")

   A9    =EXECUTE(chan,"[openform categories]")

   A10   =EXECUTE(chan,"[close]")

   A11   =EXECUTE(chan,"[closedatabase]")

   A12   =TERMINATE(chan)

   A13   =APP.ACTIVATE(,FALSE)

   A14   =RETURN()

3. Before you run this macro, size your Microsoft Access and Microsoft

   Excel windows so that you can view both applications at the same time.

4. To run the macro, select cell A3, choose Run from the Macro menu,

   and then choose OK.

The commands in cells A3 and A4 initiate a DDE channel to Microsoft

Access on the SYSTEM topic and activate the Microsoft Access

application.

The command in cell A5 opens the sample database NWIND.MDB file in the

current working directory using the OpenDatabase pseudo action.

(Pseudo actions are actions that are only valid over the DDE channel.)

The commands in cells A6 and A8 execute the Microsoft Access macro

action Beep.

The command in cell A7 executes the Microsoft Access macro action

OpenForm to open the Categories form in a minimized state.

The command in cell A9 executes the Microsoft Access macro action

OpenForm to open the Categories form in a normal state.

The command in cell A10 closes the currently active object in Access.

The command in cell A11 closes the currently opened database file

using the CloseDatabase pseudo action.

The commands in cells A12:A14 terminate the DDE channel, activate the

Microsoft Excel application, and end the macro.

For more information about the DoCmd statement, search for "DoCmd,"

then "DoCmd Statement" using the Help menu.

For more information about sending macro actions to Microsoft Access,

query on the following words in the Microsoft Knowledge Base:

   access and dde and server and macro

Reference(s):

"Language Reference," version 1.0, pages 149-150

References


INF: "ORA-106xx: Message 106xx not found" bug in ORA6WIN.DLL

 Article Number: Q99408

 CREATED: 27-MAY-1993

 MODIFIED: 27-MAY-1993

Summary:

When using the Oracle ODBC driver from PageAhead, if users receive the

message:

   PageAhead][ODBC Oracle Driver][Oracle OCI]ORA-106xx: Message 106xx

   not found; product=RDMBS; facility=ORA

where xx is a value from 00 to 99), they are running into a bug with

the ORA6WIN.DLL.

More Information:

One example was when a developer created a trigger on a sample table

which raised an application error if a user inserted a row with the

value 'CID' in it. The error number the trigger raised was -20620,

which was not recognized by the ODBC error routines which returned the

following text:

"[PageAhead][ODBC Oracle Driver][Oracle OCI]ORA-10620: Message 10620

not found; product=RDMBS; facility=ORA"

When the developer tried changing the error number generated by the

trigger to -20600, the ODBC error report was for error 10600.

Oracle development  has identified this as a bug in the Oracle6 OCI

(Oracle Call Interface) code, ORA6WIN.DLL, which the PageAhead ODBC

driver uses. It has been fixed in the Oracle7 OCI, but this ODBC

driver still uses V6.

References


INF: Sending the Current Record to Word for Windows with DDE

 Article Number: Q99570

 CREATED: 02-JUN-1993

 MODIFIED: 03-JUN-1993

Summary:

This article describes the steps for creating a form that allows you

to press a button to send the current record to Microsoft Word for

Windows. The data sent is merged into a prewritten letter and printed.

The article assumes that you understand dynamic data exchange (DDE),

setting bookmarks in Word for Windows, and creating modules in

Microsoft Access.

More Information:

Note: In the sample code below, an underscore is used as a

line-continuation character. Remove the underscore when re-creating

this code in Access Basic.

Step One: Create the Word for Windows Document

----------------------------------------------

1. Start Word for Windows and open a new document.

2. Type the following:

      CompanyName

      Address

      City, Region, PostalCode

      Country

   Dear ContactName,

      NorthWind Traders would like to thank you for

      your business during the past year. Enclosed

      you will find several samples of new products

      that we are excited to announce.

   Sincerely,

   NorthWind Traders.

   Note: Word for Windows will fail when you attempt to complete the

   merge if the field names contain spaces. If you copy text into a Word

   for Windows document, be sure to remove any and all tabs.

3. Save this document as DDEMERGE.DOC.

4. To create the bookmarks, select CompanyName and choose Bookmark

   from the Insert menu. Name the Bookmark "CompanyName" (without the

   quotation marks).

5. Repeats these steps, creating bookmarks for the fields: Address,

   City, Region, PostalCode, Country, and ContactName.

Step Two: Create The Access Basic Modules

-----------------------------------------

1. Open the sample database NWIND.MDB. (One of the following modules

   uses the function STARTAPP(), which is located in the "Introduction to

   Programming" manual.

2. Create a new module called Print Merge.

3. Place the following statement in the (declarations) section:

      Dim Mergechan As Integer

4. Create a new function called Initiate_Word ().

   Function Initiate_Word ()

      Const ID_YES = 6

      Dim Chan As Variant

      Dim WordTopics As Variant

      Chan = StartApp("Winword", "System")

      On Error GoTo AlertUser:

      WordTopics = DDERequest(Chan, "Topics")

      If InStr(1, WordTopics, "DDEMERGE.DOC") = 0 Then

        DDEExecute Chan, "[FILEOPEN(""DDEMERGE.DOC"")]"

      End If

      DDETerminate Chan

      Mergechan = DDEInitiate("Winword", "DDEMERGE.DOC")

   Exit Function

   AlertUser:

      MsgBox "Access is unable to initiate a DDE _

           channel with the document DDETEST.DOC"

      Resume Next

   End Function

5. Create a new function called Send_Record().

   Function Send_Record ()

      Dim Chan As Variant

      Dim ControlName As Control

      Dim BookMarks As String

      On Error GoTo CatchBlanks

      DDEPoke Mergechan, "CompanyName",_

         Forms![Customers]![Company Name]

      DDEPoke Mergechan, "ContactName", _

         Forms![Customers]![Contact Name]

      DDEPoke Mergechan, "Address", _

         Forms![Customers]![Address]

      DDEPoke Mergechan, "City", _

         Forms![Customers]![City]

      DDEPoke Mergechan, "Region", _

         Forms![Customers]![Region]

      DDEPoke Mergechan, "PostalCode", _

         Forms![Customers]![Postal Code]

      DDEExecute Mergechan, "[FilePrint]"

      Exit Function

   CatchBlanks:

      If MsgBox("Error sending one field, it may be blank._

            Would you like to continue?", 52) = ID_YES Then

        Resume Next

      Else

        Exit Function

      End If

   End Function

   Note: Each of the DDEPoke statements should be on one line in your

   function. Remove the underscores when re-creating this code in Access

   Basic. They are split in this article for readability.

6. Create a function called Terminate_MergeChan().

   Function Terminate_MergeChan ()

      DDETerminate MergeChan

   End Function

7. Choose Compile All from the Run menu and then close and save the

   module.

Step Three: Create the Form

---------------------------

1. Open the form [Customers] in Design view.

2. Set the OnOpen property of the form to:

   Form Properties

   ---------------

      OnOpen:    =Initiate_Word()

      OnClose:   =Terminate_MergeChan()

3. Add a new button to the Customers form.

   Command Button

   --------------

      Caption:   Print Letter

      OnPush:    =Send_Record()

4. Save the form and switch to Database view. Choose the Print Letter

   button.

   The current record will be sent to Word for Windows, merged into the

   document DDEMERGE.DOC and then printed.

Reference(s):

"Introduction to Programming," Chapter 9, "Dynamic Data Exchange"

"Word for Windows Technical Reference," pages 20-25

References


INF: Ordering of Items on Graph

 Article Number: Q99934

 CREATED: 10-JUN-1993

 MODIFIED: 10-JUN-1993

Summary:

This article describes how to easily order data in a graph by changing

the RowSource property to be a query name rather than the SQL

statement that Microsoft Access generates.

More Information:

In the following steps, you will create a graph of all Northwind

Traders orders over $10,000. The graph will list this information in

descending order (largest order to smallest order).

Steps to Reproduce

------------------

1. Open the sample database Northwind Traders (NWIND.MDB).

2. Create a new query based on the Orders table.

   Query: GraphQuery

   ---------------------------------

   Field name: Ship Name

      Show: True

   Field name: Order Amount

      Sort: Descending

      Show: True

      Criteria: >10000

3. Use the Graph FormWizard to create a new form based on the

   GraphQuery that you created in step #2. Select both fields for the

   graph.

When you view this form in Form view, you notice that the orders are

not in the order that we want. Instead, they are sorted by the Ship

Name field.

4. From the View menu, choose Form Design. Select the graph.

5. From the View menu, choose Properties.

6. Change the RowSource property of the object frame:

   Object: Object Frame

   --------------------

   ControlName: Embedded0

      RowSourceType: Table/Query

      RowSource: GraphQuery

7. From the View menu, choose Form.

Now when you view this form in Form view, you will see the orders

sorted in descending order, from the largest to the smallest.

References


PRACC9306: Hidden Subform Maximized If Main Form Is Maximized

 Article Number: Q99935

 CREATED: 10-JUN-1993

 MODIFIED: 14-JUN-1993

Summary:

SYMPTOMS

In a main/subform combination where the main form is maximized and the

subform is hidden, the subform returns maximized when it is made

visible. This results in covering the entire main form.

RESOLUTION

Since the visible property is usually changed through a macro or

function, work around this problem by adding steps to the process to

restore the main form before the subform is made visible. Then,

maximize the main form. An example of this workaround is detailed

after the "Steps to Reproduce Problem" section below.

STATUS

Microsoft is researching this problem and will post new information

here in the Microsoft Knowledge Base as it becomes available.

More Information:

You can reproduce this problem by using the Orders form in the

NWIND.MDB sample database. The following steps detail the macros

necessary to reproduce this problem. The resolution to this sample

problem is listed after the steps.

Steps to Reproduce Problem

--------------------------

1. Create a macro group that contains two macros. Name one "Hidden"

   and the other "Visible."

      Macro Name         Action

      ---------------------------

      Hidden             Setvalue

      Visible            Setvalue

      Hidden Macro Actions

      --------------------

      Setvalue

         Item: Forms![orders]![orders subform].Form.Visible

         Expression: 0

      Visible Macro Actions

      ---------------------

      Setvalue

         Item: Forms![orders]![orders subform].Form.Visible

         Expression: -1

2. Close and save the macro as "Show."

3. Open the Orders form and add two command buttons.

4. Set the following properties on the command buttons:

     Command Button: Button1

        Caption: Hide

        OnPush:  Show.Hidden

     Command Button: Button2

        Caption: Show

        OnPush:  Show.Visible

5. Choose View, then choose Form to open the Orders Form in Form view.

6. Maximize the Orders form by using the Maximize button in the forms

   upper-right corner.

7. Choose the Hide button to hide the subform.

8. Choose the Show button to show the subform maximized.

The main form is no longer visible.

To workaround this problem, change the Visible macro actions as

follows:

   Visible Macro Actions

   ---------------------

   Echo

      Echo On: No

   Restore

   Setvalue

      Item: Forms![orders]![orders subform].Form.Visible

      Expression: -1

   Maximize

   Echo

      Echo On: Yes

References:

"Microsoft Access User's Guide," Chapter 22, "Using Macros with Forms"

References


PRB: Error Opening Attached Table in Shared MDB

 Article Number: Q99936

 CREATED: 10-JUN-1993

 MODIFIED: 10-JUN-1993

Summary:

SYMPTOMS

When attempting to open an attached table in a shared MDB, one of the

following error messages may occur:

      Couldn't find file 'drive:\path\filename'

      'Drive:\path\filename' isn't a valid path.

      Couldn't open file 'drive:\path\filename'

CAUSE

The path to an attached table is hard coded in the table properties.

For a shared .MDB file, this is most likely an invalid path.

RESOLUTION

To workaround this problem, the path to the attached file must be

changed so that it is valid or the data should be imported.

More Information:

To verify the path for an attached table:

1. Open the table in design view.

2. From the View menu, select Table Properties.

   The Description property contains the path to the attached table.

To correct the path to the attached table, use one of the following

methods:

1. Place the MDB and it's attached tables on a share in a dedicated

   server and be sure that all users connect to the share with the same

   drive letter, for example, 'U:'. Use that drive letter for the

   attached tables.

2. Place the MDB and it's attached tables on a share in a dedicated

   server and use the UNC naming convention for the attached tables.

   For example, \\Server\share\filename.

   To attach a database by using the UNC names, you will need to

   specify the UNC name and the database name from the Attach dialog

   where you normally specify the drive and database name. For

   example, instead of logging onto the network drive and then using

   the Attach Table command from the File menu after which entering the

   database name, you will need only enter the UNC name along with

   the database name in the Attach dialog such as:

      \\OUTLAND\PUBLIC\MYDB.MDB

3. If the MDB is placed on a non-dedicated server, for example

   in Windows for Workgroups, a separate .MDB will need to be maintained -

   one to be shared by other workstations and one for the local machine.

   Maintaining 2 separate copies is necessary because Windows for

   Workgroups will not allow a Server machine to redirect to itself:  For

   example, if the server name is SERVERNM, the SERVERNM machine cannot

   use \\SERVERNM\SHARE to access a file from it's hard drive.

References:

"Microsoft Access User's Guide," version 1.0, Chapter 4, "Importing,

Exporting, and Attaching," pages 69-72

References


INF: Filter Values to Appear in a Combo Box

 Article Number: Q99937

 CREATED: 10-JUN-1993

 MODIFIED: 10-JUN-1993

Summary:

This article describes the steps to take to filter the values which

will appear in a Combo box.

More Information:

There may be occasions when you wish to limit the values which will

appear in a Combo box. For example, you may wish to show only

suppliers whose name begins with the letter E in your Combo box.

Although Microsoft Access does not allow a filter to be applied to a

combo box, you can base your combo box on a parameter query which

filters the values using a parameterized criteria clause.

This article describes the steps to create a Combo box which displays

only those suppliers specified by the user. It uses tables from the

example database NWIND.MDB provided with Microsoft Access.

Steps:

1. Create a query to fill the combo box.

    Query:  Filtered Supplier List

    ------------------------------

    Type:  Select

    Field:  Company Name

       Table: Suppliers

       Sort:  Ascending

       Criteria: Like [My Criteria Box] & "*"

2. Create a macro to update the Combo box with new criteria

   information.

    MacroName: CB Test Macro

    ------------------------

       Action: Requery

       ControlName: My combo box

3. Create an unbound form to test your controls.

    Form: TestForm

    --------------

       Record Source: <None>

    TestForm Controls

    -----------------

    Combo Box: My combo box

       ControlSource: <None>

       RowSourceType: Table/Query

       RowSource: Filtered Supplier List

    Text Box: My Criteria Box

       After Update:  CB Test Macro

4. Open the form in Form view. Press the arrow on the combo box (do

   not enter any value in the criteria box). Notice that all

   suppliers are listed. This is because you have not yet entered a

   filtering criteria, and the query is returning all suppliers.

5. Enter a single letter into the criteria box (for example, "E"

   without the quotes).

6. Press the arrow on your combo box. Notice that only suppliers with

   names beginning with the letter E appear.

7. Switch back to the Criteria Box. Enter a new letter (for example,

   "P" without the quotes).

8. Press the arrow on your combo box again. Notice that now only

   suppliers with names beginning with the letter P appear.

Reference(s): Limit Drop Down list box DDB

References


INF: Removing alpha characters from an alpha/numeric field

 Article Number: Q99938

 CREATED: 10-JUN-1993

 MODIFIED: 10-JUN-1993

Summary:

This article describes how to create a Microsoft Access function called

RemoveAlphas() to remove alpha characters from an alphanumeric string.

All non-numeric characters will be removed.

A practical example for RemoveAlphas() is to remove the parenthesis and

dashes from a telephone number or social security field. The following

strings, "(206) 635-7050", "206-635-7050", "535-87-4529", which

contain parenthesis, spaces, and dashes, when processed by

RemoveAlphas(), will appear as "2066357050" and "535874529".

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access. For more information on Access Basic,

please refer to "Introduction to Programming" manual.

More Information:

The following instructions explain how to create the RemoveAlphas()

function and how to use it in a Microsoft Access update query to cleanup all

phone numbers from a table.

Create the following Access Basic function.

1. Choose the Module button from the Database window and choose the

   New button.

2. In the module window type "Option Explicit" underneath the line that

   reads "Option Compare Database":

3. From the Edit menu, choose New Procedure.

4. Type RemoveAlphas in the Name box, choose Function for the Type

   and choose OK.

5. Type in the following function:

      Function RemoveAlphas (AlphaNum)

         Dim Clean As String

         Dim Pos, A_Char$

         Pos = 1

         For Pos = 1 To Len(AlphaNum)

            A_Char$ = Mid(AlphaNum, Pos, 1)

            If A_Char$ >= "0" And A_Char$ <= "9" Then

              Clean$ = Clean$ + A_Char$

            End If

         Next Pos

         RemoveAlphas = Clean$

         AlphaNum = Clean$

      End Function

5. Save the module with any unique name.

Using the RemoveAlphas function to clean up data entry

------------------------------------------------------

Suppose you want to ensure that whenever someone types in a telephone

number into a field, that the field is cleaned of any parens or dashes

that the user may accidentally type.

Given a field called "phone", add the following information in the

AfterUpdate property of the phone textbox on a form:

   =RemoveAlphas([phone])

Using the RemoveAlphas function in an update query

--------------------------------------------------

Suppose you have a table with phone numbers in it where users have

accidentally type parenthesis and dashes. The following query can be

used to remove this information, leaving the phone numbers intact.

1. Create a new query and add the table containing the phone number

   field to it.

2. Place the phone number field in the first column of the query grid.

3. From the Query menu, choose Update. A new row, "Update To:" will

   now appear in the query grid below.

4. In the "Update To:" row, type the following:

      RemoveAlphas([phone])

NOTE: The name of your phone field should appear in the square

brackets above.

5. Choose Run from the Query menu.

This article describes how to use the RemoveAlphas() function with an

expression. For more information on using functions with events, query

on the following words in the Microsoft Knowledge Base:

   function and expression and event

References


INF: Communicating with Microsoft Access using NetDDE

 Article Number: Q99939

 CREATED: 10-JUN-1993

 MODIFIED: 10-JUN-1993

Summary:

This article demonstrates how to communicate with Microsoft Access on

a remote machine using NetDDE. This article assumes the reader is

well versed in communicating with DDE on a local machine and with

the capabilities of Microsoft Access as a DDE server.

For more information on Microsoft Access as a DDE server, query on the

following keywords:

   dde and server

This article assumes that you are familiar with Access Basic

and with creating Microsoft Access applications with the

programming tools provided with Microsoft Access.  For more

information on Access Basic, please refer to "Introduction

to Programming" manual.

More Information:

In order to establish a link to a remote application, a DDE share must

be created on the remote machine. A DDE share is simply a name that

represents an application name, a topic, and any permissions for that

topic. A DDE conversation can only occur with applications and topics

assigned to share names on the remote machine, and nothing more. A

utility is provided with the Windows for Workgroups Resource Kit

called "Network DDE Share Manager" that can be used to edit and create

DDE share names.

Creating a DDE share for the Employees table:

1. Run the Network DDE Share Manager and choose New from the Share

   menu.

2. Type "Northwind Employees" in the "Share Name:" box.

3. Type "MSACCESS.EXE" in the "Application Name:" box and

   "NWIND.MDB;TABLE Employees" in the "Topic Name:" box. The password

   information is optional and can be left empty.

4. Choose Save from the File menu.

Communicating with the remote Access DDE share

----------------------------------------------

Before running the following function, make sure that Access is

running on the remote machine and has the NWIND.MDB file opened.

Create the following module function in Microsoft Access on your local

machine:

Note: In the following sample code, an underscore (_) is used as a

line continuation character. Remove the underscore when re-creating

this code in Access Basic.

    Option Explicit

    Function GetRemoteEmployeeInfo()

       Dim iChan As Integer

       Dim EmpRecord As String, FieldNames As String

       iChan = DDEInitiate("\\RemoteMachineName\NDDE$", _

       "Northwind Employees")

       FieldNames = DDERequest(iChan, "FieldNames")

       MsgBox FieldNames, 0, "Employee Table Field Names"

       On Error Resume Next

       EmpRecord = DDERequest(iChan, "FirstRow")

       Do Until EmpRecord = ""

          MsgBox EmpRecord, 0, "Employee Record"

          EmpRecord = ""

          EmpRecord = DDERequest(iChan, "NextRow")

       Loop

    End Function

You will have to change the first argument of the DDEInitiate command

(RemoteMachineName) to reference the name of your remote machine.

When this function is executed from the Immediate window, a message

box will appear with a list of field names in the Employees table.

Next, a series of message boxes will appear displaying each record of

information from the table. The field information presented is

delimited by a tab character, or ASCII 9.

The DDEInitiate Statement:

Notice the unique arguments used in the DDEInitiate command to

establish the link with the remote share. The application name is the

net DDE server application NDDE$ located on the remote machine

"\\RemoteMachineName". NDDE$ is a system service application that is

run automatically by Windows for Workgroups in the background. This

application is always running and present when Workgroups is running

and cannot be terminated.

When NDDE$ receives the topic "Northwind Employees" it checks the list

of available DDE shares on the local machine. If it finds one, it will

validate any permissions on the share, prompting for a password if one

is required. Once the validation is done, NDDE$ establishes a local

DDE link with the application name and topic assigned to the share

name.

Once the link has been established, communication from the client

application proceeds in the same way as if it were communicating

another application on the local machine. NDDE$ becomes the liaison

between the two applications across the network.

For more information on NetWork DDE, see Chapter 11 "Network Dynamic

Data Exchange" in the Windows for Workgroups Resource Kit manual.

References


INF: How to Wait for a Shelled Process to Finish

 Article Number: Q99940

 CREATED: 10-JUN-1993

 MODIFIED: 10-JUN-1993

Summary:

When using the Shell() function or the RunApp macro action to run

another program or process, Microsoft Access will not wait for the

shelled process to finish before processing the next line in the macro

or function. This causes problems for macros and functions whose

subsequent actions dependent on the results of the shelled process.

The following information provides a function called WaitShell()

which, giving an application name or process to run, will start the

process and wait for it to terminate.

More Information:

The following Access function, WaitShell(), uses the GetModuleUsage

Windows API function to determine if the shelled process has

terminated. The Shell() function, if successful in starting the

process, will return a handle to the process module. If the process no

longer is running, the module handle will be invalid and

GetModuleUsage will return 0. WaitShell() simply loops until the

module no longer is valid.

Note: You may have the following GetModuleUsage Windows API function

defined in an existing Microsoft Access library. If you receive the

duplicate procedure name error, remove the declare statement from your

code.

   Option Explicit

   Declare Function GetModuleUsage% Lib "Kernel" (ByVal hModule%)

   Function WaitShell (AppName$)

      Dim hMod%

       hMod% = Shell(AppName$, 1)

       If (hMod% > 32) Then

          While (GetModuleUsage(hMod%))

             DoEvents

          Wend

       Else

          MsgBox "Unable to start " & AppName$

       End If

   End Function

To test this function, create and run the following Access macro:

   Action

   ------

   RunCode

   MsgBox

   Macro Actions

   -------------

   RunCode

      Function Name: =WaitShell("Command.com")

   MsgBox

      Message:       Done!

or run the following Access function

   Function TestWaitShell()

      x=WaitShell("Command.com")

      MsgBox "Done!"

   End Function

Both examples above will launch an instance of the DOS command prompt

and wait for the user to terminate it by typing "exit" and pressing

Enter at the command line.

Reference(s):

Microsoft Windows 3.1 "Programmer's Reference, Volume 2: Functions"

References


INF: Calculating a Credit Card Expiration Date

 Article Number: Q99941

 CREATED: 10-JUN-1993

 MODIFIED: 21-JUN-1993

Summary:

If you enter a credit card expiration date (month/year) in a date/time

field on a form, Microsoft Access assumes that the card expires on the

first day of the month. This article includes a function that

correctly calculates the expiration date as the last day of the month.

This article assumes that you are familiar with Access Basic and with

creating Microsoft Access applications with the programming tools

provided with Microsoft Access.  For more information on Access Basic,

please refer to the "Introduction to Programming" manual.

More Information:

Use the following function, ExpirationDay(), in the AfterUpdate

property of an expiration text box on your form. The function will

replace the date entered in the text box with the date computed for

the last day of the month/year.

Given a date/time field bound to a text box with the ControlName

property set to "Expiration", the AfterUpdate property should read:

   =ExpirationDay([expiration])

Create a module with the following function:

 Option Explicit

 Function ExpirationDay (dt)

   If Not IsNull(dt) Then

     dt = DateAdd("m", 1, DateAdd("d", (-1 * DatePart("d", dt)), dt))

   End If

 End Function

You can use the following derivative of the ExpirationDay() function

in calculated fields in a query:

   NOTE: In the following sample code, an underscore (_) is used as a

   line continuation character. Remove the underscore when re-creating

   this code in Access Basic.

   Function ExpirationDay (ByVal dt)

      If Not IsNull(dt) Then ExpirationDay = DateAdd("m", _

          1, DateAdd("d", (-1 * DatePart("d", dt)), dt))

   End Function

References


PRACC9306: Timeout While Waiting for DDE Response

 Article Number: Q99942

 CREATED: 10-JUN-1993

 MODIFIED: 14-JUN-1993

Summary:

SYMPTOMS

Microsoft Access generates the following message

   Timeout while waiting for DDE response

when you try to initiate a dynamic data exchange (DDE) link with

another application.

CAUSE

This error occurs when the function attempting to initiate the link is

invoked using a RunCode action in a macro and the RunCode action macro

is called from another application using DDE.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. Microsoft is researching this problem and will

post new information here in the Microsoft Knowledge Base as it

becomes available.

More Information:

Microsoft Access takes time-outs with all attempts to perform DDE to

other applications if the other application is currently conversing

with Microsoft Access as a DDE server.

Steps to Reproduce Problem

--------------------------

The following instructions demonstrate the problem by showing how to

use Word for Windows to run a Microsoft Access macro that attempts to

initiate a DDE conversation with Microsoft Excel.

1. Start Excel with the default worksheet Sheet1 and type some text in

   cell A1, or row 1, column 1.

2. Start Microsoft Access and create the following macro called "Test":

      Test Actions

      ------------

      RunCode

         Function Name: =TestDDE()

3. Create the following Access Basic function:

      Option Explicit

      Function TestDDE ()

         Dim chan

         chan = DDEInitiate("excel", "sheet1")

         MsgBox DDERequest(chan, "R1C1")

         DDETerminate chan

      End Function

4. Start Word for Windows and choose Macro from the Tools menu.

5. In the Macro Name box, type "test" (without the quotation marks),

   and press the Edit button.

6. Type the following macro in the editing window:

      Sub MAIN

         chan = DDEInitiate("msaccess", "system")

         DDEExecute chan, "test"

         DDETerminate chan

      End Sub

7. Run the macro by choosing the Start button on the macro toolbar

   or by pressing ALT+SHIFT+S.

Approximately 45 to 60 seconds later the following message is

generated by Microsoft Access:

   Timeout while waiting for DDE response

References


PRB: Strange Characters Appear When Pasting in the Query Grid

 Article Number: Q99943

 CREATED: 10-JUN-1993

 MODIFIED: 10-JUN-1993

SYMPTOMS

When using the Query Grid, an attempt to cut and paste (or to

copy and paste) an entire Criteria row places strange characters in

the cell you paste to. These may or may not disappear when you move

off of the cell.

RESOLUTION

Before you paste information from the clipboard, select an object

that has the same size as the information in the clipboard. In this

example, select an entire row when you paste the information

into the Criteria section of the QBE grid.

STATUS

This behavior is by design.

More Information:

Perform the following four steps to demonstrate this behavior.

Steps to Reproduce Behavior

---------------------------

1. Open the Employee Sales by Country [Parameter] query in the sample

   database Northwind in design view.

2. Select the entire Criteria row in the QBE Grid (click the mouse once

   at the left side of the row when the mouse cursor changes to a solid

   right arrow).

3. From the Edit menu, choose either Cut or Copy.

4. Select a cell (to paste the copied row into) and choose Paste

   from the Edit menu.

The pasted value shows characters that may appear as rectangles at the

end of the cell.

This behavior occurs pasting into any object in Microsoft Access. When

you cut or copy the row to the clipboard it is transferred as tab

separated data. When you paste an entire row into a single cell, you are

seeing the tabs.

For more information on pasting information in the query grid in

Microsoft Access, search the Knowledge Base for

   queries and paste

References


PRACC9211: Can't Export Paradox/dBASE Tables

 Article Number: Q99944

 CREATED: 10-JUN-1993

 MODIFIED: 14-JUN-1993

Summary:

SYMPTOMS

In Microsoft Access version 1.0, you cannot export a Paradox or dBASE

table over the top of an existing corrupted Paradox or dBASE database

file. If you try to do so, you receive the following error message:

   <path\filename> This file already exists.

   Replace existing file?.

If you choose the Yes button, you receive the following error message:

   Table '<tablename>' already exists.

This error occurs with both dBASE and Paradox formats. Other database

exports correctly allow you to overwrite existing database files.

CAUSE

Microsoft Access tries to open the file to verify its contents instead

of simply overwriting it.

STATUS

This is by design.

More Information:

Steps to Reproduce the Problem

------------------------------

1. Copy your CONFIG.SYS file to CONFIG.DB. (This will simulate a

   corrupted Paradox database.)

2. In Microsoft Access, choose Export from the File menu, select

   Paradox 3.X and any table.

3. Specify CONFIG.DB as the output file and choose OK.

4. Choose Yes to the "Replace existing file?" message.

You receive the error message "Table 'CONFIG#DB already exists."

References


PRACC9210: Null Boolean Values Default to False

 Article Number: Q99945

 CREATED: 10-JUN-1993

 MODIFIED: 14-JUN-1993

Summary:

SYMPTOMS

Null values appearing in a boolean field always default to false in

tables, forms, and reports.

CAUSE

Null values are not supported in boolean fields. When a null value is

inadvertently placed in a boolean field (by a query, for example), the

null value is ignored. By default, "false" incorrectly appears in the

field.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access

versions 1.0 and 1.1. We are researching this problem and will post

new information here as it becomes available.

More Information:

Steps to Reproduce the Problem

------------------------------

 1. Start Microsoft Access and create a new table called Table1. (No

    primary key required.)

 2. In Design view, create a field in Table1 named Test with the data

    type Text.

 3. Create another table and name it Table2. In Design view, create

    two fields:

        Name:   DataType:

       -------------------

         Test     Text

         Bool    Yes/No

 4. Enter the following data into Table1:

        Test

       ------

         A

         B

         C

 5. Enter the following data into Table2:

        Test      Bool

       ----------------

         A        Yes

         B        No

 6. Create a Make Table query using Table1 and Table2. Give the new

    table a name, such as "Bogus."

 7. Create a join between Table1 and Table2 by dragging the

    Test field from Table1 and dropping it onto Table2.

 8. Edit the Join Properties by double-clicking the join line or by

    selecting View/Join Properties from the menu. Select relationship #2.

    This includes all records from Table1 and only those records from

    Table2 where the joined fields are equal.

 9. Drag the Test field from Table1 and the Bool field from Table2 and

    drop them onto the query grid.

10. Execute the Make Table query by selecting Run from the Query menu

    or by clicking the exclamation point button on the toolbar.

A popup dialog box states, "3 row(s) will be copied into new table."

Open the table "Bogus" and notice its contents. It should have:

     Test        Bool

       A          -1

       B           0

       C           0

Notice that a value of zero (0) has incorrectly been placed for the

value of Bool for Test value C (0 = No, -1 = Yes). Change the Bool

field's format in Design view to view the values as True/False,

Yes/No, and so forth.

References