0

I get this error with the FindFirst statement. Code is below.

    If Assgnrst.CompID <> 0 Then
        ComID = Assgnrst!CompID!Value
        Debug.Print Assgnrst.MemberID, ComID
        FindFirststr = "Assgnrst.MemberID = " & ComID & ""
        Debug.Print FindFirststr
        Assgnrst.FindFirst (FindFirststr) -- The error happens on this line

The results of Debug.Print:

 MemberID & ComID: 1049          1304 
 FindFirststr: Assgnrst!MemberID = 1304

Other fields in Assgnrst are being recognized. MemberID is a field in Assgnrst (as shown in the first Debug.Print). What could be the issue?

  • 1
    What happens if you build the string like this? `FindFirststr = "MemberID = " & ComID & ""` – HansUp May 23 '21 at 18:39
  • 1
    `Assgnrst` is not part of the field name so don't use that as prefix in search criteria. I don't understand logic. Why would you search for MemberID = CompID? – June7 May 23 '21 at 19:38
  • @Hansup - I was positive I tried that, but when I changed the code it worked. Thank you. – Bill Bennett May 23 '21 at 23:18

0 Answers0