PC Review


Reply
Thread Tools Rate Thread

Create several tables from two tables

 
 
LisaInAz
Guest
Posts: n/a
 
      8th Jul 2009

I have tried to research what I am trying to do and can't seem to find a
solution, I am not sure if it can be accomplished. I am not very good at the
coding portion in regards to Access/VB. I am self taught.

Basically I have two tables TABLEA Contains unique values TABLEB Contains
the data, both have same FieldAUNIQUEVALUE. No relationships have been set.
From these two tables I want to make as many tables as there is unique value
as there are tables programatically...
EXAMPLE
TABLE A TABLE B
FieldAUNIQUEVALUE
FieldAUNIQUEVALUE,FieldBIDNBR,FieldCDistrictOffice

SAMPLE DATA
TABLEA TABLEB
F1BT F1BT,123456,F1A
F1BU F1BT,234568,F1A
F2BW F1BT,098765,F1A
F2BU F1BU,098765,F1A
F1BU,456783,F1B
F1BU,456567,F1C
F2BW,098765,F2A
F2BW,111111,F2B
F2BU,111111,F2B
F2BU,234567,F2B
F2BU,345890,F2B
Goal 4 different tables, each named with TABLEAFieldAUNIQUEVALUE containing
corrected data
NEW TABLE
F1BT would contain 3 records
F1BU would contain 3 records
F2BW would contain 2records
F2BU would contain 3 records

I know I could accomplish this manually but I would have to do it 36+ times
with separate queries. Any suggestion is greatly appreciated, even if it is
to accomplish manually. Thank you in advance.

 
Reply With Quote
 
 
 
 
Beetle
Guest
Posts: n/a
 
      8th Jul 2009

STOP!

What you are attempting to do would be very poor design
and would result in a maintenance nightmare. Plus, you
would (most likely) reach the maximum table limit in a
very short time.

If you can tell us *why* you think you need to do this, then
someone can give you advice as to how to proceed. It's
lilely that you just need to relate the two tables and use a
simple query to view only the records you want to see.

--
_________

Sean Bailey


"LisaInAz" wrote:

> I have tried to research what I am trying to do and can't seem to find a
> solution, I am not sure if it can be accomplished. I am not very good at the
> coding portion in regards to Access/VB. I am self taught.
>
> Basically I have two tables TABLEA Contains unique values TABLEB Contains
> the data, both have same FieldAUNIQUEVALUE. No relationships have been set.
> From these two tables I want to make as many tables as there is unique value
> as there are tables programatically...
> EXAMPLE
> TABLE A TABLE B
> FieldAUNIQUEVALUE
> FieldAUNIQUEVALUE,FieldBIDNBR,FieldCDistrictOffice
>
> SAMPLE DATA
> TABLEA TABLEB
> F1BT F1BT,123456,F1A
> F1BU F1BT,234568,F1A
> F2BW F1BT,098765,F1A
> F2BU F1BU,098765,F1A
> F1BU,456783,F1B
> F1BU,456567,F1C
> F2BW,098765,F2A
> F2BW,111111,F2B
> F2BU,111111,F2B
> F2BU,234567,F2B
> F2BU,345890,F2B
> Goal 4 different tables, each named with TABLEAFieldAUNIQUEVALUE containing
> corrected data
> NEW TABLE
> F1BT would contain 3 records
> F1BU would contain 3 records
> F2BW would contain 2records
> F2BU would contain 3 records
>
> I know I could accomplish this manually but I would have to do it 36+ times
> with separate queries. Any suggestion is greatly appreciated, even if it is
> to accomplish manually. Thank you in advance.
>

 
Reply With Quote
 
LisaInAz
Guest
Posts: n/a
 
      13th Jul 2009
I was able to resolve this issue thanks to everyones help now I have another
issue

Again I tried to research and I am not sure if I should start a new thread
or continue with this one...

