Findfirst/Edit problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • redman08
    New Member
    • Dec 2008
    • 34

    Findfirst/Edit problem

    I'm trying to update a table, but when I get to the ".edit" line in my coding, I get the error message: "Run-time error 3251 - Operation is not supported for this type of object"

    I've played around with changing some of the variables, but the samthin happens.Any ideas?

    The table being updated is a local one within the db.

    Relevant code bits:

    Code:
     Dim CaseDetails As Recordset
    Set CaseDetails = CurrentDb.OpenRecordset("PathwayCases")
     
    CaseDetails.FindFirst "[NHS]='" & SaveNHS & "' AND [Referral]=" & SaveReferralRef
     
    CaseDetails.Edit
  • RuralGuy
    Recognized Expert Contributor
    • Oct 2006
    • 375

    #2
    Did you find anything with the .FindFirst? If Not CaseDetails.NoM atch Then

    Comment

    • redman08
      New Member
      • Dec 2008
      • 34

      #3
      I found, somewhere on the net that it might be because of the OpenRecordset statement. I have now changed it to:

      Set CaseDetails = CurrentDb.OpenR ecordset("Pathw ay Cases", dbOpenDynaset)

      Now I'm getting a different error.The data should match, (in fact CaseDetails.NoM atch = False when running).

      Now I am getting: "The Microsoft Office Access databse engine does not recognize 'Referral' as a valid field name or expression." (which is daft because 'Referral' is a valid column name for the table).

      What do you think?

      Comment

      • redman08
        New Member
        • Dec 2008
        • 34

        #4
        Panic over. Spotted my deliberate mistake with the column names. Thanks for you help, anyway.

        Problem solved!

        Comment

        Working...