leishtheman
New Member
- Joined
- Oct 1, 2007
- Messages
- 32
Hello
I've been trying to call a function and keep encountering a 'ByRef argument type mismatch' error.
I can't see anything wrong with my code, and the only way I can get round it is by ensuring 'input' and 'output' variables (doubt if these are even real terms) are declared on separate lines. I wasn't declaring multiple variables on a single line caused any issues...does it?
A simplified example of the problem is as below:
Example 1 (doesn't work):
_______________________________________________
Option Compare Database
Option Explicit
Sub tttttttttt()
Dim a, b, c, d, e, y As String
a = "r"
b = "r"
c = "r"
d = "r"
e = "r"
y = WhereBuilder(a, b, c, d, e)
End Sub
Function WhereBuilder(a, b, c, d, e As String)
End Function
__________________________________________________
Example 2 (works fine):
__________________________________________________
Option Compare Database
Option Explicit
Sub tttttttttt()
Dim a, b, c, d, e As String
Dim y As String
a = "r"
b = "r"
c = "r"
d = "r"
e = "r"
y = WhereBuilder(a, b, c, d, e)
End Sub
Function WhereBuilder(a, b, c, d, e As String)
End Function
Many thanks in advance,
Andy.
I've been trying to call a function and keep encountering a 'ByRef argument type mismatch' error.
I can't see anything wrong with my code, and the only way I can get round it is by ensuring 'input' and 'output' variables (doubt if these are even real terms) are declared on separate lines. I wasn't declaring multiple variables on a single line caused any issues...does it?
A simplified example of the problem is as below:
Example 1 (doesn't work):
_______________________________________________
Option Compare Database
Option Explicit
Sub tttttttttt()
Dim a, b, c, d, e, y As String
a = "r"
b = "r"
c = "r"
d = "r"
e = "r"
y = WhereBuilder(a, b, c, d, e)
End Sub
Function WhereBuilder(a, b, c, d, e As String)
End Function
__________________________________________________
Example 2 (works fine):
__________________________________________________
Option Compare Database
Option Explicit
Sub tttttttttt()
Dim a, b, c, d, e As String
Dim y As String
a = "r"
b = "r"
c = "r"
d = "r"
e = "r"
y = WhereBuilder(a, b, c, d, e)
End Sub
Function WhereBuilder(a, b, c, d, e As String)
End Function
Many thanks in advance,
Andy.