I am writing some code in VBA but i keep on getting a type mismatch (run time error 13)
I am sure it is to do with a reserved word(and not a typical mismatch
The word "CLng" is giving me problems. I do not know what it does but the other half of the code workes as values are passed to it
the code line is
call frmcont (CLng(LstName.value))
frmcount = a form
LstName = A list box
Value = ? (ain't got a clue)
Please could someone help i am selecting a text(string) instead of an integer (as this works with integers) in the list box but it comes up with a run time error 13 : type mismatch.
Full code is below.
Private Sub CmdEdit_Click()
If IsNull(LstComp) Then
MsgBox ("Please select a client to - view/edit company")
Else
Call frmcomp(CLngg(LstComp.Value))
End If
End Sub
I am sure it is to do with a reserved word(and not a typical mismatch
The word "CLng" is giving me problems. I do not know what it does but the other half of the code workes as values are passed to it
the code line is
call frmcont (CLng(LstName.value))
frmcount = a form
LstName = A list box
Value = ? (ain't got a clue)
Please could someone help i am selecting a text(string) instead of an integer (as this works with integers) in the list box but it comes up with a run time error 13 : type mismatch.
Full code is below.
Private Sub CmdEdit_Click()
If IsNull(LstComp) Then
MsgBox ("Please select a client to - view/edit company")
Else
Call frmcomp(CLngg(LstComp.Value))
End If
End Sub