Kamis, 10 Oktober 2024

Re: [MSAccessProfessionals] Invalid Procedure Call error

hi Jim,

What are you trying to do ? ... just decease size by 554 -- or would you rather set the size to a particular number?

... maybe this? Where MAXNUMBER is the max characters you want to show

MemoWithDate: iif( Len( tblMaxCompensatoryMemo.Paragraph2 & "") > MAXNUMBER,
Left( tblMaxCompensatoryMemo.Paragraph2 & "", MAXNUMBER), tblMaxCompensatoryMemo.Paragraph2)

reason "" is concatenated to field to test is that LEN returns Null if Paragraph2 doesn't have a value.

"" also appended to True part because IIF evaluates both True and False so they both have to work, and LEFT also only works with strings, not Null. Appending "" turns a Null into a zero-length string so LEN and LEFT can both work

What is the reason for 554?

kind regards,
crystal


On 10/10/2024 11:23 AM, Duane Hookom wrote:
I believe if you have less than 554 characters the Left() function will attempt to return 242-554. This should generate an error. For instance,
? Left("This is a test of len and left",-3)�

generates the error message:

Run-time Error '5';
Invalid Procedure Call or Argument

Duane


From:�MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Jim Wagner <josephwagner2@outlook.com>
Sent:�Thursday, October 10, 2024 10:52 AM
To:�MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject:�Re: [MSAccessProfessionals] Invalid Procedure Call error
�
Duane,
242 characters with spaces

Jim Wagner

From:�MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Jim Wagner <josephwagner2@outlook.com>
Sent:�Thursday, October 10, 2024 8:50 AM
To:�MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject:�Re: [MSAccessProfessionals] Invalid Procedure Call error
�
Thank You Duane. I will look

Jim Wagner

From:�MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Duane Hookom <duanehookom@hotmail.com>
Sent:�Thursday, October 10, 2024 7:26 AM
To:�MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject:�Re: [MSAccessProfessionals] Invalid Procedure Call error
�
I would first look at the number of characters in Paragraph2 to make�sure it's more than 554 characters.

Duane

From:�MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io> on behalf of Jim Wagner <josephwagner2@outlook.com>
Sent:�Thursday, October 10, 2024 8:40 AM
To:�MSAccessProfessionals@groups.io <MSAccessProfessionals@groups.io>
Subject:�[MSAccessProfessionals] Invalid Procedure Call error
�
Hello All,
�
Yesterday I started to get an error message for "Invalid Procedure call" when I tried to open a report. This report has been running for years with no issues. This morning after several hours, I deleted from the query this line�
�
MemoWithDate: Left([tblMaxCompensatoryMemo].[Paragraph2],Len([tblMaxCompensatoryMemo].[Paragraph2])-554)�
�
and the query ran successfully with no issues. So, I am assuming that either an office update or something is haywire with the database has recently occurred. I have checked vba references and there are no missing references.�
�
I am not sure where to go from here. Can someone help me find a solution. My user is to the point of extreme frustration with me.�
�
Thank You
�
Jim Wagner

Tidak ada komentar:

Posting Komentar