Hi rollerz....have been trying to send you a database all morning..but i've got limits on file attactchments all over the show...so i'll try and help first!!
(am novice myself...but have been where you are a few months ago!)
* n.b Firstly your form should be linked to your orders table!!! as you needed to get the fields from somewhere!!
Firstly the form must be produced only after you have created rational and relevant tables
Tables:
Customer : (Customer ID, Company Name, Customer Address etc…..
Products: (Product ID, Product Name, Price, Description etc….
Orders: (Order ID, Customer ID, Order Date, Distribution Date etc….
Order Details (Detail Id, OrderID, ProductID, Price, Quantity etc (this will be your subform.) within your orders table
Primary Keys can be autonumbers unless you need them logically something else
What you need to do is create your tables logically and relevantly as above (ii take it you understand the functionality of primary and foreign keys??....(be honest if you don’t!)
When you create these tables you can do so in design view….selecting the relevant data types and validations for you (if you leave the validations etc. as default we can address them later)
When you have made your tables look at the ‘relationship window’ and create the relevant joins (simply lets you see exactly what your doing.)
When I say joins you can join the customer ID in the customer table to the Customer ID in the Orders table (enforce referential integrity ..this is a checkbox option when you create a join)
When you have a foreign key (the primary key from another table)in your tables, this is used to allow you to bring data through from that table…e.g just product ID can bring the product name and price in etc..
I use this code….
Say I wanted the product ID in the Order Details to allow the user to see the product name ..i’d do the following….
I’d go to my field Product ID (in design view of order details)…Press the lookup tab (at the bottom of the screen)
Choose display control..Combo Box (row/sourcetype table/query)
For row source you can use/modify this code
SELECT DISTINCTROW [ProductID],[ProductName] FROM Products ORDER BY [ProductName];
This will bring this up….
Do this for all foreign keys
e.g to show customer name in orders...
(this will also create a drop down list for users to choose from)
SELECT DISTINCTROW [CustomerID],[CompanyName] FROM [Customers] ORDER BY [CompanyName];
Etc…
Get back to me….we’ll do this stage by stage.
Unles anyone else on the board has a better solution
Sarah
...
Let me know if anything doesn't make sense. I know i'm not great at explaining stuff!!
