Return to current Record

  • Thread starter Thread starter Eric C.
  • Start date Start date
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
 
-----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
 
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
.
 
Back
Top