473,419 Members | 2,060 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,419 software developers and data experts.

Breaking Table Norms

blyxx86
256 100+
Does this break the normalization of tables??

I have the following tables:

tblLocation
LocationID
LocationCode
AttnTo
Address1
Address2
Address3
City
State
Zip
Phone

tblAcq
AcqID
TrackingNumber
PONumber
AcqDate
LocationID
LocationCode
AttnTo
Address1
Address2
Address3
City
State
Zip
Phone
etc..

tblInvoice
InvoiceID
TrackingNumber
SONumber
InvoiceDate
LocationID
LocationCode
AttnTo
Address1
Address2
Address3
City
State
Zip
Phone
etc..

Now, I have these tables and when the user enters a valid LocationCode it populates the rest of the fields with the information that is available in tblLocations. I wanted to do this so that the user could change the Address/AttnTo if they needed, but does it break the normalization of my tables?

I am also going to lock the information in these fields once a TrackingNumber has been put in so that the information cannot be changed accidentally (or intentionally). I know I can do this with an OnCurrent event and that is not my issue.

Any thoughts on this?

Thanks!!

This is the code that I use to update the fields. I'm still working on the whole "Me.Undo" part, because I really only want to undo the change made to the LocationCode field, but when I try Me.LocationCode.Undo (which it allows) it doesn't perform any action.

Expand|Select|Wrap|Line Numbers
  1. Private Sub LocationCode_BeforeUpdate(Cancel As Integer)
  2.     Dim db As DAO.Database          'CurrentDb()
  3.     Dim rs As DAO.Recordset         'Various recordsets.
  4.     Dim strSQL As String            'SQL Clause
  5.     Dim intStoreNum As Integer
  6.     Dim strLocCode, strLocName, strAttn, strAdd1, strAdd2, StrAdd3, strCity, strState, strZip, strPhone, strFax As String   'Address Clause
  7.     Set db = CurrentDb
  8.  
  9.     strSQL = "SELECT tblLocations.CustomerID, tblLocations.LocationCode, tblLocations.StoreNumber, tblLocations.LocationName, " & _
  10.             "tblLocations.AttentionTo, tblLocations.Address1, tblLocations.Address2, tblLocations.Address3, tblLocations.City, " & _
  11.             "tblLocations.State, tblLocations.Zip, tblLocations.Phone, tblLocations.Fax " & _
  12.             "FROM tblLocations " & _
  13.             "WHERE (((tblLocations.CustomerID)=" & Me.CustomerID & ") AND ((tblLocations.LocationCode) = " & """" & Me.LocationCode & """" & "));"
  14.  
  15.     Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
  16.         With rs
  17.             If .RecordCount = 1 Then
  18.  
  19.             'Store the values in the query to memory.
  20.                 strLocCode = "" & !LocationCode & ""
  21.                 intStoreNum = !StoreNumber
  22.                 strLocName = "" & !LocationName & ""
  23.                 strAttn = "" & !AttentionTo & ""
  24.                 strAdd1 = "" & !Address1 & ""
  25.                 strAdd2 = "" & !Address2 & ""
  26.                 StrAdd3 = "" & !Address3 & ""
  27.                 strCity = "" & !City & ""
  28.                 strState = "" & !State & ""
  29.                 strZip = "" & !Zip & ""
  30.                 strPhone = "" & !Phone & ""
  31.                 strFax = "" & !Fax & ""
  32.  
  33.             'Set the text boxes to the values found in the query.
  34.                 StoreNumber = intStoreNum
  35.                 LocationName = strLocName
  36.                 AttentionTo = strAttn
  37.                 Address1 = strAdd1
  38.                 Address2 = strAdd2
  39.                 Address3 = StrAdd3
  40.                 City = strCity
  41.                 State = strState
  42.                 Zip = strZip
  43.                 Phone = strPhone
  44.                 Fax = strFax
  45.  
  46.             Else 'What happens if a record cannot be found
  47.                 MsgBox "The previous address was saved since no record could be found for:" & vbCrLf & LocationCode, vbOKOnly + vbInformation
  48.                 Me.Undo
  49.             End If
  50.         End With
  51.  
  52.         rs.Close 'Close the recordset
  53. End Sub
  54.  
Aug 27 '07 #1
7 1454
mlcampeau
296 Expert 100+
deleted post and reposted in post #3 as it did not show up the first time
Aug 27 '07 #2
mlcampeau
296 Expert 100+
In tblAcq and tblInvoice you should only have LocationID to link each AcqId and InvoiceID to the Location information. It breaks normalization to store the same information in more than one place. Check out this article:
http://www.thescripts.com/forum/thread585228.htm
Aug 27 '07 #3
blyxx86
256 100+
That makes sense now that I've been thinking about it.

Would storing different AttnTo values be breaking normalization? Our database at my work is a mess of a database and I'm trying to fix the mistakes being made. This one became so common I questioned if it was correct or not. Phew! Glad I came out of this one.

It seems the people who created the original database didn't understand any type of RDBMS, but they created 700 tables somehow!

I will definitely just use the LocationID (as you can see it was being used, but I was just trying to store the information somewhere in case changes needed to be made.) However, changes should be made at the tblLocation part.

Okay then, how would you handle this...

A request is made to ship to a certain store, let's call it Acme #105.
A shipment is made against that request, but it's shipped to Acme #501 due to a human error, but the information entered into the database is Acme #105. What would be the best way (besides removing humans from the scenario) to accurately track this type of error. Any input on that?
Aug 30 '07 #4
mlcampeau
296 Expert 100+
That makes sense now that I've been thinking about it.

