Prevent #Error in query

james_halliwell

Registered User.
Local time
Today, 15:46
Joined
Feb 13, 2009
Messages
211
Hi All,

please can someone help me out with a problem,

In a query i extract part of a barcode which i convert into dates, the barcode looks like +$$1202ZABCDE
i extract 1202 and change it to YYMM but sometimes i get a letter in there example +$$A202ZABCDE (Could be any letter) which the i get #error

is there a check i can do to see if after the first 3 charaters the next four are just numbers or easiler stop access saying #error as the queirs dont work

cheers
 
How about..
Code:
[URL="http://www.techonthenet.com/access/functions/advanced/iif.php"]IIF[/URL]([URL="http://www.techonthenet.com/access/functions/advanced/isnumeric.php"]IsNumeric[/URL]([URL="http://www.techonthenet.com/access/functions/string/mid.php"]Mid[/URL]("+$$A202ZABCDE", 4, 4)), Mid("+$$A202ZABCDE", 4, 4), "")
 
helped me 2 time in as many days!!! cheers pr2-eugin

Ha ha it wont let me add to your rep (Says i need to spread the love before rep'ing you again) but thsnked for your advise worked great!!
 
Glad to hear that mate. It's the thought that matters :) Good Luck..
 

Users who are viewing this thread

Back
Top Bottom