Returning to a Record on a form

  • Thread starter Thread starter Allen Browne
  • Start date Start date
A

Allen Browne

Use FindFirst on the RecordsetClone of the form to find the record again.

Assuming the primary key field is named "ID", and you want to find 44, you
would code like this:

With Me.RecordsetClone
.FindFirst "ID = 44"
If Not rs.NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
 
Hi folks

I have a situation where i am trying to return to a particular record on a
form where i had been navigating thru a table.

I have buttons on the form eg ADD, EDIT, SAVE, CANCEL, EXIT and the
navigation controls enabled.

I reach a record say record 44 and then decide to ADD a new record and press
my ADD button which puts me into a new record and enables/disables my
buttons appropriately.

I then decide to CANCEL and not add the new record (me.undo etc) but I want
to return to where I was previously.

Normally I would be returned to the first record in the underlying
table/query.

Obviously, I could store my internal ID of the record I was on and then set
a filter to get back to it...but yes..that would mean I would no longer be
navigating thru the underlying records.

Is there a way to store the temporary recordno I was on and then use the
DoCmd.GoToRecord , , acGoTo, 44
or is there simply a better way?

Regards
Jeff
 
Allen

You beauty!! I had a sneaking feeling you would be online and perusing the
forumns..... ;)

thank you Guru!!
cheers
jeff
 
Back
Top