tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,759
- Office Version
-
- 365
- 2019
- Platform
-
- Windows
Can someone tell me why the code below fails, with a Run-time error, type mismatch?
I changed the type for Interest from Long to String and it worked, so I suspect it doens't like to mix String with Long but elsewhere (not shown here) I "mixed" types and it seemed fine.
ClsMetrics:
Normal module:
EDIT: Sorted
It doesn't like vbullstring so have to put 0
I changed the type for Interest from Long to String and it worked, so I suspect it doens't like to mix String with Long but elsewhere (not shown here) I "mixed" types and it seemed fine.
ClsMetrics:
Code:
Private pInterest As Long
Public Property Get Interest() As Long
Interest = pInterest
End Property
Public Property Let Interest(ByVal Interes As Long)
pInterest = Interes
End Property
Public Property Get Typ() As String
If Interest = vbNullString Then
Typ = "Accepted"
Else
Typ = "Failed"
End If
End Property
Normal module:
Code:
Dim abc As New ClsMetrics
Dim b
b = abc.Typ
EDIT: Sorted
It doesn't like vbullstring so have to put 0
Last edited: