Solved

IF statement not working Visual Studio

Posted on 2011-09-18
1
245 Views
Last Modified: 2012-05-12
Hi Expert

I am trying to use IF        then               End if
the following code is not working
       If grid3.Rows(intcount).Cells.Item("a3").Value = "'" & TextBox3.Text & "'" THEN
        MSGBOX("OK")
       END IF
I have looked at the value return
        grid3.Rows(intcount).Cells.Item("a3").Value
returns          ABSS
AND
           "'" & TextBox3.Text & "'"
RETURNS           ''ABSS'

Values are different


PLEASE HELP
THANKS
0
Comment
Question by:b001
1 Comment
 
LVL 3

Accepted Solution

by:
a_hassaan earned 500 total points
Comment Utility
no need to concatenate "'" with the text property of a text box, as this already returns a string

your code should look like this:

If grid3.Rows(intcount).Cells.Item("a3").Value = TextBox3.Text THEN
        MSGBOX("OK")
END IF
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now