I need help with BOOKMARKS

  • Thread starter Thread starter Bill Mitchell
  • Start date Start date
B

Bill Mitchell

Hi,

I have a subform that I have added a new record to using
an append query. I want to refresh the records in the
subform then navigate to the most recently added record.

I know Bookmarks can do this for me but I'm not sure of
the exact syntax. I've tried this:

Me.Bookmark = Me.RecordsetClone.LastModified

but it gives me an error message ("Not a valid
bookmark").

Anyone know the exact syntax? Is the fact it's a subform
that is causing me trouble?

I tried just running a Msgbox to see what value
me.recordsetclone.lastmodified returned and there was no
value.

Thanks.
 
Was the record added to the form or to the RecordsetClone of the form?

LastModified would reference the last edit/insert that happened on the clone
set.
 
It was added to the RecordsetClone of the form.

Ok, lets try this. Lets say I am going to run an append
query on a subform and then i want to go to the new
record.

docmd.setwarnings 0
docmd.opequery "MyAppendQuery"
me.bookmark = me.recordsetclone.lastmodified
docmd.setwarnings -1

This is how I think it should go but it doesn't work.
What am I doing wrong? Do I need to declare my dbs first?

Thanks.
 
You have not added a record to the form's RecordsetClone.
You have added it directly to the table.
The record is not even in the form's RecordsetClone until you requery.
 
Back
Top