Connecting Tech Pros Worldwide Help | Site Map

Show newly added record

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 16th, 2006, 06:05 PM
Kaur
Guest
 
Posts: n/a
Default Show newly added record

Hi,

I am working in MS Access 2000 and have created two forms. Form 1 is
called frmParent (which has a 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 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. How can
I automate that each time I add children for a selected parent, closing
the pop form will take me to the selected parent's record for whom I
added the children.

I will appreciate any help.

Thanks


  #2  
Old June 16th, 2006, 06:15 PM
ComputerJunkie
Guest
 
Posts: n/a
Default Re: Show newly added record


Kaur wrote:
[color=blue]
> Hi,
>
> I am working in MS Access 2000 and have created two forms. Form 1 is
> called frmParent (which has a 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 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. How can
> I automate that each time I add children for a selected parent, closing
> the pop form will take me to the selected parent's record for whom I
> added the children.
>
> I will appreciate any help.
>
> Thanks[/color]

Kaur, when you move back to the frmParent, hit the F9 key - this
carries out a page refresh.
If you want to do this automatically, you can set up an auto refresh
(known as a requery) in the AfterUpdate method of the frmParent and the
OnClose method of the SfrmChild. The command would look something like
this:

sub SfrmChild Close()
docmd.openform "frmParent"
docmd.close acDefault
end sub

sub frmParent AfterUpdate()
docmd.requery
end Sub

Hope this helps.
D

  #3  
Old June 19th, 2006, 01:25 PM
Kaur
Guest
 
Posts: n/a
Default Re: Show newly added record

Thanks for the reply,
My problem is the subform does get updated but it does not show me the
record for which I added the children. e.g. If I added the children for
Mr. Smith, on closing the pop up form it shows me the record that comes
first in ascending order of the parent listbox.
I want the popup form close action to take me back to Mr. Smith's
record.

Manjeet

ComputerJunkie wrote:[color=blue]
> Kaur wrote:
>[color=green]
> > Hi,
> >
> > I am working in MS Access 2000 and have created two forms. Form 1 is
> > called frmParent (which has a 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 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. How can
> > I automate that each time I add children for a selected parent, closing
> > the pop form will take me to the selected parent's record for whom I
> > added the children.
> >
> > I will appreciate any help.
> >
> > Thanks[/color]
>
> Kaur, when you move back to the frmParent, hit the F9 key - this
> carries out a page refresh.
> If you want to do this automatically, you can set up an auto refresh
> (known as a requery) in the AfterUpdate method of the frmParent and the
> OnClose method of the SfrmChild. The command would look something like
> this:
>
> sub SfrmChild Close()
> docmd.openform "frmParent"
> docmd.close acDefault
> end sub
>
> sub frmParent AfterUpdate()
> docmd.requery
> end Sub
>
> Hope this helps.
> D[/color]

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.