Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Sep 2002
    Location
    Indianapolis, Indiana, USA
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Searching Fields

    Access 97

    Does Findfirst work only on PK fields or with any indexed field? I can't seem to find the answer to this in Help or the knowledge base. My findfirst crashes in the following code. Error Message: Syntax error (missing operator) in expression.

    For F = 1 To 10 'numtoinsert
    With rstworking
    If rstworking.Bookmarkable Then
    'bookmark current rcd to go back to
    sbook = rstworking.Bookmark
    End If
    'load up vars-current rcd
    sptype = rstworking![Person Type]
    sperson = rstworking![Last Name] & ", " & rstworking![First Name]
    schild = rstworking![Children] & " " & rstworking![childage]
    srelated = rstworking![First Name] & " " & rstworking![Last Name]
    'determine pers type
    'find all related & move to owner
    'set handled flag to Y
    Select Case sptype
    Case "Owner"
    'find all related copy to correct field
    <font color=red>rstworking.FindFirst srelated </font color=red>

    If rstworking.NoMatch Then

    Else
    'rest type don't need orig type anymore
    sptype = rstworking![Person Type]
    Select Case sptype
    Case "Spouse"
    sname = sperson & "& " & rstworking![First Name]

    End Select
    End If

    End Select

    End With


    rstworking.MoveNext
    Next

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Searching Fields

    FindFirst takes an expression like <pre>"MyField=" & strFieldValue</pre>

    You're trying to pass it the value without the left side of the expression and the operator.
    Charlotte

  3. #3
    Star Lounger
    Join Date
    Sep 2002
    Location
    Indianapolis, Indiana, USA
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Searching Fields

    Sometimes one can be so dense or clueless. Don't know why I missed the field spec of find. Do you find that seek works better or faster than find. Say that three times really fast.

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Searching Fields

    Seek is supposed to be faster, but seek has more restrictions on its uses, so I rarely use it.
    Charlotte

Posting Permissions

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