Solved

IF statement not working Visual Studio

Posted on 2011-09-18
1
253 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get the selected ValueMember of Combobox 5 40
Help with adding DLL file in Windows project 20 40
"Emulate" TAB key when press Enter Key 3 49
Iteration Help (Asp.net VB) 5 24
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

828 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