Run time Error 13 Type Mismatch

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
 
D

Douglas J. Steele

You've declared fcnGetGlobal as an Integer. You can't have it return a
string!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top