Type mismatch

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Type mismatch

Post by bknight »

In another thread I have been learning GetRows. Now my code produces a type mismatch on the following code step.

Code: Select all

ElseIf (recData(7, I) = "Entry" And recData(7, I + 1)) = "Exit" Then
In this example both are true why the mismatch?

User avatar
HansV
Administrator
Posts: 78518
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Type mismatch

Post by HansV »

Wrong placement of parenthesis.

Code: Select all

ElseIf (recData(7, I) = "Entry" And recData(7, I + 1) = "Exit") Then
or even

Code: Select all

ElseIf recData(7, I) = "Entry" And recData(7, I + 1) = "Exit" Then
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Re: Type mismatch

Post by bknight »

Thanks I just wanted to make sure both of the conditions were included in the elseif