B
Barth Wilsey
I am not able to edit a specific record in my table tblAnalgesia with the
code below. Instead of going to the record requested, the code below always
changes the field in the first record. The key field in the table is a
number (long integer) and I wonder if some sort of conversion has to be
done. But because the findfirst method requires a string, I am not sure how
to do this
thanks in advance, Barth
Private Function AddWorst(str As String)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblAnalgesia", dbOpenDynaset)
With rs
.FindFirst "Encounter=" & Me.txtWorstEncounter.Value
.Edit
.Fields("WorstPainPastWeek") = str
.Update
End With
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End Function
code below. Instead of going to the record requested, the code below always
changes the field in the first record. The key field in the table is a
number (long integer) and I wonder if some sort of conversion has to be
done. But because the findfirst method requires a string, I am not sure how
to do this
thanks in advance, Barth
Private Function AddWorst(str As String)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblAnalgesia", dbOpenDynaset)
With rs
.FindFirst "Encounter=" & Me.txtWorstEncounter.Value
.Edit
.Fields("WorstPainPastWeek") = str
.Update
End With
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End Function