473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Table layout for multiple product types

stonward
145 100+
Help! Please....it was all going so well, but then I had to add some new product types to my database design...

The (vast) majority of my system is based around the stock control/sales etc of TYRES. There are a number of different CATEGORIES of tyres, but all the fields for the types are naturally the same. Now I have to add batteries and an additional few SERVICES (punctures, tyre-removal, tyre-fitment) to the system.

I simply created a batteriesProduct table and a nonTyre product table, but this hasn't worked when I tried to update my point of sale and purchase forms.

I think the problem is the table layout. 'FishVal' has tried to help by advising adding small 'joining'(?) tables, but I can't quite grasp his concept. Can anyone help? This has really got me stumped this time!

Thanks Guys,

StonwardR :-(
Oct 4 '07 #1
22 3373
nico5038
3,080 Expert 2GB
One general approach is to have one "Master" producttable holding the general information like [ProductCode], [Price], [QtyOnHand], [VAT%], etc. and finally [ProductType].
Each producttype will have a linked table holding the [ProductCode] for linking and the additional fields that are specific for that ProductType, like Ampere for batteries, wheelsize for tyres, etc.

Getting this idea ?

Nic;o)
Oct 6 '07 #2
stonward
145 100+
Sorry Nico, I've only just seen this reply by your good self.

I've been digging deeply into this problem and have found other soultions that are much the same as yours (known as subclassing the table entities!). I tried it but it made making quotation/sales/purchasing forms very difficult to figure.

However, this is still a problem I have. Currently I've gone back to lumping them all together in one table and simply putting up with not using many fields in some instances.

It is necessary, you see, to be able to have (say) one of each product type on ONE invoice or quotation. This is a swine to work out!!

Any further help is gratefully and desperately grasped at!!

Stonward.
Oct 29 '07 #3
nico5038
3,080 Expert 2GB
Sorry Nico, I've only just seen this reply by your good self.

I've been digging deeply into this problem and have found other soultions that are much the same as yours (known as subclassing the table entities!). I tried it but it made making quotation/sales/purchasing forms very difficult to figure.

However, this is still a problem I have. Currently I've gone back to lumping them all together in one table and simply putting up with not using many fields in some instances.

It is necessary, you see, to be able to have (say) one of each product type on ONE invoice or quotation. This is a swine to work out!!

Any further help is gratefully and desperately grasped at!!

Stonward.
Having a "Master" table and ProductType "subclassed" tables, isn't hard on your forms, as long as you use a tabbed control per "subclass" table. The tab will then hold the ProductType and the subform is linked to the "Master" table by the unique MasterProductID.
The "Master" tablefields will show above the tabcontrol and are always visible for the user.

On a report you'll need to use per ProductType a different subreport, but by first sorting them on producttype this can be arranged in a decent way too.

When you use the "Mastertable with empty fields" solution, you'll still be able to use the tabcontrol to group the fields and only show the tab that's related to the ProductType of the Masterrecord. (Just make all other tabs invisible)

Grasping the "tab control approach" ?

Nic;o)
Oct 29 '07 #4
stonward
145 100+
Nic;o

Think I've got it...

The Main Form will use the main Product table for its source, and the form will have tab controls on, each of which will use a Product 'sub' table for its source...yes?

Gonna try it about now...

I'm seriously grateful for your help...I think this will be the last major hurdle of this (updated) system!

Thanks again.

Stonward.
Oct 29 '07 #5
nico5038
3,080 Expert 2GB
Keep me posted and don't hesitate to report here when you get stuck.

Success !

Nic;o)
Oct 29 '07 #6
stonward
145 100+
NICO!!!! Are you out there?! Help - pleeeease.

Havin' a swine of a time trying to get table relationships right to allow for three separate tables of 'product'. Do you remember helping b4? Can you help now?

Thanks

StonwardR
Nov 20 '07 #7
stonward
145 100+
Hi guys.

I'm (still) having a nightmare with arranging my tables...I have three very different product types, so I have tried creating three product tables linked by a productType table. But then I have no way of correctly linking to the sales and purchasing tables. I know this is known as subclassing, but (as yet) I can find no combination that will work!

Can anyone help with this?

StonwardR
Nov 20 '07 #8
Motoma
3,237 Expert 2GB
Hi guys.

I'm (still) having a nightmare with arranging my tables...I have three very different product types, so I have tried creating three product tables linked by a productType table. But then I have no way of correctly linking to the sales and purchasing tables. I know this is known as subclassing, but (as yet) I can find no combination that will work!

Can anyone help with this?

StonwardR
Hi stoneward,
You mistakenly posted your question to the Access Articles area of our site. I have bumped this thread to the Access Forum as I assume you will receive a greater response there.
Motoma
Nov 20 '07 #9
nico5038
3,080 Expert 2GB
Can you describe the tables as they are now ?

Nic;o)
Nov 20 '07 #10
nico5038
3,080 Expert 2GB
The basics would be to link the sales to the tblProductMain.
When detail info of the "subs" is needed you need to use an "OUTER" join.
Just link by the tblProductMain unique ID and click the connectionline to select option 2 or 3 to make the tblProductMain the "master" table.

Nic;o)
Nov 20 '07 #11
stonward
145 100+
Hi Nic;0,

