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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

current record after .update 1

Status
Not open for further replies.

kronar30

Programmer
Sep 8, 2004
74
US
When I use rec.Edit, update a field, then rec.Update
the record is updated, however current record always seems to be the next record in the table.
How do I keep this same record as the current record to do further updates to?
Findfirst after an update gets run time error??
I am using Access 97
 
can you post your code ... sounds like you have a rs.MoveNext in your code

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work
 
Set JBrec = db.OpenRecordset("JB_Jobs")
JBrec.AddNew
JBrec("JB_JobBidNo") = strBidNo
JBrec("JB_JobName") = "Addnew record"
JBrec.Update

JBrec.Edit
JBrec("JB_Specs") = strBidNo & " curr rec"
JBrec.Update

this is the code I used to test it. "curr rec" gets entered into the next record in the table instead of the same record I just updated??
 
Set JBrec = db.OpenRecordset("JB_Jobs", dbOpenDynaset)

With JBrec
.AddNew
.Fields("JB_JobBidNo") = strBidNo
.Fields("JB_JobName") = "Addnew record"
.Fields("JB_Specs") = strBidNo & " curr rec"
.Update
End With

untested .. Thoughts

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work
 
When you add a record, that record does not automatically become the current record. Between the add and the edit, you should put in:

Code:
JBrec.Bookmark = JBrec.LastModified

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top