F
FrankieNap
I have a multipage form that I use to input information on students,
look up test scores, etc.
I am using a popup form to add new students. On adding a new student,
the code inserts a new primary ID and I insert the student's first and
last name. If I want to cancel the student, I press one button which
deletes the current record and closes the pop-up form. If I want to
keep the student, however, I have another button which closes the pop-
up and requeries my main form. Here is the code:
DoCmd.Close acForm, "New Student"
Dim ctlCombo As Control
Set ctlCombo = Forms!Students!StudentNavigator
ctlCombo.Requery
Forms!Students.Requery
The "New Student" is the pop-up. The first requery is for a drop-down
list which I use to navigate, the second requery is supposed to
requery the control of the main form "Students". However, when this
requery runs, instead of staying on the first page of this 3 page
form, I am redirected to the middle of the second page. I have tried
to add a docmd.gotopage after the requery but to no avail.
If anyone has any advice it would be greatly appreciated.
On a second note, I wonder if there is a simple way to, after
requerying the main form, go directly to the new student whcih was
just added?
Thank you,
-Frank
look up test scores, etc.
I am using a popup form to add new students. On adding a new student,
the code inserts a new primary ID and I insert the student's first and
last name. If I want to cancel the student, I press one button which
deletes the current record and closes the pop-up form. If I want to
keep the student, however, I have another button which closes the pop-
up and requeries my main form. Here is the code:
DoCmd.Close acForm, "New Student"
Dim ctlCombo As Control
Set ctlCombo = Forms!Students!StudentNavigator
ctlCombo.Requery
Forms!Students.Requery
The "New Student" is the pop-up. The first requery is for a drop-down
list which I use to navigate, the second requery is supposed to
requery the control of the main form "Students". However, when this
requery runs, instead of staying on the first page of this 3 page
form, I am redirected to the middle of the second page. I have tried
to add a docmd.gotopage after the requery but to no avail.
If anyone has any advice it would be greatly appreciated.
On a second note, I wonder if there is a simple way to, after
requerying the main form, go directly to the new student whcih was
just added?
Thank you,
-Frank