Solved

access .findfirst method syntax

Posted on 2014-09-15
3
280 Views
Last Modified: 2014-09-15
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

0
Comment
Question by:PeterBaileyUk
[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
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 500 total points
ID: 40322833
Try with changing line 12 as below:

Set rstTclient = Db.OpenRecordset("TblModelAlias", dbOpenDynaset)
0
 
LVL 12

Expert Comment

by:Ramkisan Jagtap
ID: 40322839
0
 

Author Closing Comment

by:PeterBaileyUk
ID: 40322857
thank you all working
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

617 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