Welcome to SPN

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

Sign Up Now!

Inserting values in a subform

Discussion in 'Information Technology' started by Bob Richardson, Nov 8, 2005.

  1. Bob Richardson

    Bob Richardson
    Expand Collapse
    Guest

    How can I insert values into some fields of a subform.

    In the typical Customer-Order-Item situation, when the user wants to enter a
    new Order I want to be sure that it's an order for the customer shown in the
    main form. Likewise, when I add a new item to the order, I need to be sure
    the customer and order numbers are transferred to the Item record. In my
    arrangement, I have a main form with a subform that holds another subform (a
    datasheet for all the items on the order).
     
  2. Loading...


  3. [MVP] S.Clark

    [MVP] S.Clark
    Expand Collapse
    Guest

    Please examine the Northwind database, and feel free to post how your needs
    differ from that solution.

    I think the answer is the fact that the Link Child Fields and Link Master
    Fields should do the work for you between the Main and Subform, but if not,
    you can always execute a SQL statement in code to append a record to the
    table.

    e.g.
    currentdb.execute "Insert Into TableName ...

    --
    Steve Clark, Access MVP
    http://www.fmsinc.com/consulting

    "Bob Richardson" <bobr at whidbey dot com> wrote in message
    news:NIudnUAKWpwIze3enZ2dnUVZ_tWdnZ2d@whidbeytel.com...
    > How can I insert values into some fields of a subform.
    >
    > In the typical Customer-Order-Item situation, when the user wants to enter
    > a new Order I want to be sure that it's an order for the customer shown in
    > the main form. Likewise, when I add a new item to the order, I need to be
    > sure the customer and order numbers are transferred to the Item record. In
    > my arrangement, I have a main form with a subform that holds another
    > subform (a datasheet for all the items on the order).
    >
     
  4. Bob Richardson

    Bob Richardson
    Expand Collapse
    Guest

    Looking at the Northwind db I see that the Customer Orders Form is very
    close to what I'm trying to do. My problem is, how do I bind the forms so
    that when I click on an order in the datasheet view in the upper sub form,
    it shows the detail for the order in the lower subform?


    "[MVP] S.Clark" <steve.clark_NOSPAM@FMSInc.com> wrote in message
    news:e6U3v5G5FHA.2560@TK2MSFTNGP12.phx.gbl...
    > Please examine the Northwind database, and feel free to post how your
    > needs differ from that solution.
    >
    > I think the answer is the fact that the Link Child Fields and Link Master
    > Fields should do the work for you between the Main and Subform, but if
    > not, you can always execute a SQL statement in code to append a record to
    > the table.
    >
    > e.g.
    > currentdb.execute "Insert Into TableName ...
    >
    > --
    > Steve Clark, Access MVP
    > http://www.fmsinc.com/consulting
    >
    > "Bob Richardson" <bobr at whidbey dot com> wrote in message
    > news:NIudnUAKWpwIze3enZ2dnUVZ_tWdnZ2d@whidbeytel.com...
    >> How can I insert values into some fields of a subform.
    >>
    >> In the typical Customer-Order-Item situation, when the user wants to
    >> enter a new Order I want to be sure that it's an order for the customer
    >> shown in the main form. Likewise, when I add a new item to the order, I
    >> need to be sure the customer and order numbers are transferred to the
    >> Item record. In my arrangement, I have a main form with a subform that
    >> holds another subform (a datasheet for all the items on the order).
    >>

    >
    >
     
  5. Bob Richardson

    Bob Richardson
    Expand Collapse
    Guest

    I have the Link Child fields at:
    OrderNo

    and the Link Master Field at
    [Subform1].Form![OrderNo]

    My Subform1 shows the correct orders in a dataview for the selected
    customer. My subform2 shows the form corr3ectly, but all the data is blank.
    Help!



    "Bob Richardson" <bobr at whidbey dot com> wrote in message
    news:-ZOdnSTx2vjZdO3enZ2dnUVZ_tqdnZ2d@whidbeytel.com...
    > Looking at the Northwind db I see that the Customer Orders Form is very
    > close to what I'm trying to do. My problem is, how do I bind the forms so
    > that when I click on an order in the datasheet view in the upper sub form,
    > it shows the detail for the order in the lower subform?
    >
    >
    > "[MVP] S.Clark" <steve.clark_NOSPAM@FMSInc.com> wrote in message
    > news:e6U3v5G5FHA.2560@TK2MSFTNGP12.phx.gbl...
    >> Please examine the Northwind database, and feel free to post how your
    >> needs differ from that solution.
    >>
    >> I think the answer is the fact that the Link Child Fields and Link Master
    >> Fields should do the work for you between the Main and Subform, but if
    >> not, you can always execute a SQL statement in code to append a record to
    >> the table.
    >>
    >> e.g.
    >> currentdb.execute "Insert Into TableName ...
    >>
    >> --
    >> Steve Clark, Access MVP
    >> http://www.fmsinc.com/consulting
    >>
    >> "Bob Richardson" <bobr at whidbey dot com> wrote in message
    >> news:NIudnUAKWpwIze3enZ2dnUVZ_tWdnZ2d@whidbeytel.com...
    >>> How can I insert values into some fields of a subform.
    >>>
    >>> In the typical Customer-Order-Item situation, when the user wants to
    >>> enter a new Order I want to be sure that it's an order for the customer
    >>> shown in the main form. Likewise, when I add a new item to the order, I
    >>> need to be sure the customer and order numbers are transferred to the
    >>> Item record. In my arrangement, I have a main form with a subform that
    >>> holds another subform (a datasheet for all the items on the order).
    >>>

    >>
    >>

    >
    >
     

Share This Page