Wrox Programmer Forums
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 19th, 2005, 07:34 AM
Friend of Wrox
Join Date: Jan 2005
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?


Old May 19th, 2005, 09:57 AM
Friend of Wrox
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts

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
Old May 21st, 2005, 06:06 AM
Authorized User
Join Date: Feb 2005
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts


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

Old May 22nd, 2005, 01:36 AM
Friend of Wrox
Join Date: Oct 2003
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using the Asc function langsha BOOK: Access 2003 VBA Programmer's Reference 3 November 25th, 2008 12:13 PM
Get charactor from Asc value hiruni Beginning VB 6 2 February 7th, 2006 10:51 PM
Undefined Function Error arimakidd Beginning PHP 2 November 10th, 2005 02:54 AM
ORDER BY id ASC gilgalbiblewheel Classic ASP Databases 1 January 5th, 2005 12:20 AM
How to put Desc/Asc triangle symbol on List View? hplim18 VB How-To 1 May 10th, 2004 12:17 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.