• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

update query - trouble with recordset

In the query below I am getting the error "method or data member not found"  for rs.NegociatedRate.

What am I doing wrong?

    Dim db As DAO.Database
    Dim RcdSet As DAO.Recordset
    Dim sqlFP As String
    Set db = CurrentDb()
    sqlFP = "Select * From tblTranslationContractPurchases where trad_commandesID=" & Me![trad_commandesID]
    Set RcdSet = db.OpenRecordset(sqlFP, dbOpenDynaset, dbSeeChanges)
    
    Dim rs As DAO.Recordset
    Dim sqlOption As String
    sqlOption = "Select * From tbltrad_commandes_FPdetails where trad_commandesID=" & Me![trad_commandesID] & _
    "AND OptionSelected=1"
    Set rs = db.OpenRecordset(sqlOption, dbOpenDynaset, dbSeeChanges)
    
    
        If RcdSet.RecordCount = 0 Then
        'can't find proposal. need to do an append
        
        ElseIf RcdSet.RecordCount = 1 Then
            If rs.RecordCount = 0 Then
            MsgBox "You need to choose the number of words."
            ElseIf rs.RecordCount = 1 Then
            rs.MoveFirst
            DoCmd.SetWarnings False
            Dim strSQL As String
            strSQL = "Update tblTranslationContractPurchases set OrderDate = Now()," & _
here ====>>>            "NegociatedRate = " & rs.NegociatedRate & _
            ",ContractPrice = " & rs.ContractPrice & _
            ",ContractQuantity = " & rs.ContractQuantity & _
            ",FPEstimateStatus = 2 " & _
            "where tblTranslationContractPurchases.trad_commandesID = " & Me.trad_commandesID
            DoCmd.RunSQL strSQL
            DoCmd.SetWarnings True
            Else
            MsgBox "You need to choose the number of words. Only one option at a time."
            End If
        End If
    
    RcdSet.Close
    Set RcdSet = Nothing
    

Open in new window

0
Shawn
Asked:
Shawn
  • 3
  • 3
2 Solutions
 
mbizupCommented:
Check your spelling and use ! Instead of .  For fieldnames.
0
 
peter57rCommented:
rs!NegociatedRate

and the same for the other rs fields.
0
 
mbizupCommented:
Same applies for all of your fieldnames...

Rs!fieldname
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
ShawnAuthor Commented:
ok, got it.

I'm a little confused as to when to use . and when to use !
0
 
ShawnAuthor Commented:
both answers are right. First right answer or split?
0
 
mbizupCommented:
Use . for methods such as Update, MoveNext, etc and properties such as .NoMatch, etc.

Use ! for fieldnames, or the alternate syntax rs("FieldName")


>>> First right answer or split?

Our answers were almost at the same time.  A split is good with me.
0
 
ShawnAuthor Commented:
great, thanks for clarification.

If you want to tackle another question, I've been stuck on this one for a while
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_28017619.html

Shawn
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now