Positioning in a recordset bound to a form.

E

Ebbe

Hey there!

I have a Master form with 2 subforms (datasheet type), each sourced by a
query.
By clicking with the mouse I make record number 4 current in the subform_1
and record number 6 current in subform_2.
Then I click on a commandbutton in frmMaster, that make some manipulation in
the tables, on which the subforms queries are based.
At last I performs a requery on each subform.

Me![frmMaster subform_1].Form.Requery
Me![frmMaster subform_2].Form.Requery

The result is that record number 1 in each subform.
Now - my problem is who to make record number 4 and 6 current again.
The only way I know is to repeat Me![frmMaster
subform_x].Form.RecordSet.MoveNext until the appropriate record is reached.

Are there an easier way to refresh the 2 subforms and recover there record
position?

Thanks for any help.

Ebbe
 
J

John Vinson

Are there an easier way to refresh the 2 subforms and recover there record
position?

Only by recording (in a variable, perhaps) the Primary Key value of
the selected record prior to the requery, and using the Find method on
each subform's recordset clone to re-locate the record. Bookmarks will
not work; they're invalidated by a requery.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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