Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update from Recordset Erring, Operation Not Supported

Status
Not open for further replies.

Fattire

Technical User
Nov 30, 2006
127
US
I have this code, and I get a Run-Time error '3251': Operation is not supported for this type of object.

Errors out on .FindFirst

Can I not use 2 fields for criteria in a where clause?

Code:
Private Sub cmd_SaveChanges_Click()

    Dim varAddress1 As String
    Dim varAddress2 As String
    Dim varAddress3 As String
    Dim varCity As String
    Dim varState As String
    Dim varPostal_Code As String
    Dim varCustNum As String
    Dim varInvNum As String
    Dim strWhere As String
    Dim rec1 As DAO.Recordset
    Dim db As Database
    Set db = CurrentDb
    
    varCustNum = Me.txt_CustomerNumber
    varInvNum = Me.txt_InvoiceNumber
    varAddress1 = Me.txt_AddressLine1
    varAddress2 = Me.txt_AddressLine2
    varAddress3 = Me.txt_AddressLine3
    varCity = Me.txt_City
    varState = Me.txt_State
    varPostal_Code = Me.txt_PostalCode
    
    Set rec1 = db.OpenRecordset("tbl_Oracle")
    
    strWhere = "CUST_NUM ='" & varCustNum & "' And TRX_NUMBER ='" & varInvNum & "'"
    
    With rec1
        .FindFirst strWhere  'ERRORS OUT HERE!!
    If Not .NoMatch Then
        .Edit
        !ADDRESS1 = varAddress1
        !ADDRESS2 = varAddress2
        !ADDRESS3 = varAddress3
        !CITY = varCity
        !STATE = varState
        !POSTAL_CODE = varPostal_Code
        .Update
    End If
    End With
    
    Me.txt_Confirm = "Changes made"
    
End Sub


Any help would be greatly appreciated.

 
I think FindFirst is only available in ADO, not DAO, but not positive.

"Time flies like an arrow; fruit flies like a banana."
 
FindFirst" is DAO ("Find" is ADO) but you might be defaulting to a Recordset type that doesn't support Find operations.
Code:
Set rec1 = db.OpenRecordset("tbl_Oracle"[red], dbOpenDynaset[/red])
 


Yep....that was the problem, needed dbOpenDynaset in there...

thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top