By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,687 Members | 2,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,687 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Oct 9 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

<bb*******@hotmail.comwrote in message
news:49**********************************@25g2000p rz.googlegroups.com...
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
Oct 9 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.