473,473 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Freezing a data element that may change downstream

67 New Member
MS Access is great for relational databases. However, I have a unique problem from a client. Constructing a basic retail database, I had designed a customer table and an invoice table. The latter drew address info from the former table. However, my client is concerned that if a customer changes his address down the road, he will not have a record of where the original invoice was sent.
As such, he wants me to place the address data in both tables and "freeze" the info in the invoice table.
Any suggestions how I can limit the data entry, and bring the address info, at the time of creaing the Invoice record from the Customer table, and then "freezing it" so that it will not change if the Customer table gets updated at a later date.
Thanks for the assist.
May 27 '10 #1
3 1404
Jim Doherty
897 Recognized Expert Contributor
@Bigdaddrock
Depending on how sophisticated you want to be with the design of this the general principle should be that all structured physical addresses are stored in their own table and referenced by a Unique Primary key.

Yes I know many databases exist 'out there' where the Address1, Address2, Town, City, ZipCode fields and so on are kept in the customer table however, that type of design is essentially flawed for the very reasons you highlight. More often than not this invites one to copy over the data to the invoice table through some automated routine or other, thereby keeping statically stored data denormalised data throughout your system.

The primary key only of a structured address should be stored with a customer. It is logically correct that customers could have 'one' or indeed 'many' home addresses over time (or indeed many home addresses at the same time depending on how rich they are or how mobile they are)

The design of a system should reflect the capability to store one or many addresses against a person at any one time for the purposes of any individual transaction such as raising an invoice.

The primary key of any address table has an obvious relationship with customer table but the address table also has a relationship with the invoice table namely the address used for the invoice at the time the invoice is raised.

By keeping these entities separate at this level eradicates the problem as you experience.The invoice table should have the CustomerID and CustomerAddressID (and maybe even DispatchAddressID depending on your type of business need).

If this is a new build then the design needs to be looked at again. If this is a pre-built system at an advanced stage then your response may indeed be limited to forcing over individual address data from the customers table to the invoice table leaving the system design alone. . This is a simple enough affair but I feel it only right to point out what I consider to be the right way first.. to see if anything can be redeemed in the design
May 28 '10 #2
Bigdaddrock
67 New Member
@Jim Doherty
Wow, thanks for the rapid response. I suspected that to be the case, but was hoping I was wrong. Ok, so since memory is not a factor (it is now so cheap) I am concerned with human error in keying in the street, city, state etc, twice for a customer - once into the Cust file and once into the Invoice file.
Any suggestions on how I can "autopopulate" those fields on the latter file's "new record" form, though giving the data entry person the ability to change it to reflect a different address?
The system is an old dbase IV database and I am bringing it up to MS Access.
Thanks again for your assistance.
May 28 '10 #3
Jim Doherty
897 Recognized Expert Contributor
@Bigdaddrock
If you take heed of he design approach I mentioned this should not be an issue. You should have a facility in your design (if you are not calling upon a prepopulated commercial addressing system) to create an address only ONCE. Once this address is created it should have a Unique primary key to identify it.

It is the Unique key you only ever use to populate tables. For instance inso far as your invoice is concerned you would create a query and have the invoice table in it. You then create a join between the invoice table and the Address table based on the unique key. You then drag into the grid the fields from the address table.

The same goes for a customer. When a query is created for a customer and you wish to store against them..... lets say it is there home address. You would (or should) have a link between a HomeID (foreign key) in the customer table and the primary key in the address table dragging into the grid appropriate fields from the address table. When you then run that query the relevant info becomes one and all you EVER do in the event of a change of home address for instance is change the homeID key value........the rest is normal SQL functionality although in Access it is called "Autolookup" a fancy name for something that SQL has always done.
May 28 '10 #4

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

Similar topics

1
by: MR71 | last post by:
I've created a SQL View in SQL 2000 using a table that has columns defined as Numeric data type. In the view, I am grouping and summing. When I link the view via ODBC to Access, all of the data...
0
by: Ly Lam | last post by:
In my .resx file (below) I wish to reference an external bitmap that is located in my project's folder. When I try to compile the project I get an error on my .resx file: Resource...
0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
1
by: Angus Lepper | last post by:
I'm writing a stock ticker for a stock market simulation, and can load the data into the xmlreader in the first place, but can't figure out how to refresh/update the data in it. Any ideas? Code:...
2
by: simon | last post by:
Hello in my codebehind for a user preference form, i instantiate a new class, and then call a function in that class. the function calls a proc which returns a dataset (in this case a single row...
9
by: Leslie Coover | last post by:
http://finance.yahoo.com/ offers a wide range of financial data. Would anyone have (or know where I can get) a sample of code that
14
by: irfi | last post by:
Hi, Please anyone out there can help me!!!!!!!!!!!! I am building a Data Report in vb6. To make it simple there a three text box on the Report. First for (Date), Second for (In-Time) and the third...
5
by: Simon Benson | last post by:
Probably a fairly simple problem but one that's been plaguing me for a couple of days... can anyone help? I have a classic ASP page with a number of text boxes which are updatable. For...
2
by: drwigginton | last post by:
Hello. I have a table in an Access 2003 database, tblDataDump, that accepts data imported from an Excel spreadsheet. The data is processed through a make table query that performs some simple...
5
by: joebloe | last post by:
I know this question comes up from time to time, but 10-15 minutes of googling hasn't produced a useful answer for me. I'm looking for the equivalent of insert_magic_here() in: ...
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
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
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,...
1
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
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.