Welcome to SPN

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

Sign Up Now!

2 small Questions

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

  1. lmv

    lmv
    Expand Collapse
    Guest

    How do you put more than one code in an event
    Ie.
    on current
    =LockBoundControls([Form],True)
    =AutoFillNewRecord(Forms!OrdersWDetails)

    ----------
    2nd question:

    How do I update the parent (Orders) lastedited field when I save the changes
    in the child OrderDetails.

    me.lastedited = Now

    works for the Orders but not for the child...

    Thanks!
     
  2. Loading...

    Similar Threads Forum Date
    A Great Man Makes Others Feel Big, Not Small... Sikh Sikhi Sikhism Apr 1, 2015
    Pacific Borneo: Sikhs small in number, strong in presence Breaking News Nov 11, 2013
    SciTech A Boy and His Atom - World's smallest movie Breaking News May 3, 2013
    USA American Sikhs A Small, Misunderstood Community Breaking News Aug 10, 2012
    Sikhs Are Small in Numbers. But Are Sikhs Most Divided by Caste? Hard Talk Mar 1, 2011

  3. Graham Mandeno

    Graham Mandeno
    Expand Collapse
    Guest

    Answer 1:
    You create an event procedure for your event and call the functions from
    there:

    Private Sub Form_Current()
    Call LockBoundControls( Me, True )
    Call AutoFillNewRecord( Forms!OrdersWDetails )
    End Sub

    Answer 2:
    Assuming OrderDetails is bound to a subform on your Orders form:

    Me.Parent!LastEdited = Now

    The Parent property of a subform is a reference to the form which contains
    that subform.
    --
    Good Luck!

    Graham Mandeno [Access MVP]
    Auckland, New Zealand

    "lmv" <lmv@discussions.microsoft.com> wrote in message
    news:0E1D3A30-8A9C-4883-913F-368DD3FAE2F1@microsoft.com...
    > How do you put more than one code in an event
    > Ie.
    > on current
    > =LockBoundControls([Form],True)
    > =AutoFillNewRecord(Forms!OrdersWDetails)
    >
    > ----------
    > 2nd question:
    >
    > How do I update the parent (Orders) lastedited field when I save the
    > changes
    > in the child OrderDetails.
    >
    > me.lastedited = Now
    >
    > works for the Orders but not for the child...
    >
    > Thanks!
     
  4. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Tue, 13 Jun 2006 12:34:02 -0700, lmv
    <lmv@discussions.microsoft.com> wrote:

    >How do you put more than one code in an event
    >Ie.
    >on current
    > =LockBoundControls([Form],True)
    >=AutoFillNewRecord(Forms!OrdersWDetails)


    The event should show [Event Procedure], and you should edit the VBA
    code to

    Private Sub <whatever the event name might be>()
    Call LockBoundControls(Me, True)
    Call AutoFillNewRecord(Forms!OrderWDetails)
    End Sub

    >----------
    >2nd question:
    >
    >How do I update the parent (Orders) lastedited field when I save the changes
    >in the child OrderDetails.
    >
    >me.lastedited = Now
    >
    >works for the Orders but not for the child...


    Use the AfterUpdate event on the subform and use

    Parent!lastedited = Now

    John W. Vinson[MVP]
     
  5. lmv

    lmv
    Expand Collapse
    Guest

    THANKS A BUNCH!

    "John Vinson" wrote:

    > On Tue, 13 Jun 2006 12:34:02 -0700, lmv
    > <lmv@discussions.microsoft.com> wrote:
    >
    > >How do you put more than one code in an event
    > >Ie.
    > >on current
    > > =LockBoundControls([Form],True)
    > >=AutoFillNewRecord(Forms!OrdersWDetails)

    >
    > The event should show [Event Procedure], and you should edit the VBA
    > code to
    >
    > Private Sub <whatever the event name might be>()
    > Call LockBoundControls(Me, True)
    > Call AutoFillNewRecord(Forms!OrderWDetails)
    > End Sub
    >
    > >----------
    > >2nd question:
    > >
    > >How do I update the parent (Orders) lastedited field when I save the changes
    > >in the child OrderDetails.
    > >
    > >me.lastedited = Now
    > >
    > >works for the Orders but not for the child...

    >
    > Use the AfterUpdate event on the subform and use
    >
    > Parent!lastedited = Now
    >
    > John W. Vinson[MVP]
    >
     

Share This Page