Run time Error 13 Type Mismatch

  • Thread starter Thread starter Steve S
  • Start date Start date
S

Steve S

I am getting the following error:
Run time Error 13
Type Mismatch
When I use this function in a query.
=fcnGetGlobal("intI")

Public Function fcnGetGlobal(varVariable As Variant) As Integer
fcnGetGlobal = "" & varVariable & ""
End Function

The debugger shows :

VarVariable =â€intI†and fcnGetGlobal = 0

I have also tried: fcnGetGlobal = varVariable
And fcnGetGlobal = " & varVariable & "

Nothing seems to work, I always get the same error. HELP PLEASE
 
You've declared fcnGetGlobal as an Integer. You can't have it return a
string!
 
Back
Top