By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,498 Members | 1,564 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,498 IT Pros & Developers. It's quick & easy.

Repost: find record in form1 from form2

P: n/a

I am reposting this message. I am a beginner using MS Access. I am
working in MS Access 2000 and have created two forms. Form 1 is called
frmParent (which has a read only subform called SfrmChild). FrmParent
has a list box that lists all the Last Names of parents in the db.
Clicking on one of the lastname of parent in the list box shows
children of selected parent in the SfrmChild. I have a button on
frmParent that opens up a pop up form where user can add children to
the selected parent.
My problem is when I close the pop up form, it refreshes the subform
but does not take me to the selected parent for whom I added the
children. For example if I added children for Mr.Smith, the children
gets added to subform but closing the pop up form does not take me to
Mr. Smith's record. It takes me to the first record by ascending order
in the list box. If Mr. smith ID is 2 and Mr. Jackson ID is 1, after
adding the children for Mr. smith and closing the pop up form the
record for Mr. Jackson is shown in frmParent. I want to see Mr. Smith's

record along with added children in the subform.
I understand I can directly add the recods in the subform and save all
the hastle but this is how the client wants to see the records added to

subform.
I will appreciate any help.

Thanks
Reply

Jun 19 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

Kaur wrote:
I am reposting this message. I am a beginner using MS Access. I am
working in MS Access 2000 and have created two forms. Form 1 is called
frmParent (which has a read only subform called SfrmChild). FrmParent
has a list box that lists all the Last Names of parents in the db.
Clicking on one of the lastname of parent in the list box shows
children of selected parent in the SfrmChild. I have a button on
frmParent that opens up a pop up form where user can add children to
the selected parent.
My problem is when I close the pop up form, it refreshes the subform
but does not take me to the selected parent for whom I added the
children. For example if I added children for Mr.Smith, the children
gets added to subform but closing the pop up form does not take me to
Mr. Smith's record. It takes me to the first record by ascending order
in the list box. If Mr. smith ID is 2 and Mr. Jackson ID is 1, after
adding the children for Mr. smith and closing the pop up form the
record for Mr. Jackson is shown in frmParent. I want to see Mr. Smith's

record along with added children in the subform.
I understand I can directly add the recods in the subform and save all
the hastle but this is how the client wants to see the records added to

subform.
I will appreciate any help.

Thanks
Reply


Do you have a requery on the pop-up. This is what is bring you back to
the first record after the pop-up is closed.

Jun 19 '06 #2

P: n/a

Cilla wrote:
Kaur wrote:
I am reposting this message. I am a beginner using MS Access. I am
working in MS Access 2000 and have created two forms. Form 1 is called
frmParent (which has a read only subform called SfrmChild). FrmParent
has a list box that lists all the Last Names of parents in the db.
Clicking on one of the lastname of parent in the list box shows
children of selected parent in the SfrmChild. I have a button on
frmParent that opens up a pop up form where user can add children to
the selected parent.
My problem is when I close the pop up form, it refreshes the subform
but does not take me to the selected parent for whom I added the
children. For example if I added children for Mr.Smith, the children
gets added to subform but closing the pop up form does not take me to
Mr. Smith's record. It takes me to the first record by ascending order
in the list box. If Mr. smith ID is 2 and Mr. Jackson ID is 1, after
adding the children for Mr. smith and closing the pop up form the
record for Mr. Jackson is shown in frmParent. I want to see Mr. Smith's

record along with added children in the subform.
I understand I can directly add the recods in the subform and save all
the hastle but this is how the client wants to see the records added to

subform.
I will appreciate any help.

Thanks
Reply


Do you have a requery on the pop-up. This is what is bring you back to
the first record after the pop-up is closed.


If you need the requery on the pop-up heres one way around it:

dim a varable such as xxx as an integer and make xxx = the main forms
key field at the top of the vb to open the pop-up as shown below:

Dim xxx as integer
Xxx = me![KeyField]

At the end of the vb for the pop-up do a record set search back to the
orginial number you opened the pop-up from.

