No Current record error

  • Thread starter Thread starter dhstein
  • Start date Start date
D

dhstein

I'm adding a record to a table with .AddNew followed by .Update
Further down in the code I want to modify a field in that record. How can I
refer to that record? I tried:

rsMyRecordSet.LastUpdated.Edit

but that doesn't work.

Any help is appreciated.
 
I'm adding a record to a table with .AddNew followed by .Update
Further down in the code I want to modify a field in that record.
How can I refer to that record? I tried:

rsMyRecordSet.LastUpdated.Edit

but that doesn't work.

Any help is appreciated.
Just move the .update statement to after you have modified the field.
or, you use the .lastmodified property to move the bookmark

me.bookmark = me.lastmodified.

Just be careful in a multiuser environment.
 
RstMyRecordset!NameOfFieldToEdit = <Value to modify field to>

If you issue the statement above after an .update statement, you get
the No Current record error that is the title of the post.

So again you prove that your real name is
(e-mail address removed)
 
Hi,

To my knowledge, you remain on the same record unless you do something
to move off of it. So if it is a DAO record set you would use just the .Edit
method to set the current record into edit mode. Then start making the
changes you want. Or if ADO, just start making the changes. In both cases
you will then use the .Update method.

Also, in looking at online documentation of the .LastUpdated property
of a DAO record set it states: "Returns the date and time of the most recent
change made to a base table. Read-only Variant."

Clifford Bass
 
Back
Top