Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Show newly added record

Discussion in 'Information Technology' started by Kaur, Jul 28, 2006.

  1. Kaur

    Kaur
    Expand Collapse
    Guest

    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. Loading...


  3. jahoobob via AccessMonster.com

    Guest

    Is the popup form adding the children to the correct parent in you table. If
    it is then I would suspect that there is a requery or refresh going on when
    the popup is closed.
    Simplify by adding the data in the subform. When you have a parent in the
    Parent form the children in the subform will be added to that parent and
    you'll still be in that parent's record when all is done.

    Kaur wrote:
    >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


    --
    Message posted via http://www.accessmonster.com
     
  4. Kaur

    Kaur
    Expand Collapse
    Guest

    Thanks for the reply.
    The pop up form is adding the children in the correct parent. Each time
    I finish adding child to a parent and close the pop up form, it takes
    me to the record that comes first as an ascending order in the parent
    list box. e.g. if parentID for Mr. smith is 2 and ParentID Mr.Jackson
    is 1, I am taken to Mr. Jackson's record although I added the children
    for Mr. Smith. When I click on Mr. smith again in the list box, I see
    the added children for Mr. Smith in the subform. I should be able to
    view the records of parent for whom I added the children after closing
    the pop up form.

    Thanks

    jahoobob via AccessMonster.com wrote:
    > Is the popup form adding the children to the correct parent in you table. If
    > it is then I would suspect that there is a requery or refresh going on when
    > the popup is closed.
    > Simplify by adding the data in the subform. When you have a parent in the
    > Parent form the children in the subform will be added to that parent and
    > you'll still be in that parent's record when all is done.
    >
    > Kaur wrote:
    > >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

    >
    > --
    > Message posted via http://www.accessmonster.com
     
  5. aaron.kempf@gmail.com

    aaron.kempf@gmail.com
    Expand Collapse
    Guest

    with Access Data Projects you can use @@IDENTITY in order to get the
    new identity number

    it's beautiful functionality that ins't practical on the mdb side of
    the equation



    Kaur wrote:
    > Thanks for the reply.
    > The pop up form is adding the children in the correct parent. Each time
    > I finish adding child to a parent and close the pop up form, it takes
    > me to the record that comes first as an ascending order in the parent
    > list box. e.g. if parentID for Mr. smith is 2 and ParentID Mr.Jackson
    > is 1, I am taken to Mr. Jackson's record although I added the children
    > for Mr. Smith. When I click on Mr. smith again in the list box, I see
    > the added children for Mr. Smith in the subform. I should be able to
    > view the records of parent for whom I added the children after closing
    > the pop up form.
    >
    > Thanks
    >
    > jahoobob via AccessMonster.com wrote:
    > > Is the popup form adding the children to the correct parent in you table. If
    > > it is then I would suspect that there is a requery or refresh going on when
    > > the popup is closed.
    > > Simplify by adding the data in the subform. When you have a parent in the
    > > Parent form the children in the subform will be added to that parent and
    > > you'll still be in that parent's record when all is done.
    > >
    > > Kaur wrote:
    > > >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

    > >
    > > --
    > > Message posted via http://www.accessmonster.com
     
  6. Kaur

    Kaur
    Expand Collapse
    Guest

    I am a beginner using MS Access. Could you please explain how to
    acheive that.

    Thanks


    aaron.kempf@gmail.com wrote:
    > with Access Data Projects you can use @@IDENTITY in order to get the
    > new identity number
    >
    > it's beautiful functionality that ins't practical on the mdb side of
    > the equation
    >
    >
    >
    > Kaur wrote:
    > > Thanks for the reply.
    > > The pop up form is adding the children in the correct parent. Each time
    > > I finish adding child to a parent and close the pop up form, it takes
    > > me to the record that comes first as an ascending order in the parent
    > > list box. e.g. if parentID for Mr. smith is 2 and ParentID Mr.Jackson
    > > is 1, I am taken to Mr. Jackson's record although I added the children
    > > for Mr. Smith. When I click on Mr. smith again in the list box, I see
    > > the added children for Mr. Smith in the subform. I should be able to
    > > view the records of parent for whom I added the children after closing
    > > the pop up form.
    > >
    > > Thanks
    > >
    > > jahoobob via AccessMonster.com wrote:
    > > > Is the popup form adding the children to the correct parent in you table. If
    > > > it is then I would suspect that there is a requery or refresh going on when
    > > > the popup is closed.
    > > > Simplify by adding the data in the subform. When you have a parent in the
    > > > Parent form the children in the subform will be added to that parent and
    > > > you'll still be in that parent's record when all is done.
    > > >
    > > > Kaur wrote:
    > > > >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
    > > >
    > > > --
    > > > Message posted via http://www.accessmonster.com
     
  7. aaron.kempf@gmail.com

    aaron.kempf@gmail.com
    Expand Collapse
    Guest

    1) start MS access
    2) file, new
    3) choose 'project' instead of application
    4) point to a sql server or msde server
    5) if you dont have msde download it at www.microsoft.com/sql
    6) write a stored procedure
    'insert into myTable (TheValue, DateEntered)
    Values (12, '1/12/2006')


    and then on the 2nd line of that stored procedure; you have

    Select @@identity

    this will do what you're trying to do without any coding on the
    application front end.

    I highly reccomend a basic book on SQL Server; or something along those
    lines.. it is a bit to chew off-- but it is worth it in the long run.


    Kaur wrote:
    > I am a beginner using MS Access. Could you please explain how to
    > acheive that.
    >
    > Thanks
    >
    >
    > aaron.kempf@gmail.com wrote:
    > > with Access Data Projects you can use @@IDENTITY in order to get the
    > > new identity number
    > >
    > > it's beautiful functionality that ins't practical on the mdb side of
    > > the equation
    > >
    > >
    > >
    > > Kaur wrote:
    > > > Thanks for the reply.
    > > > The pop up form is adding the children in the correct parent. Each time
    > > > I finish adding child to a parent and close the pop up form, it takes
    > > > me to the record that comes first as an ascending order in the parent
    > > > list box. e.g. if parentID for Mr. smith is 2 and ParentID Mr.Jackson
    > > > is 1, I am taken to Mr. Jackson's record although I added the children
    > > > for Mr. Smith. When I click on Mr. smith again in the list box, I see
    > > > the added children for Mr. Smith in the subform. I should be able to
    > > > view the records of parent for whom I added the children after closing
    > > > the pop up form.
    > > >
    > > > Thanks
    > > >
    > > > jahoobob via AccessMonster.com wrote:
    > > > > Is the popup form adding the children to the correct parent in you table. If
    > > > > it is then I would suspect that there is a requery or refresh going on when
    > > > > the popup is closed.
    > > > > Simplify by adding the data in the subform. When you have a parent in the
    > > > > Parent form the children in the subform will be added to that parent and
    > > > > you'll still be in that parent's record when all is done.
    > > > >
    > > > > Kaur wrote:
    > > > > >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
    > > > >
    > > > > --
    > > > > Message posted via http://www.accessmonster.com
     

Share This Page