Update Query Issues

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe.Mobley@nationalexpress.com

    #1

    Update Query Issues

    All,

    When you sell a product we require access to remove that information
    from the stock table, so the product is sold througha comobo box named
    "Combo4" under the prodcuts sold form which is a sub-form of the form
    Appointments.

    When creating the update query I used the [UnitsInStock]-1 to redcue
    the number of avaliable items in stock, but Access prompts for the name
    of the item you wish to remove, so how do you tell Access to get this
    from the sub-form values, I thought it was:

    Prodcuts Sold Form.ProductID. Combo4

    But this does not work, also there are mutiple items, so we would like
    one query for all the items sold when you click on the save button

  • Wayne Morgan

    #2
    Re: Update Query Issues

    To refer to a control on a subform, you first have to refer to the Parent
    form, then the subform control on the Parent. The subform isn't "open" as a
    stand alone form, so you can't refer to it directly by name. Also, names
    with spaces in them will need to be enclosed in brackets [ ].

    Example:
    Forms!frmNameOf ParentForm!ctlN ameOfSubformCon trol.Form!Combo 4

    The subform control may or may not have the same name as the subform itself.
    To get the name of the subform control, open the parent form in design mode,
    open the Properties sheet, and click on the subform ONE time. The Properties
    sheet should show the name of the subform control. If you click more than
    once, you'll be in the subform and the Properties sheet will show the name
    of the subform or one of its controls.

    --
    Wayne Morgan
    MS Access MVP


    <Joe.Mobley@nat ionalexpress.co m> wrote in message
    news:1109058197 .136252.101480@ c13g2000cwb.goo glegroups.com.. .[color=blue]
    > All,
    >
    > When you sell a product we require access to remove that information
    > from the stock table, so the product is sold througha comobo box named
    > "Combo4" under the prodcuts sold form which is a sub-form of the form
    > Appointments.
    >
    > When creating the update query I used the [UnitsInStock]-1 to redcue
    > the number of avaliable items in stock, but Access prompts for the name
    > of the item you wish to remove, so how do you tell Access to get this
    > from the sub-form values, I thought it was:
    >
    > Prodcuts Sold Form.ProductID. Combo4
    >
    > But this does not work, also there are mutiple items, so we would like
    > one query for all the items sold when you click on the save button
    >[/color]


    Comment

    Working...