Run-time error '5': Invalid procedure call or argument

T

Terri

Hi - I've done a lot of searching on this error, and realize that it comes up
when your VBA code returns a wrong outcome. But what if the same code works
on one computer and not another?

I'm experiencing this with one of my databases. This error pops up in
certain places for some people, but not others who are sharing the same db.

I've checked versions of Access (2003 SP3)- same version, same service pack
updates. I've checked VBA's Library References - same references, same
version of VBA (6.5) I'm mystified!

The code is very simple, also. it looks for a text-style number in the
Status field, then fills in the StatusTxt box accordingly:

Private Sub Form_Current()
Dim strStatusCd As String
strStatusCd = Me![Status]

If strStatusCd = "01" Then
Me![StatusTxt].ForeColor = QBColor(4) 'Red
Me![StatusTxt] = "No Doc Letter-Subject Deceased"
End If
If strStatusCd = "02" Then
Me![StatusTxt].ForeColor = QBColor(1) 'Blue
Me![StatusTxt] = "VM Subject; Holding"
End If
If strStatusCd = "03" Then
Me![StatusTxt].ForeColor = QBColor(1) 'Blue
Me![StatusTxt] = "Unknown Institution; Checking"
End If
End Sub

Again, this works fine for me - but not for a couple of my users. I've also
checked to see if it's something to do with user rights - I've logged in on
their computers and logged into the db with my name, and the error pops up.

Any ideas?
 
K

Klatuu

Have you run the code in debug mode so you can see where the Sub fails?

My guess is it will fail on the call to QBColor()
But, if your references are all the same and the same version of VBA is
installed, and all are SP3, there are only a couple of things.
There was about 1 1/2 or 2 years ago a Hot Fix for SP3. You might see if
those computers have applied it or not, and no, I don't know how to tell. I
would do some searching on MS sites for Office 2003 Service Pack 3 and see
what you find.

The other thing is you say they are "sharing" this mdb. Does that mean it
is installed on a server and multiple users are using the same copy? If so,
you really need to change that. Multiple users sharing the same copy of an
mdb front end is the fastest way to get a corrupted database. But since only
2 users are having the problem, that is not likely the case.

So, if you have a copy on each users computer, replace the mdb with a known
working copy.

I did forget to ask if this is a split database or not.
 
L

Linq Adams via AccessMonster.com

Dave's suggestion on splitting the database is spot on, of course, and should
be done even if it isn't the cause of the current problem.

Here's a link to the Hotfix he mentioned, which would also be my guess as to
the culprit here:

http://support.microsoft.com/kb/945674
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top