Dim rs as object
Set rs = me.recordset.clone
Rs.FindFirst "[Keyfield] = " & xxx
If Not rs.EOF then me.bookmark = rs.bookmark

Jun 19 '06 #3

P: n/a
"Kaur" <ka***@saic.com> wrote in
news:11**********************@f6g2000cwb.googlegro ups.com:

I am reposting this message. I am a beginner using MS Access.
I am working in MS Access 2000 and have created two forms.
Form 1 is called frmParent (which has a read only subform
called SfrmChild). FrmParent has a list box that lists all the
Last Names of parents in the db. Clicking on one of the
lastname of parent in the list box shows children of selected
parent in the SfrmChild. I have a button on frmParent that
opens up a pop up form where user can add children to the
selected parent. My problem is when I close the pop up form,
it refreshes the subform but does not take me to the selected
parent for whom I added the children.
It seems to me from your design that you have not properly bound
the main form to the parents table, because the flow should be
as follows:

step action
1 Select parent from listbox.
2 Move frmParents to parent selected in step 1
3 Click add children button to open Popup.
4 Add children for parent on frmParent.
5 Close Popup, requery subform only
6 You are back at frmParents, which is still showing parent
selected in step 1

I cannot figure exactly what your actual flow is, but you are
doing something that makes the frmParent lose its reference
point.

For example if I added children for Mr.Smith, the children gets added to subform but
closing the pop up form does not take me to Mr. Smith's
record.
There should be no need to take you to mr Smith's record. You
should already be on Mr Smith's record, in order to add his
children.

It takes me to the first record by ascending order in the list box. If Mr. smith ID is 2 and Mr. Jackson ID is 1,
after adding the children for Mr. smith and closing the pop up
form the record for Mr. Jackson is shown in frmParent. I want
to see Mr. Smith's

record along with added children in the subform.
I understand I can directly add the recods in the subform and
save all the hastle but this is how the client wants to see
the records added to

subform.
I will appreciate any help.

Thanks
Reply


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jun 19 '06 #4

P: n/a
Thanks ever so much.
I found out my mistake. I was requering the main form as well as sub
form. Removing requering the main form settled the problem

Once again thanks.
Bob Quintal wrote:
"Kaur" <ka***@saic.com> wrote in
news:11**********************@f6g2000cwb.googlegro ups.com:

I am reposting this message. I am a beginner using MS Access.
I am working in MS Access 2000 and have created two forms.
Form 1 is called frmParent (which has a read only subform
called SfrmChild). FrmParent has a list box that lists all the
Last Names of parents in the db. Clicking on one of the
lastname of parent in the list box shows children of selected
parent in the SfrmChild. I have a button on frmParent that
opens up a pop up form where user can add children to the
selected parent. My problem is when I close the pop up form,
it refreshes the subform but does not take me to the selected
parent for whom I added the children.


It seems to me from your design that you have not properly bound
the main form to the parents table, because the flow should be
as follows:

step action
1 Select parent from listbox.
2 Move frmParents to parent selected in step 1
3 Click add children button to open Popup.
4 Add children for parent on frmParent.
5 Close Popup, requery subform only
6 You are back at frmParents, which is still showing parent
selected in step 1

I cannot figure exactly what your actual flow is, but you are
doing something that makes the frmParent lose its reference
point.

For example if I added
children for Mr.Smith, the children gets added to subform but
closing the pop up form does not take me to Mr. Smith's
record.


There should be no need to take you to mr Smith's record. You
should already be on Mr Smith's record, in order to add his
children.

It takes me to the first record by ascending order in
the list box. If Mr. smith ID is 2 and Mr. Jackson ID is 1,
after adding the children for Mr. smith and closing the pop up
form the record for Mr. Jackson is shown in frmParent. I want
to see Mr. Smith's

record along with added children in the subform.
I understand I can directly add the recods in the subform and
save all the hastle but this is how the client wants to see
the records added to

subform.
I will appreciate any help.

Thanks
Reply


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com


Jun 19 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.