469,086 Members | 1,141 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,086 developers. It's quick & easy.

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

Hi

my Data Base consist of the following tables:
Customers,Products, Suppliers,Orders,Orders_Details

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
May 13 '14 #1

✓ answered by jimatqsi

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

6 1566
JenZzz
9
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.
May 14 '14 #2
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
May 14 '14 #3
JenZzz
9
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!
May 14 '14 #4
jimatqsi
1,256 Expert 1GB
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
May 14 '14 #5
JenZzz
9
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!
May 14 '14 #6
jimatqsi
1,256 Expert 1GB
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
May 14 '14 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by r0adhog | last post: by
1 post views Thread by Don Stefani | last post: by
2 posts views Thread by Bill Hand | last post: by
1 post views Thread by Randy Lucero | last post: by
1 post views Thread by sunrisewinesalon | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.