Solved

IF statement not working Visual Studio

Posted on 2011-09-18
1
255 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
a_hassaan earned 500 total points
ID: 36555998
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

622 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