Results 1 to 3 of 3

ADODB.recordset.find gives a compile error expected function or variable

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    330

    ADODB.recordset.find gives a compile error expected function or variable

    I have a recordset created and held in a public variable while bouncing through some userforms.
    One of the options I have is an uprevision of the data and I want to use recordset.find to prefill some of the fields in a userform for adding records.
    The error I get is as described highlighting the ".find"
    Public Function DBlatest(PartStr As String) As Variant
    objRecordset.MoveLast
    DBlatest = objRecordset.Find("PartNo = '" & PartStr & "'", , adSearchBackward, objRecordset.RecordCount)
    'objRecordset.FindLast
    Stop
    End Function
    I am hoping this is just a syntax error because I do not want to have to loop through the recordset as an array.
    Last edited by Leon V (AW); 10-25-2022 at 08:52 PM.
    Sub Reputation()
    Dim Problem as Variant
    Dim Reputation as Integer
    For Each Problem in Forum.Threads
        If Problem.Title = "*[Solved]*" and Solver.Name = "Leon V (AW)" Then Reputation = Reputation + 1
    Next Problem
    End Sub

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Compile Error: Expected Function or variable
    By bigmon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2020, 09:22 AM
  2. Getting compile error expected function or variable
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2014, 01:33 AM
  3. [SOLVED] Shell Function "Compile Error: Expected procedure, not variable"
    By s0713190@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-09-2014, 01:20 PM
  4. [SOLVED] Compile Error Expected Function or Variable
    By shiser in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-22-2014, 09:18 AM
  5. [SOLVED] Compile error expected function or variable (on protect method)
    By Tirren in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-30-2013, 03:22 PM
  6. Mac issue (please help) "Compile error: Expected Function or variable"
    By m1notaur in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-22-2011, 06:00 PM
  7. Compile Error:- expected function or variable problem
    By skin.uk1 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-08-2011, 02:56 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1