Would storing different AttnTo values be breaking normalization? Our database at my work is a mess of a database and I'm trying to fix the mistakes being made. This one became so common I questioned if it was correct or not. Phew! Glad I came out of this one.

It seems the people who created the original database didn't understand any type of RDBMS, but they created 700 tables somehow!

I will definitely just use the LocationID (as you can see it was being used, but I was just trying to store the information somewhere in case changes needed to be made.) However, changes should be made at the tblLocation part.

Okay then, how would you handle this...

A request is made to ship to a certain store, let's call it Acme #105.
A shipment is made against that request, but it's shipped to Acme #501 due to a human error, but the information entered into the database is Acme #105. What would be the best way (besides removing humans from the scenario) to accurately track this type of error. Any input on that?
I think it would be fine to store different AttnTo's. Keep in mind that I'm fairly new to database design (despite my status being Expert) but I can't really think of another way to keep track of it. Unless you made another table but that seems redundent. I could be wrong on that though.
As for tracking human errors...it's exactly that, a human error, so I'm not sure how one would keep track of that in the system. Maybe when your shipment is made, have the shipper or the receiver on the other end fill out a "Shipped To" portion and then have that input into the system. I would assume the shipper or the recipient of the product would know they are at Acme #501 rather than Acme #105 so if that got marked down, it could get input, then you could run a query where the ShippedTo Location doesn't match the tblInvoice Location.
Aug 30 '07 #5
blyxx86
256 100+
I can't think of another way to do it either.

I do know our current system at work (which is primarily used for Asset Management) doesn't do any sort of Asset Managing, hardly any inventory control and it requires manual inventory counts daily to accurately determine in-house equipment. So guess who's leading the way of the ideology that "Equipment In-House = Received - Shipped" haha.

I devised another way to go about the "human error." Instead of having the shipper enter the information by hand (thus transposing numbers) I am going to update the address books in the shipping stations so that it corresponds to the LocationCode (which is an Indexed field that allows no duplicates) and then on any sort of shipping request place a bar code that can be scanned into the shipping computer. Voila! If there are any errors at that point then it is checked against the request (done by data entry clerks) from the customer. Customer's make mistakes sometimes too.

I do like the idea of creating a query that the tblRequest.LocationID is not the same as the tblInvoice.LocationID. So that will help in the future.

Now I must devise a way to keep track of length of time spent on any particular case/request/phone call. Talk about a massive database lesson... I've only started using databases for little over 9 months and I'm taking on the task of creating a system for a corporation.
Aug 30 '07 #6
mlcampeau
296 Expert 100+
I devised another way to go about the "human error." Instead of having the shipper enter the information by hand (thus transposing numbers) I am going to update the address books in the shipping stations so that it corresponds to the LocationCode (which is an Indexed field that allows no duplicates) and then on any sort of shipping request place a bar code that can be scanned into the shipping computer. Voila! If there are any errors at that point then it is checked against the request (done by data entry clerks) from the customer. Customer's make mistakes sometimes too.
That's a good idea!

Now I must devise a way to keep track of length of time spent on any particular case/request/phone call. Talk about a massive database lesson... I've only started using databases for little over 9 months and I'm taking on the task of creating a system for a corporation.
Good luck with the rest of your project. I'm new at working on databases too so I sympathize with you. If you have any more questions, there's lots of experts here who can help!
Aug 31 '07 #7
blyxx86
256 100+
Thanks!

I've offered some of my own knowledge to some others here, just reading up on some random topics I know much about.

Hopefully it all goes well for you too!
Sep 1 '07 #8

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

Similar topics

1
by: Laphan | last post by:
Hi Guys I don't want to keep asking for your help all the time on each individual query, so could you please help me to break the myths on the following: 1) I have 2 tables. Once is called...
0
by: MarionEll | last post by:
--------------------------------------------------------- ************* Call for Participation ************** ************ Late Breaking News ************* *********** Extreme...
3
by: The Bear | last post by:
I hope I can get this across clearly. I have a table that needs to be broken into 3 tables. Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col1 and Col2 need to go into LookupTable1 Col3 and Col4 into...
87
by: Frances Del Rio | last post by:
is there a non-breaking hyphen in HTML?? for example, so a phone no. falls all on one line.. as in.. 1-800-444-5454... (and is not broken into two lines if phone no. occurs near end of a...
27
by: The Bicycling Guitarist | last post by:
Hi. I found the following when trying to learn if there is such a thing as a non-breaking hyphen. Apparently Unicode has a ‑ but that is not well-supported, especially in older browsers. Somebody...
22
by: stevenkobes | last post by:
If a word has a hyphen in it, IE will permit a line break at the hyphen, but Firefox/Mozilla won't. Apparently the Firefox behavior is standards-compliant, but it is not what I want. Is there a...
4
by: John Wood | last post by:
I saw that Microsoft have released a list of breaking changes in .Net here: http://msdn.microsoft.com/netframework/programming/breakingchanges/runtime/default.aspx While this is useful, it seems...
4
by: Rubin | last post by:
1) I want to show a breaking hyphen in Mozilla 1.5.0.4 How do I do that? "Unicode standard annex #14", <http://www.unicode.org/reports/tr14/>, defines 4 breaking hyphens. <quote> Breaking...
20
by: hippomedon | last post by:
Hello everyone, I'm looking for some advice on whether I should break the normalization rule. Normally, I would not consider it, but this seems to be a special case. I have created an...
21
by: array7 | last post by:
I have been reading a lot of archived threads about "page-break- inside: avoid" not supported by IE5, IE6 IE55, IE7 and Firefox (Mozilla), which creates a really unpleasant-looking printout with...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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
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...

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.