Microsoft KB Archive/209128

= ACC2000: Compile Error Occurs Using Derived Math Functions in Help =

Article ID: 209128

Article Last Modified on 6/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q209128



Novice: Requires knowledge of the user interface on single-user computers.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
In the Microsoft Visual Basic 2000 Help topic Derived Math Functions, a compile error occurs when you copy and paste some of the functions containing a minus sign (-) into a module.



CAUSE
Help uses ASCII character 0150 for the minus sign instead of the correct ASCII character, 0045.



RESOLUTION
After you paste a code example into a module, use the keyboard to manually retype all of the minus signs.



Steps to Reproduce Behavior
 Start Microsoft Access and open any database. In the Database window, click Modules under Objects, and then click New.  Type the following procedure: Function TestMinus Dim X As Integer X = 5 ' Insert formula on next line

End Function  Search the Visual Basic Help Index for "derived math functions." Locate the Inverse Hyperbolic Cosine function in the Function column, and then select everything to the right of the equal sign (=) in the formula in the Derived equivalents column.</li> Press CTRL+C to copy the selected text.</li>  In the module window, type the following in the blank line under the comment Insert formula on next line: X = </li>  After the equal sign (=), paste the rest of the formula that you copied from Visual Basic Help. The line should now appear as follows: X = Log(X + Sqr(X * X - 1)) </li> Microsoft Access tests each line of code as soon as you move the cursor to a new line. Click the first line of the function, and then notice that you receive the following error message:

Compile error:

Expected: line separator or )

</li>  Retype the minus sign in the following expression X = Log(X + Sqr(X * X - 1)) and then click the first line of the function. Note that the compile error does not occur. </li></ol>

Additional query words: prb

Keywords: kbprb kbusage KB209128

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.