Roger's Access Library Homepage
Forum Home Forum Home > Roger's Access Library > Roger's Download Samples
  New Posts New Posts RSS Feed - NormalizeDenormalize.mdb (intermediate)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Please consider donating $1 per sample downloaded, (find out why here)

NormalizeDenormalize.mdb (intermediate)

 Post Reply Post Reply
Message Reverse Sort Order
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP

Joined: 20 Feb 2008
Status: Offline
Points: 261
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Topic: NormalizeDenormalize.mdb (intermediate)
    Posted: 30 Jul 2008 at 10:44pm

Please consider donating $1 per sample downloaded, find out why here.


There are two modules here 1) Normalize and 2) Denormalize.

"Normalize" takes the data in table2 and creates table1. It illustrates how to take a table which has fields like Value1, Value2, Value3,... and write them into a table which has one field (Value) with each of the values in a new record rather than having them all in one record. In other words, it normalizes the table. (At least that part of it.) Thus it takes non-normalized data and puts it into a normalized form.

There are 4 subs/functions. "NormalizeTable" is the main sub which calls the others. "CreateNormalizedTable" deletes table1 and then recreates it. This is not strictly necessary, but it makes it unnecessary to make sure there is an existing table. "NormalizeIt" does the normalization. It calls "NumberOfFields" which find the maximum number of fields in table2 so the FOR loop know how many times to execute.

Denormalize takes the data in table1 and creates table2. Thus it does just the opposite and denormalizes a normalized table. This also has 4 subs/functions. "DenormalizeTable" is the main sub which calls the others. "CreateDenormalizedTable" deletes and re-creates table2. It calls "MaxNumberOfFields" to decide how many fields to create. Lastly, "DenormalizeIt" does the denormalization.

To execute either, go the appropriate module, put your cursor in the first sub, and push the execute button.

Access 97 (34 KB):
Access 2000 DAO (37 KB): uploads/5/

Consider donating $1 per sample downloaded, find out why here.<
Back to Top
Sponsored Links

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.