How to make a new table using fields from another table with VBA

Babak

Registered User.
Local time
Today, 05:53
Joined
Jul 29, 2013
Messages
16
I have a table with 3 fields. The fields are down1, down2 and down3. . I would like to use this table to create a new table (downtime). What I need too do is loop through each record in the table and place the three fields independently in my new table. For example, I would like to go to the first record in my original table, than place down1 as my first record in my new table, down2 as my second record and down3 as my third. Than I will go to the second record in my original table and place down1 as my fourth record, down2 as my fifth record, down3 and my sixth record and so on. Does anyone have code to do this? I want to make a toggle button that will do this.
 
Welcome to the forum !

No reason to do this.
Access will not keep in mind this sort and you never will be able to refer a record as the... 69th record.
 
I do need to do this because my boss wants to be able to apply a filter. He wants to see the downtimes in order from highest to lowest. Since each record contains three downtimes, I need to split the table up. Do you know code that will do this?
 
If this is a one off exercise then I would prepare the data in Excel and have a column indicating the order in which you would like the data to be accessed once it has been imported into the database.
 
This is for my access database. When I first created it, I made my table include 3 downtime issues (down1,down2,down3). I want to now split this into a another table. It may sound unessacry but thats what he wants done so I have no choice.

Thanks
 
FYI I deleted your duplicate thread. Please don't post the same question more than once.

Another alternative is a UNION query

SELECT Down1
FROM TableName
UNION ALL
SELECT Down2
FROM TableName
UNION ALL
SELECT Down3
FROM TableName
 
Thanks guys but I found another way to do what I need without the need of creating a new table. Thanks for your time.

PS. Sorry for posting the same question twice :)
 
While this is a one time task, you can simple copy and paste data from one table to the other one.
Select first field in the old table
Press CTRL+C
Select first "row" in the new table
Press CTRL+V
Select next field in the old table
Press CTRL+C
Select the first empty row in the new table
Press CTRL+V
Repeat for the 3rd field
 

Users who are viewing this thread

Back
Top Bottom