Shibbyman
Chieftain
hello, I'm just starting to use VB08 and I've run into a confusing error. I tried to run some code in the form:
if strName = "Bob" Or "Robert" then
inCounter = intCounter + 1
End if
(i.e. using a check for the contents of the string "strName" as a parameter for the loop)
But it keeps giving me the error "Error Option Strict On disallows implicit conversions from 'String' to 'Boolean'."
As you can see I have Option Strict and Option Explicit On so I'm pretty sure it isn't a problem of not declaring something.
My form load contains the following:
Option Strict On
Option Explicit On
Public Class Form1
Dim intCounter As Integer
Dim strName As String
Dim boolFlag As Boolean
Any help would be much appreciated. Thanks in advance.
if strName = "Bob" Or "Robert" then
inCounter = intCounter + 1
End if
(i.e. using a check for the contents of the string "strName" as a parameter for the loop)
But it keeps giving me the error "Error Option Strict On disallows implicit conversions from 'String' to 'Boolean'."
As you can see I have Option Strict and Option Explicit On so I'm pretty sure it isn't a problem of not declaring something.
My form load contains the following:
Option Strict On
Option Explicit On
Public Class Form1
Dim intCounter As Integer
Dim strName As String
Dim boolFlag As Boolean
Any help would be much appreciated. Thanks in advance.