Return to current Record

E

Eric C.

I have a form called Teacher with a subform called School
Director. From this form, a user can open up a staff form
and add staff members to the specific school. If the end-
user adds a School Director, I must requery the school
form in order to see that the School Director was added to
the subform.

The problem I'm having is that if I happend to be on
record 34 on the school form, when I close the staff form -
it requeries the school form in order to present the
School Director, but it also moves back to the first
record.

How do I have the form stay on the specific record it was
on?

Thanks,

Eric
 
J

Jonathan Parminter

-----Original Message-----
I have a form called Teacher with a subform called School
Director. From this form, a user can open up a staff form
and add staff members to the specific school. If the end-
user adds a School Director, I must requery the school
form in order to see that the School Director was added to
the subform.

The problem I'm having is that if I happend to be on
record 34 on the school form, when I close the staff form -
it requeries the school form in order to present the
School Director, but it also moves back to the first
record.

How do I have the form stay on the specific record it was
on?

Thanks,

Eric
.
Hi Eric, have you considered assigning the record id to a
variable prior to the requery action. Then go to the
record with this id. for example

dim lngID as long
dim frm as form

set frm=subform.form

lngID=frm.PrimaryKey_ID
frm.requery

frm.recordsetclone.findfirst "PrimaryKey_ID=" & lngID
frm.bookmark=frm.recordsetclone.bookmark

set frm=nothing

Luck
Jonathan
 
E

Eric C.

Thanks Jonathan,

That really helped!

eric
-----Original Message-----

Hi Eric, have you considered assigning the record id to a
variable prior to the requery action. Then go to the
record with this id. for example

dim lngID as long
dim frm as form

set frm=subform.form

lngID=frm.PrimaryKey_ID
frm.requery

frm.recordsetclone.findfirst "PrimaryKey_ID=" & lngID
frm.bookmark=frm.recordsetclone.bookmark

set frm=nothing

Luck
Jonathan
.
 

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