Split Tables where to go from here?

  • Thread starter Thread starter Emma
  • Start date Start date
E

Emma

Hi I have a database with one large table I split it up into Questions,
Provided Support, Demographics and Table1 tables. Table1 isn't as good as I'd
like it to be as it seems to hold all the data anyway in "Lookup to" fields.
What I'd like is the Table1 to point to say the Demographics table and see it
has an ID of 2. Instead of the "Lookup to" fields holding all the data.
Secondly how do I go about redoing my statistic reports now that I have
normalized the database? Am I going to have to redo my main form as all it's
fields are from the original table?
 
Table1 only 'seems' to hold the data from the other tables. The underlying
real values are in fact the numeric values corresponding to the values of the
primary key column in the referenced tables. One of the problems of
so-called 'lookup fields' is that they do disguise the underlying
relationships in this way. There are other objections to them, however,
which you'll find detailed at:


http://www.mvps.org/access/lookupfields.htm


Nonetheless your tables will still work.

As far as your statistical reports are concerned you can join the tables in
a query to return a 'result table' which is the equivalent of your original
single table. You can then base reports on the query rather than on the
original table. Make sure that where you have primary and foreign key
columns of the same name in the different tables you only return one of these
as a column in the query or there will be ambiguity between the two.

Note that if the you are joining a table to another table where the second
is related many-to-one to the first table, and there are rows in the first
table which don't have matches in the second, then you'll need to use a LEFT
OUTER JOIN if you want the data from all rows in the first table returned.
The default join type is an INNER JOIN, which only returns rows where there
are matches in both tables.

As regards your main form you could base this on a query joining the tables,
as with a report, but you might well find its not updatable. In any case its
not a good way to enter data. A better approach is to have a form based on
the main table and to have within it subforms based on the 'referencing'
tables (those in a many-to-one relationship with the main table), linking the
main form and subforms on the appropriate primary and foreign key fields.

As an alternative to subforms you can have separate forms and open the forms
based on the referencing tables from buttons on the main form so that they
open filtered to the related records. Subforms are generally more
convenient, however, and one thing you can do is to put each subform on
separate pages of a tab control on the main form so that you simply have to
tab to the relevant one when entering or viewing data.

Ken Sheridan
Stafford, England
 
Thanks Ken,

I have finished putting the subforms on the form and it looks good. I
changed my queries to reflect that the data for the statistics is coming from
the demographics tables and not the old table. So all that is left is
figuring out how to get the statistics to work? Right now the Age report is
asking for a couple parameters which ask for Table1.age etc.. instead of the
Demographics.age from the query? Thanks for your advice, I'm going to keep
plugging away at this. Hopefully I won't have to merge the tables back into
1.
 
I finally finished. Here's a break down of what it entailed:

1. Split Tables / Make new Table1
2. Make the Form Record Source SELECT * FROM Table1
3. Create Sub Forms for each Table using #2 SELECT statement
4. Change the queries to reflect new tables
5. Make the charts in the reports all over again using the wizard and new
tables

I hope this helps someone else in the future.
 
Back
Top