UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Runtime Error 5 - I Can't Find The Problem, Office 2010    
 
   
bfras914
post Feb 23 2012, 12:42 PM
Post #1

New Member
Posts: 17
From: Connecticut



I'm getting a "Runtime Error 5 - Invalid procedure call or argument" error on what looks like a very simple line of code. I've been staring at it for hours, and I can't see any reason this should be causing an error. Below is a snippet of my code. When I debug, the error is occurring at the If...Then line.

For Y = 1 To X - 1
If strVend(Y) = strVend(X) Then
intVendMatch = intVendMatch + 1
End If
Next Y

At the point that the error occurs, the variable values are:
Y (Integer) = 1
X (Integer) = 2
strVend(1) (String) = "27539"
strVend(2) (String) = "27539"

I can't see any reason for an error message here. The If...Then statement should just compare the 2 values, see that they are equal, and move on. I've tried everything I can think of here. The problem may very well lie outside my project, but I'm a loss... Any advice would be greatly appreciated!

I'm running Office 2010 on Windows XP, by the way.
Go to the top of the page
 
+

Posts in this topic


Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 02:14 PM