Exporting from1 Super Table into 42 sub tables

G

Guest

hey all
I am not having any luck with this and am hoping someone already has
something build similar.
I have a unique ID field in the Super table and want to export this into the
subtables. (42 differentsubtables)
the common fields in the super table and subtables are
GPS_Super.mslink = Tablename.mslink (subtables) and GPS_Super.tablename =
(the acutally table name in the DB).
These 2 fields combined is a unique identifier. there will be no duplicates.
If someone can help me ASAP that would be great
Thanks
Authored by: PtboGiser
 
G

Guest

Why would even you want to do this? It makes querying your database so much
more difficult. Given that you are set on doing this, the following ought to
handle it.

Private Sub SplitData

Dim strSQL as string
Dim rs as dao.recordset

strSQL = "SELECT DISTINCT TableName FROM GPS_Super"
set rs = currentdb.openrecordset(strsql)

While not rs.eof

strSQL = "SELECT * INTO " & rs("TableName") _
& "FROM GPS_Super " _
& "WHERE [TableName] = " & chr$(34) & rs("TableName") &
chr$(34)
currentdb.execute strSQL
rs.movenext
Wend
rs.close
set rs = nothing

End Sub

HTH
Dale
 
S

Steve

You can do this in code by cycling through the tables collection to get the
42 tables and at each table run an SQL that appends your unique ID field to
the table.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
S

StopThisAdvertising

Steve said:
You can do this in code by cycling through the tables collection to get the
42 tables and at each table run an SQL that appends your unique ID field to
the table.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)

--
Steve, you have one of two choices:
-- Tell us you will stop advertising here, or...
-- get lost for another year or so...
http://home.tiscali.nl/arracom/whoissteve.html
(Until now 2495 pageloads, 1837 first-time visitors)

FYI: (this is also to inform those who do not understand...)
This is *not* about the sigline...although we do not 'love' it, we don't mind the current sigline.
But we will simply continue to hunt down *each and every* of your posts.

It is not relevant whether you advertised in *this* particular post or not...
Your pattern is: You post a few 'good' answers and then start to advertise again.

These groups are *not* your private hunting grounds!
You should know this by now.

ArnoR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top