Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2005, 07:34 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: , , United Kingdom.
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASC function Error

Hi,

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?

Jon

Reply With Quote
  #2 (permalink)  
Old May 19th, 2005, 09:57 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

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
Reply With Quote
  #3 (permalink)  
Old May 21st, 2005, 06:06 AM
Authorized User
 
Join Date: Feb 2005
Location: , , .
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

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



Reply With Quote
  #4 (permalink)  
Old May 22nd, 2005, 01:36 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: , , Finland.
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Error is the L variable. It gets value somewhere.
Example:

strText="Some text"
L=15
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

-vemaju

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:01 AM.


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