update default from table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • madeleine.macphail@lmco.com

    #1

    update default from table

    All

    I would most appreciate some help for my sudden brain death. It's been
    a longtime since I did Access and I am extremely rusty, so please bear
    with me. I'm currently attempting to have a field with a default value
    which comes from another table.

    Basically it can be matched by the fact that there is a paper number, a
    subsystem number, and a phase number the field can then be matched by
    having the same name in a different table.

    so mycbtweighting = defaultcbtweigh ting where mypaper and mysubsystem
    and myphase = paper and subsystem and phase in default table.

    I really really cannnot work out how to do this, syntactically or even
    whether I do it in sql or just in the default in design view or in the
    expression builder in design view, or even somehow doing it in visual
    basic. Can someone help?

    Thanks

    Madeleine

  • Rick Wannall

    #2
    Re: update default from table

    I'm not aware of any way that you can specify in the design of an Access
    table that the default value for MyTable1.MyFiel d1 should come from
    MyTable2.MyFiel d2.

    If you're adding records by using a form, you can run some VBA code to
    retrieve that value you're looking for based on the value supplied in the
    record you're adding. Then apply that value to the new record. If you're
    adding via bound form I believe you can set the control value in the form's
    BeforeUpdate event. If you're adding via a recordset, you just update the
    field like any other field before you save the new record.

    Comment

    • madeleine.macphail@lmco.com

      #3
      Re: update default from table

      Thanks Rick, sorry about delayed response I got hauled off to work on
      something else.

      Rick Wannall wrote:
      I'm not aware of any way that you can specify in the design of an Access
      table that the default value for MyTable1.MyFiel d1 should come from
      MyTable2.MyFiel d2.
      >
      If you're adding records by using a form, you can run some VBA code to
      retrieve that value you're looking for based on the value supplied in the
      record you're adding. Then apply that value to the new record. If you're
      adding via bound form I believe you can set the control value in the form's
      BeforeUpdate event. If you're adding via a recordset, you just update the
      field like any other field before you save the new record.

      Comment

      Working...