Invalid procedure call (1 Viewer)

diversoln

Registered User.
Local time
Today, 21:47
Joined
Oct 8, 2001
Messages
119
I have a text format operation that works fine on my home PC but not on the PC at the install site. I thought maybe it was a library issue but all the functions are in the library.

I changed the following which works:

SHORTPAT: UCase(Left([PATIENT],10))

to

SHORTPAT: UCase(Left(Left([PATIENT],InStr([PATIENT],',')-1),10))


which results in the Invalid procedure call error

Since the InStr seems to be in the library of functions I'm stumped ...

Thanks for any help you can offer.
 

pdx_man

Just trying to help
Local time
Today, 13:47
Joined
Jan 23, 2001
Messages
1,347
You have another unrelated library missing on the work computer. In any module, go up to Tools ... References ... to see the MISSING item. Do a search in these forums for Missing Reference.
 

diversoln

Registered User.
Local time
Today, 21:47
Joined
Oct 8, 2001
Messages
119
I dont see references under the tools menu .....
 

pdx_man

Just trying to help
Local time
Today, 13:47
Joined
Jan 23, 2001
Messages
1,347
In any module ...

You must be in a code module. Select Modules from your object list and then New. Then go to Tools ... References.
 

DALeffler

Registered Perpetrator
Local time
Today, 14:47
Joined
Dec 5, 2000
Messages
263
Try this:

SHORTPAT: IIf(InStr([PATIENT],',')>0,UCase(Left(Left([PATIENT],InStr([PATIENT],',')-1),10)),UCase(Left([PATIENT],10)))

In Acc97, if you put, "SHORTPAT: UCase(Left(Left([PATIENT],InStr([PATIENT],',')-1),10))" into the Field row of the query design grid and [PATIENT] doesn't have a "," (comma) in that field, the field will display "#Error".

If (in Acc97) you try to use something like:

Me.txtPatient = UCase(Left(Left([PATIENT],InStr([PATIENT],',')-1),10))

in a code module, you'll get the "Invalid procedure call or argument" error if [PATIENT] does not have a "," somewhere in the field because the Left function can't take -1 characters.

hth,
 

Users who are viewing this thread

Top Bottom