Solved

VB6 - Compare MSHFlexgrid row 0 with TEXTbox

Posted on 2013-01-04
3
602 Views
Last Modified: 2013-01-05
Hello all

I would like to validate from every cell of my MSHFlexgrid1 row 0 with every name entered in  my TEXT2 multiLine .

Ex:
If MSHFlexGrid1.TextMatrix(0, 0) is not equal to my TEXT1 1 row of Multiline, it would give me a msg saying that it does not match.

It would validate all cell of row 0 of the MSHFlexgrid1.

How can i do that?

Thanks again for your help

picture 1

This is what i have for now:
Private Sub rate999_Click()
    Dim lngCol As Long

    For lngCol = 0 To MSHFlexGrid1.Cols - 1
        If MSHFlexGrid1.TextMatrix(0, lngCol) = TEXT1 .Text Then
        Else
            Call MsgBox("Heather doesn't match. Please validate.", vbExclamation, "Heather Validation")
            Exit Sub
        End If
    Next
End Sub

Open in new window

0
Comment
Question by:Wilder1626
  • 2
3 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 38746702
Private Sub rate999_Click()
    Dim lngCol As Long
    Dim lngIndex As Long
    Dim strParts() As String
    Dim bFound As Boolean
    
    strParts = Split(Text1.Text, vbCrLf)
    For lngCol = 0 To MSHFlexGrid1.Cols - 1
        bFound = False
        For lngIndex = 0 To UBound(strParts)
            If MSHFlexGrid1.TextMatrix(0, lngCol) = strParts(lngIndex) Then
                bFound = True
                Exit For
            End If
        Next
        If Not bFound Then
            MsgBox "Header doesn't match. Please validate.", vbExclamation, "Header Validation"
            Exit Sub
        End If
    Next
End Sub

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 38746714
Thank you so much again. this is perfect.
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 38746720
You're welcome and I'm glad I was able to help.

Select the 'About Me' tab in my profile and you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2012
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

863 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

22 Experts available now in Live!

Get 1:1 Help Now