This is because in order for the valueof either found or correct to get changed, then the all emcompassing statement
If cashpointscreen.Text = objDR.GetString(4) And accountID.Text = objDR.GetString(0) Then
must be true.
What you should be doing is breaking that up to something somewhat simpiler like this:
found = false
correct = false
If cashpointscreen.Text = objDR.GetString(4)
found = true
end if
if accountID.Text = objDR.GetString(0) Then
correct = true
end if
if found and correct then 'pin and accountID are right
Screen.Enabled = True
Screen.Visible = True
elseif found then 'pin must be correct, acountID is wrong
aID = "Error reading card"
MessageBox.Show(aID)
elseif correct then 'accountID is correct, pin is wrong
temp = "You have entered your pin incorrectly " & pinTries & " times"
MessageBox.Show(temp)
cashpointscreen.Clear()
else 'pin and acountid is wrong
temp= "You enetered nothing correctlly!"
end if
This assumes that I that 'found' indicates that the pin if valid, and 'correct' indicates the accountID is valid
Enter your message below
Sign in or Join us (it's free).