FIX: "Function call on Left-hand side of assignment..." Error
Article ID: 150230
Article Last Modified on 7/13/2004
APPLIES TO
- Microsoft Visual Basic 4.0 Standard Edition
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 4.0 Professional Edition
- Microsoft Visual Basic 4.0 16-bit Enterprise Edition
- Microsoft Visual Basic 4.0 32-Bit Enterprise Edition
This article was previously published under Q150230
SYMPTOMS
When a Read-Only property of a Text box is set in code, trying to run a
project brings up the following error message:
"Function call on left-hand side of assignment must return Variant or
Object"
The environment shows a line of code that does not involve a property where
an object or variant is necessary.
CAUSE
The problem with the code has nothing to do with the return value of a
function. Although the error message is misleading and incorrect, it is an
error to try and set a Read-Only property.
RESOLUTION
Do not attempt to set a Read-Only property in code (by definition).
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been fixed in Visual Basic
5.0.
Additional query words: kbVBp400bug kbVBp500fix kbVBp kbdsd kbDSupport
Keywords: kbbug kbfix KB150230