Link to home
Start Free TrialLog in
Avatar of PeterBaileyUk
PeterBaileyUk

asked on

access .findfirst method syntax

I have a .findfirst method in my function but it squeels error 3251 op is not supported

not sure how to correct.

Public Function ApplyAlias(Strin As String) As String


Dim Db As DAO.Database
Set Db = CurrentDb()
Dim rstTclient As DAO.Recordset
Dim StrOutput As String
Dim Index As Integer

Dim WordArray() As String
WordArray() = Split(Trim(Strin), " ")
Set rstTclient = Db.OpenRecordset("TblModelAlias")

For Index = LBound(WordArray) To UBound(WordArray)

    With rstTclient
        .MoveFirst
        
        .FindFirst "[sDesc] = '" & WordArray(Index) & "'"
          If .NoMatch Then
          'do nothing
          Else
            WordArray(Index) = .Fields("sClientDescGroup").Value
          
          End If
    
    End With
    
Next

Index = 0

For Index = LBound(WordArray) To UBound(WordArray)

If Index = 0 Then

    StrOutput = WordArray(Index)

Else
    StrOutput = StrOutput & " " & WordArray(Index)
End If
   
Next


ApplyAlias = StrOutput





End Function

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ramkisan Jagtap
Ramkisan Jagtap
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PeterBaileyUk
PeterBaileyUk

ASKER

thank you all working