Marcel2586
Registered User.
- Local time
- Today, 07:57
- Joined
- Mar 1, 2012
- Messages
- 41
I have a problem with my dlookup statement. When i run it separately there are no errors and I get my results but when I combine them together with AND I get error runtime error ‘13’: Type mismatch.
All tables are text.
This is the code that works
This gives the error
Thanks in advance
All tables are text.
This is the code that works
Code:
DestTAT = DLookup "[TAT]", "tbl Dest TAT", "[MAT]= '" & MatStr & "'"
Code:
DestTAT = DLookup "[TAT]", "tbl Dest TAT", "[Destination]= '" & Znumber1Str & "'"
This gives the error
Code:
Public Function DestTAT(MatStr As String, Znumber1Str As String) As Variant
DestTAT = DLookup("[TAT]", "tbl Dest TAT", _
"[MAT]= '" & MatStr & "'" And "[Destination]= '" & Znumber1Str & "'")
End Function
Thanks in advance