Me.Requery Failure

J

Jabba

I'll try to explain this as best as I can. My db has master records that can
each have multiple 'sub' records associated with them. Each sub-record has
the same Master Reference to link them all together, but also have their own
sub-references. When viewing one sub-record on the form the user can click a
button to create a new sub-record. I use the normal INSERT INTO etc etc to
create this record, and then set a variable to "DMax(sub-reference,
tablename)" i.e. the reference of the sub-record that has just been created.
I then use Me.Requery, followed by 'rs.FindFirst "sub-reference = " &
variable' i.e. find the sub-record that has just been created, and then
Me.Bookmark = rs.Bookmark. Hope you're still following this.

There are a number of instances of this same structure throughout the db
that work fine, but for some reason this Requery is failing and when it comes
to setting the bookmark I get the error "No current record". When I stop
running the code, close all forms and re-open them the record has indeed been
created.

Has anyone come across this before, is there a known fault with Requery??????
 
Top