[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8207
  • Last Modified:

vba to look at length of array string

Access 2003 vb
What I need:
In the code below  I need  to check for lengh of  cArr(x)
if it is 3 or less goto Next    


Do Until rsCust.EOF
    i = 0
    If rsCust("fldDescription").Value <> "" Then
        ' split on array
        cD = rsCust("fldDescription")
        cArr = Split(cD, " ")
        nfound = False
        cD = Trim(cD)
       
        For x = LBound(cArr) To UBound(cArr)
            ' FORCING ARRAY ELEMENT TO ZERO
            ' ASSUME NOT GOING TO FIND IT
            NounPos(x) = 0
                  rsMfrnum.Seek "=", cArr(x)
           If rsMfrnum.NoMatch = False Then    <-----------------  Problem here
               '  need  to check for lengh of  cArr(x)
               ' if it is 3 or less goto next  
               ' YES WE FOUND IT
                NounPos(x) = 1
             '   strValue = cArr(x)
                i = i + 1
            End If
        Next


'  more code  .... not shown


Thanks
fordraiders
0
Fordraiders
Asked:
Fordraiders
  • 2
1 Solution
 
OnALearningCurveCommented:
Try just using

  If Not rsMfrnum.NoMatch Then

Hope this helps,

Mark.
0
 
OnALearningCurveCommented:
Glad I could help.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now