Creating a simple form to Add new records to the table Orders

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abadaysheker2
    New Member
    • May 2014
    • 7

    Creating a simple form to Add new records to the table Orders

    Hi

    my Data Base consist of the following tables:
    Customers,Produ cts, Suppliers,Order s,Orders_Detail s

    the relationships are as follow

    Customers-Orders ( one to Many relational field customer-id)
    Supplier-Products(one to many relational field supplier-id)
    orders-orders_Details( one to many relational field order-id)

    I have the information of my orders divided in 2 tables (orders, orders-details). the fields of the orders tables are the Order-id customer-id, Date. the Fields of the orders-details
    are ID(primary key),Order-ID, customer-id,Product-id,quantity, in this table each product from each order gets his own record.

    I'm trying to build a simple form, in order to introduce new orders,when i do the form the form displays the information correctly, but when i try to add a new record the customer-id of the form(orders) and the customer-id of the sub-form(Orders-details) doesn't match, allowing me to introduce details to a different customer
  • JenZzz
    New Member
    • May 2014
    • 9

    #2
    If you are trying to create a form on which you can add records to multiple tables at once, use an unbound form and multiple recordsets.
    If not, please be more specific.

    Comment

    • abadaysheker2
      New Member
      • May 2014
      • 7

      #3
      Yes i'm trying to create a form to add records to the orders table and the orders-details table.

      can you explain me how to create the unbound form with details, because i'm new into access
      thanks

      Comment

      • JenZzz
        New Member
        • May 2014
        • 9

        #4
        A form is unbound when the 'record source' of the form is empty. You can check this in the data tab of the propertysheet.

        Creating the form itself is simple. In the create tab above you can start by creating a blank form et voila.
        Next, go into design view and after creating some textboxes you can enter the Visual Basics Editor.

        Assuming you have basic knowledge in visual basic, you can start asigning the values in the textboxes to the appropriate fields in the tables. Explaining how to create unbounds forms from scratch however is going to take a bit much of my time.

        I'd suggest you start creating the Form itself and just see how far you will come using your imagination (And google!) :). You can always come back and ask something more specific!

        Good luck!

        Comment

        • jimatqsi
          Moderator Top Contributor
          • Oct 2006
          • 1290

          #5
          abadaysheker2,
          It sounds like you do not have the links between the forms established. When you click once on the subform look at the properties Data tab. You will see child and master links. You can set those so the customer ID of the master links to the equivalent ID of the sub-form. You may need more than one field to make the link, no problem, several can be used.

          Jim

          Comment

          • JenZzz
            New Member
            • May 2014
            • 9

            #6
            Am I correct in saying that depending on whether or not you are trying to make a multi-user enviroment you either choose an Unbound Form for multiple users or a Bound form for a single user? Depends on the use for your database, abadaysheker2!

            Comment

            • jimatqsi
              Moderator Top Contributor
              • Oct 2006
              • 1290

              #7
              Normally bound forms are the way to go. Especially for the new Access developer. Unbound forms require manual code to populate each object on the screen. It also means you cannot work with a continuous form, only Single forms.

              Spend some time with the sample database, Northwind.mdb. There's lots and lots of good examples in there. You should be able to find it under your Help menu.

              Jim

              Comment

              Working...