I now would like to pass the number of records that I need for each unique
entity via form/table, below is the SQL that is working however, I have 36
different entities where I need to randomly select X data . <using SQL server
is not an option; we are using Access 2002 SP3>...

SELECT TOP 1883 Rnd([CountNum]) AS RandomValue, tbl002_F1BWDATA.CountNum,
tbl002_F1BWDATA.Unique, tbl002_F1BWDATA.UniqueTwo, tbl002_F1BWDATA.DISTRICT,
tbl002_F1BWDATA.ELIG, tbl002_F1BWDATA.PRIM_ID INTO tbl003C_F1BWDATA
FROM tbl002_F1BWDATA
WHERE (((randomizer())=0))
ORDER BY Rnd([CountNum]) DESC;

I have found a few items

Such as

Dim intRecCount As Integer
intRecCount = DCount("*", "tblTest")

&
****************
Private Function TopParameter()

Dim dbf As Database, qdf As QueryDef, strSQL As String, strSQL1 As String
Set dbs = CurrentDb

On Error Resume Next
DoCmd.DeleteObject acQuery, "ListTop"

strSQL = "SELECT TOP " & [Forms]![frmSelectVendors]![txtTopCount] & "
tblVendors.VendorID, tblVendors.VendorName,
qryPerformanceDetailExtCost.ExtCost"

Set dbf = DBEngine.Workspaces(0).Databases(0)
Set qdf = dbf.CreateQueryDef("ListTop", strSQL)


End Function

However, my knowledge is limited and I can not get them to work...
Thanks for your help in advance




"LisaInAz" wrote:

> I have tried to research what I am trying to do and can't seem to find a
> solution, I am not sure if it can be accomplished. I am not very good at the
> coding portion in regards to Access/VB. I am self taught.
>
> Basically I have two tables TABLEA Contains unique values TABLEB Contains
> the data, both have same FieldAUNIQUEVALUE. No relationships have been set.
> From these two tables I want to make as many tables as there is unique value
> as there are tables programatically...
> EXAMPLE
> TABLE A TABLE B
> FieldAUNIQUEVALUE
> FieldAUNIQUEVALUE,FieldBIDNBR,FieldCDistrictOffice
>
> SAMPLE DATA
> TABLEA TABLEB
> F1BT F1BT,123456,F1A
> F1BU F1BT,234568,F1A
> F2BW F1BT,098765,F1A
> F2BU F1BU,098765,F1A
> F1BU,456783,F1B
> F1BU,456567,F1C
> F2BW,098765,F2A
> F2BW,111111,F2B
> F2BU,111111,F2B
> F2BU,234567,F2B
> F2BU,345890,F2B
> Goal 4 different tables, each named with TABLEAFieldAUNIQUEVALUE containing
> corrected data
> NEW TABLE
> F1BT would contain 3 records
> F1BU would contain 3 records
> F2BW would contain 2records
> F2BU would contain 3 records
>
> I know I could accomplish this manually but I would have to do it 36+ times
> with separate queries. Any suggestion is greatly appreciated, even if it is
> to accomplish manually. Thank you in advance.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Tables, remove tables, set relations etc. =?Utf-8?B?aGdlcm9u?= Microsoft Access Database Table Design 4 12th Sep 2006 06:51 AM
Creating archive tables for Access tables joined to Sybase tables =?Utf-8?B?QXJjaGl2ZSBUYWJsZXM=?= Microsoft Access External Data 0 11th Jan 2006 10:31 PM
How to create data adapter for multiple tables (joint tables)? Nguyen Microsoft ADO .NET 1 16th Jun 2004 08:38 PM
How do I create a spreadsheet from print tables/pivot tables =?Utf-8?B?SGFycnk=?= Microsoft Excel Misc 3 10th Dec 2003 02:40 AM
linking 2 tables, create a query to create web page Kimberly Microsoft Access Getting Started 0 10th Nov 2003 01:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:42 AM.