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

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Bogus Error Message    
 
   
strBean
post Oct 21 2014, 04:50 PM
Post#1


UtterAccess VIP
Posts: 4,892
Joined: 25-September 02
From: Washington State


Hi Folks
Attached File  Untitled.png ( 8.84K )Number of downloads: 0

CODE
Set fc = f.Files
For Each fl in fc
   If Left(fl.Name, 10) = "ReportMenu" And Right(fl.Name, 3) = "mdb" Then
      strFileName = "ReportMenuOmaK" & Right(fl.Name, Len(fl.Name)-14)
      strSourceFilePath = fl.Path
      strVersion = Left(fl.Name, Len(fl.Name)-4)
      strVersion = Right(strVersion, Len(strVersion)-14)  'This is the offending line.  Note that the script has already processed a call to the same function, 4 lines above...
   End If
Next

When I get bogus error messages like this in an Access project, the first thing I check is for broken references, and then I start looking at the possibility of corruption. Either fixing a broken reference or decompiling the project usually gets me back on track.
This is a script file. Can it be corrupt? Seems unlikely. Should I post the whole code?
Go to the top of the page
 
WildBird
post Oct 21 2014, 05:33 PM
Post#2


UtterAccess VIP
Posts: 3,278
Joined: 19-August 03
From: Perth, Australia


Mmm, yeah, usually references missing, but it has used Right earlier.
Have you tried removing the line, compiling it, and then putting the line back in? Sounds like something screwy is happening alright. Never heard a script go bad, but who knows?
Go to the top of the page
 
RJD
post Oct 21 2014, 05:37 PM
Post#3


UtterAccess VIP
Posts: 7,840
Joined: 25-October 10
From: Gulf South USA


Hi Sam: This is just a guess since I don't know what is contained in fl.Name, but since you have chopped off 4 characters in ...
strVersion = Left(fl.Name, Len(fl.Name)-4)
... and then used that shortened name in the next line ...
strVersion = Right(strVersion, Len(strVersion)-14)
...is it possible that ...
Len(strVersion)-14
... is now negative?
I guessed that since you used the -14 above there before you chopped off the 4 characters and used the -14 again afterwards.
As I said, just a complete guess - but easy to check and eliminate. And the negative will throw an error.
HTH
Joe
Go to the top of the page
 
strBean
post Oct 21 2014, 05:48 PM
Post#4


UtterAccess VIP
Posts: 4,892
Joined: 25-September 02
From: Washington State


Thanks, Joe. Somehow I totally overlooked "or argument" in "Invalid procedure call or argument". It's been one of those days.
Go to the top of the page
 
WildBird
post Oct 21 2014, 06:28 PM
Post#5


UtterAccess VIP
Posts: 3,278
Joined: 19-August 03
From: Perth, Australia


Well its good to know I am not the only one who one those sort of days! :-)
Well picked up by the way, Joe.
Go to the top of the page
 
RJD
post Oct 21 2014, 07:04 PM
Post#6


UtterAccess VIP
Posts: 7,840
Joined: 25-October 10
From: Gulf South USA


You are most welcome, Sam. Glad that was the issue and not something more.
And thanks for the nice comment, WildBird.
Regards to you both,
Joe
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    16th December 2017 - 11:28 PM