dbTalk Databases Forums  

MS Access VBA making multiple tables in database from a main table.

comp.databases.ms-access comp.databases.ms-access


Discuss MS Access VBA making multiple tables in database from a main table. in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bbcdancer@hotmail.com
 
Posts: n/a

Default MS Access VBA making multiple tables in database from a main table. - 10-09-2008 , 10:25 AM






I have a database table called "tbl_personal" and struggling to VBA
program a bit of code to
create multiple tables in a database from the main "tbl_personal"
table.

In this case the 'color' column is the field I would like to look at.

1. Identify the number of unique records in column 'color'

2. For each color record that is label as red in the "tbl_personal"
table, create a table
called 'red' and populate with all red records in from the
"tbl_personal" table.
3.Then move onto the next unique color and repeat the whole process
again.
4. When all unique color tables are created in MS Access database end
with a msg "batch process done"

name surname age color country
aa aaa 1 red UK
bb bbb 10 green USA
cc ccc 20 blue China
dd ddd 30 red Germany
ee eee 40 green France
ff fff 1 blue Italy
gg ggg 20 red Spain
hh hhh 40 yellow Canada
ii iii 34 black Italy


Is this doable automatically in MS Access?

Many thanks.

brenda

Reply With Quote
  #2  
Old   
Phil Stanton
 
Posts: n/a

Default Re: MS Access VBA making multiple tables in database from a main table. - 10-09-2008 , 03:58 PM






Are you sure you want to do this?

I would expect 3 tables vis:
Table of Personel with PersonelID, Suname, FirstName, ColourID, CountryID &
DateOfBirth (Age will be out of date next birthday and should be
calculated),
Table of Colours ColourID & Colour
Table of Countries CountryID & Country.

You can then use simple queries to return all the red people or people who
live in UK.

Am I missing something?

Phil

<bbcdancer (AT) hotmail (DOT) com> wrote

I have a database table called "tbl_personal" and struggling to VBA
program a bit of code to
create multiple tables in a database from the main "tbl_personal"
table.

In this case the 'color' column is the field I would like to look at.

1. Identify the number of unique records in column 'color'

2. For each color record that is label as red in the "tbl_personal"
table, create a table
called 'red' and populate with all red records in from the
"tbl_personal" table.
3.Then move onto the next unique color and repeat the whole process
again.
4. When all unique color tables are created in MS Access database end
with a msg "batch process done"

name surname age color country
aa aaa 1 red UK
bb bbb 10 green USA
cc ccc 20 blue China
dd ddd 30 red Germany
ee eee 40 green France
ff fff 1 blue Italy
gg ggg 20 red Spain
hh hhh 40 yellow Canada
ii iii 34 black Italy


Is this doable automatically in MS Access?

Many thanks.

brenda



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.