Superclass have only a autonumber.. is it possible?

Discussion in 'Microsoft Access Database Table Design' started by Micke__1, Mar 7, 2010.

  1. Micke__1

    Micke__1 Guest

    Work with IT for many years, and have lately begun looking into DB and MS
    Access. So Im quite a rookie in this area. :)

    Ok,
    Got a superclass named table1. That class has only one attribute, an ID
    which is an auto number.

    Then I have to subclasses called table2 and table3. They have the foreign
    key to ID, and a couple of other attributes.

    When I add a instance to my table2, I want it to add a new auto number in my
    superclass, table1. eg a new instance in table1.Is this possible at all?

    It seems that I need to first add to table1, and after that use that id in
    table2 or table3, and that is not possible here.

    any advice here?

    br
    Micke
     
    Micke__1, Mar 7, 2010
    #1
    1. Advertisements

  2. Micke__1

    Jeff Boyce Guest

    Since the value in table2 involves a foreign key pointing back to a record
    in table1, oh wait, you don't have a record in table1 yet!

    Yes, by all means, start the record in table1, then finish table2 details.

    --

    Regards

    Jeff Boyce
    Microsoft Access MVP

    Disclaimer: This author may have received products and services mentioned in
    this post. Mention and/or description of a product or service herein does
    not constitute endorsement thereof.

    Any code or pseudocode included in this post is offered "as is", with no
    guarantee as to suitability.

    You can thank the FTC of the USA for making this disclaimer
    possible/necessary.

    "Micke__1" <> wrote in message
    news:...
    > Work with IT for many years, and have lately begun looking into DB and MS
    > Access. So Im quite a rookie in this area. :)
    >
    > Ok,
    > Got a superclass named table1. That class has only one attribute, an ID
    > which is an auto number.
    >
    > Then I have to subclasses called table2 and table3. They have the foreign
    > key to ID, and a couple of other attributes.
    >
    > When I add a instance to my table2, I want it to add a new auto number in
    > my
    > superclass, table1. eg a new instance in table1.Is this possible at all?
    >
    > It seems that I need to first add to table1, and after that use that id in
    > table2 or table3, and that is not possible here.
    >
    > any advice here?
    >
    > br
    > Micke
     
    Jeff Boyce, Mar 7, 2010
    #2
    1. Advertisements

  3. Micke__1

    Piet Linden Guest

    Piet Linden, Mar 9, 2010
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page