p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access (http://p2p.wrox.com/forumdisplay.php?f=18)
-   -   ASC function Error (http://p2p.wrox.com/showthread.php?t=29507)

JpJoe May 19th, 2005 07:34 AM

ASC function Error

I hope you guys can help us. We have a routine that uses an ASC function call. The Routine using this produces 'invalid procedure call' error on certain unknown characters e.g.

    cLetter = Mid(strText, L, 1)
    cLetterASC = Asc(cLetter) <Error raised here

    debugging the cLetter variable we see the value as Nothing, null or Empty (Its not though!).

I suspect that the character is not ASC compatible. Does anyone know how to disregard Non ASC characters?


om_prakash May 19th, 2005 09:57 AM

What is the error u get?

Before assigning value to cLetterASC, you can add a condition to check if the value of cLetter is not blank.

Om Prakash

akb786 May 21st, 2005 06:06 AM


The error is:

Unexpected Error Message

Error 5 Occured
Invalid proedure call or argument

cLetter value:
cLetterASC Value:77

and the same for Value:67 and Value:79

vemaju May 22nd, 2005 01:36 AM

Error is the L variable. It gets value somewhere.

strText="Some text"
cLetter = Mid(strText, L, 1) 'cLetter is empty
cLetterASC=Asc('empty') '=Error

Just like Om says you must check cLetter value before assigning value to cLetterASC


All times are GMT -4. The time now is 05:15 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.