I tried what you said, but can't seem to get the links right...I made a ProductType table to go with my 3 'products' tables, but i get an indeterminate relationship each time I try to link the sales/purchase details to the ProductType table.
Nov 21 '07 #12
stonward
145 100+
Oops! Sorry motoma....Things appear to have changed a little here at the Scripts...

Stonward
Nov 21 '07 #13
stonward
145 100+
Hi Nic;o,

Sorry, but I seem to be talking 'at' you from two different posts!

I am currently trying two avenues, one with three separate 'product' tables linked to a ProductType 'main' table. The other way is to go back and try and put all my products into one table. Both I can't seem to get right. Um, wots the easiest way to explain my table layouts?

StonwardR
Nov 21 '07 #14
NeoPa
32,556 Expert Mod 16PB
If you have three types of products then you need a table (tblProductMain) with a field in it to indicate the type.
Nov 21 '07 #15
stonward
145 100+
Hi NeoPa,

Yep, I think i get that, but how do i link my sales/purchasing tables - thru the productType table, or direct to the separate product tables? If to the 'main' product table, then what field can I use?

Thanx for your help - this prob is really giving me jip now!

StonwardR
Nov 21 '07 #16
nico5038
3,080 Expert 2GB
The ProductType can be a field in the "main" producttable.
This ProductType can be used to determine which fields are available of the linked tables.
Linking main with sub is done with the unique ID of the main table. Each sub will hold the main ID and it's own ID.

Clearer?

Nic;o)
Nov 21 '07 #17
stonward
145 100+
Hi Nic;O,

Yep i get, and have done that - but I have problems linking the Purchase/Sale Details table(s)...If I use the ProductTypeID, that doesn't tell me WHAT product is being sold/bought....See my prob?

StonwardR
Nov 22 '07 #18
NeoPa
32,556 Expert Mod 16PB
Hi NeoPa,

Yep, I think i get that, but how do i link my sales/purchasing tables - thru the productType table, or direct to the separate product tables? If to the 'main' product table, then what field can I use?

Thanx for your help - this prob is really giving me jip now!

StonwardR
The main point that I was trying to get across is that there are NO separate product tables. There is no need to separate the items into different tables. Simply include them all in the same table and include an extra field to flag each record as one of the three different types.

As far as linking into (or from) the sales and purchasing tables is concerned, I expect they would want to link to the Product code in the main (single) Product table.
Nov 22 '07 #19
stonward
145 100+
I see,...got 2 remember all what I have tried now. I originally used that very idea, using ONE products table, but with a Categories (type) field. The problem I have is when I have more than one type of product in one sale (on one invoice)...but I'm gonna go back and try it again now.

Thanx for your help.

R
Nov 22 '07 #20
NeoPa
32,556 Expert Mod 16PB
If you have multiple products on an order (sales or purchase) then it is necessary to have an Order Header table as well as a linked Order Details table. Each product would go on an Order Detail record. If you try to bundle them all together by having multiple products per Order record you will certainly have problems as the structure of your concept does NOT match the structure of your situation.
Have a look at Normalisation and Table Structures.
This may be a lot to take on for you now - but with it you will avoid many future issue. Without it I'm afraid the reverse is true. Expect various problems to occur unless you have this basic understanding of how to organise your data.
Nov 22 '07 #21
stonward
145 100+
Of course...

I've had that down for some time now (although I don't yet grasp SELF joins!)...and I have Sales/Purchase DETAILS tables because of the many
:many join that would otherwise occur.

This problem arose when the guy who needs this database suddenly required the ability to 'sell' more than one type of product at one time, in addition to adding some services to the product range...

I've got a couple of new ideas to try,...I'll get the details straight in my mind, then come back to you with an accurate explanation of the problem.

Thanks, Guys!

R

(I promise it's nothing so very simple tho...!)
Nov 22 '07 #22
NeoPa
32,556 Expert Mod 16PB
That's fine R.
We have very little clue as to how advanced a question (or questionner) is on here. We get the full range of course. I wasn't trying to imply you were less advanced than you clearly are :)
Nov 22 '07 #23

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

Similar topics

61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
1
by: sbnj | last post by:
I have an existing database up and running great but im looking to ad some new features. I currently import a "new orders" file everyday the file contains order #, item #, qty ordered etc... when...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
4
by: Deus402 | last post by:
I am designing an employer database, and I had thought that my tabledesign was pretty sound, but a new revelation has ruined my design. What I guess i really need is a way to uniquely identify...
5
by: Jeff User | last post by:
Hi all I am writing program/framework to server a web site dynamically based on stored web page data with C#, .net1.1 What is the preferred means of controlling page layout, frames or...
4
by: Bob | last post by:
Hi all, I've got a table that I've imported and it has junk at the top of the table, so after import I run a delete query to remove the junk lines then I'm left with the field names I want for...
3
by: binita2908 | last post by:
Hi guys , I am quite a baby to sql , pls help me out in this . My database scheme consists of four relations: Product(maker, model, type) PC(code, model, speed, ram, hd, cd, price)...
3
by: randy.buchholz | last post by:
I'm trying to standardize a layout methodology for our agency and am looking for some guidance. Most of the applications are basic store and retrieve types, and extensively use a DetailsView type...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.