I need help with BOOKMARKS

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.
 
A

Allen Browne

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.
 
G

Guest

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.
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top