Problem with restricting columns in mshflexgrid vb6

trying to restrict .col  1 or 3 to not have the textbox.
even if col is 1 it still allows the textbox
.Col = 1
With gridMaster
If .Col <> 1 Or .Col <> 3 Then' this should restrict col1 and 3,but it does not
                         txtEdit.ZOrder 0
                        txtEdit.BackColor = RGB(224, 224, 224)
                        txtEdit.Move .Left + .CellLeft - 20, .Top + .CellTop - 10, .CellWidth, .CellHeight - 5
            txtEdit.Visible = True
            txtEdit = .TextMatrix(.row, .Col)
End If

End With

Open in new window

what is wrong ?
isnoend2001Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
I find "Not" logic confusing so I always try to avoid it and so I would change the above to
With gridMaster
If .Col = 1 Or .Col = 3 Then
    ' Do nothing
Else
                         txtEdit.ZOrder 0
                        txtEdit.BackColor = RGB(224, 224, 224)
                        txtEdit.Move .Left + .CellLeft - 20, .Top + .CellTop - 10, .CellWidth, .CellHeight - 5
            txtEdit.Visible = True
            txtEdit = .TextMatrix(.row, .Col)
End If

End With

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
isnoend2001Author Commented:
Thanks
used <> in the past and it worked as expected, but not this time. your fix works
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.