Inheritance: Automatically creating superclass table entries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zagen
    New Member
    • Sep 2013
    • 2

    Inheritance: Automatically creating superclass table entries

    Hi,

    consider a simple hierarchy with cars and bicycles inheriting from vehicle. Every class gets it's own table with shared attributes residing in Vehicle anda 1:1 PK-relationship to the subclass tables.

    I wan't to create a MS Access form for creating cars.

    I created a simple form based on a query containing attributes of both Vehicle and Car.
    Due to auto-numbering in Vehicle a new vehicle record is autmatically created. Of course when entering data of Car-attributes, Access complains about not finding a corresponding ID in Car.

    How can I get Access to create it automatically?

    Thanks!
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Make the car a subform in a vehicle form and the subform will automatically create the record when you enter car info.

    Comment

    • Zagen
      New Member
      • Sep 2013
      • 2

      #3
      Thanks for the answer, but apparently it doesn't!
      Access requires a related record in Vehicle and doesn't add it on it's own.

      Although I have to say, I'm not that familiar with Access. I infer most of it from my general database knowledge.

      I tested with two basic forms based on related tables. Is there something else I have to configure?

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        please post the sql for the query that you are using for the form
        Please rememeber to format the SQL text by selecting it and then clicing on the [CODE/] format button.

        Comment

        Working...