473,507 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

storing data in a table

robin a
30 New Member
I am using access 2007. This is a training database in which classes are assigned to employees by their job title. I have the Class_Catalog table which stores all class information, including a job_title field. My problem is, now that I am importing data, I've found that since up to everyone in the company (450 people) are required to take many of these classes. I don't want to add the same class 450 times with each applicable job title because I don't think that's the smart way to do it and I don't want to bloat the database. I can't think of any other way to make sure classes get assigned to the proper job_titles.

I would appreciate any suggestions.
Sep 19 '12 #1
8 1825
robin a
30 New Member
I wanted to add that there are only 38 job titles. would making job titles a mutli-valued field work or would it complicate all of my queries?
Sep 19 '12 #2
Seth Schrock
2,965 Recognized Expert Specialist
From what I'm reading, I believe that you would want a table of job titles and a table of classes. Also, since each class could be assigned to multiple job titles and I'm assuming that each job title could be required to take multiple classes, you have a many to many relationship which requires a joining table. This would consist of the primary keys of the two tables. You then set the combination of those two fields as the primary key of the joining table. This would allow you to make all the assignments needed.
Sep 19 '12 #3
zmbd
5,501 Recognized Expert Moderator Expert
Seth is certainly on the right track here with normalizing the database. I've sent you a PM with several links that might prove helpfull
Sep 19 '12 #4
Seth Schrock
2,965 Recognized Expert Specialist
I wouldn't do a multi-valued field as it would really complicate your queries.
Sep 19 '12 #5
robin a
30 New Member
Seth,
Are you saying that after creating the join table, I would still add a lot of records to the class_catalog table? e.g. with a multivalued field it would look like this:

Class_ID Job_Title Class_Name
1 machine operator, handpacker, coach first aid

if it isn't multivalued it would look like this:

Class_ID Job_Title Class_Name
1 machine operator first aid
2 handpacker first aid
3 coach first aid
Sep 19 '12 #6
Seth Schrock
2,965 Recognized Expert Specialist
That is correct. The problem with the multivalued field is that if you would ever want to query the database to see what classes a certain job title, it would require a lot of coding. Even if you don't need that ability now, it is always best to design a database according to normalization rules. This allows you to add to your database without having to make major design changes to the existing database. Also, because the join table is just those two fields (occasionally there are more, but in this case there are only two) you don't have to worry about bloating the database. To save you from having to type everything, you can create a form based on the join table and use combo boxes to populate the table.

I believe I might have forgotten to mention adding the relationships between the three tables. Classes table related to the join table as one-to-many and job titles table related to the join table the same way.

Here is something else you can do to make it easier to add all of those combinations. Say you have a form for your classes based on the classes table and a form for your job titles based on the job titles table. We will name them frmClasses and frmJobTitles respectively. You would then create a form in datasheet view based on the join table. We will call it frmJoin. You would then put frmJoin on frmClasses as a subform. You can also do this on frmJobTitles. Because of the relationships, access will be able to automatically find the relationship between the main form and the subform form. This will make it so that you only have to add information to the one field instead of both.
Sep 19 '12 #7
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
What Seth and zmbd are saying is the "best practice" approach to the problem. People tend to think that the multivalued fields are nice to use, but if you look around a bit on the net, you will see that almost all seasoned access developers will tell you not to use that feature.
Sep 19 '12 #8
robin a
30 New Member
Thank you everyone. I now know NOT to use the multivalue data type. Turns out my existing design included a join table and it works well. I just don't like having to put in a class up to 40 times BUT, I do have a selection for ALL that assigns to every employee. Everyone's advice was very clear and helpful. Thank you everyone.
Sep 20 '12 #9

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

Similar topics

1
2469
by: Kevin Myers | last post by:
Hello, I'm an experienced application developer in some languages (including various SQL dialects), but have very little experience with MS Access or VBA, and am having trouble figuring out how...
2
2690
by: Brian Mitchell | last post by:
Ok, I know this is an elementary question but I have a data grid that is bound to a data table and I can't seem to find a way to match the selected row in the grid with it's respective row in the...
11
3425
by: Ron L | last post by:
I have a data table that lists a series of items in my database. In my user form, I want the user to be able to filter by a number of criteria (e.g. location, contract, date modified, etc). Other...
1
2764
by: John | last post by:
Hi When using Table Adapter Configuration Wizard if 'Use SQL Statements' is selected as Command Type, the data table's name in dataset is retained and only its data adapter's select statements...
5
2176
by: hfk0 | last post by:
Hi, I'm new to ASP.net, SQL Server and visual studio.net, and I'm having problem inserting and storing data from a web form to a SQL database. I created a simple ASP.NET web form, a simple SQL...
1
3472
by: laredotornado | last post by:
Hi, I have a data table on my page (buried amidst other images and extraneous text). I would like to spawn a new window that automatically prints the content of my data table, and only that...
4
2053
by: Falcolas | last post by:
I personally feel that it's a bad idea. I've got to convince managerial types of this. Would some of you mind posting comments for and against the concept of storing data in XML attributes? If...
1
1955
by: libish | last post by:
hi all.... can any one suggest me an idea for storing data in its record store.. like RMS in j2me. thanks in advance..
4
34445
by: indona | last post by:
hi, i have to enter data from a delimited file into sqlserver database table. i have been able to delimit the file and read the data into a data table, now i want enter the data table contents to...
1
2619
by: BaseballGraphs | last post by:
Hello, I am trying to divide one value from my data table with an associated ID by another value from my data table with a different ID for the same day that the value was added to the data table....
0
7223
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
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7034
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
7488
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...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.