473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

MS Access Transposing

Hi,

Is there a way to transpose the data from a query into an Access table. ADezii wrote some code and database example which does this but exports to a txt file.

In my instance I will have a maximum of 6 records + the original column fields (denoted in the first column of the new table as "Info".

The data is created in a query called "TOA_Report_History" (limited to the 6 records) and I want it to be transposed into an Access table called "TOA_Report_History_Transpose" which is designed with the following field columns: Info, Record1, Record2, Record3, Record4, Record5, Record6

I can then clear this table and run the code again to add new data to it as required. So the table will always be empty when the code is run.

I have attached a slimmed down version so you can see the query results format and the table format populated with the info.

Cheers
Jdlewin
Attached Files
File Type: zip MS Access Transpose.zip (357.4 KB, 69 views)
Jul 10 '17 #1
5 1150
ADezii
8,834 Expert 8TB
This is a little more complicated than your typical Transpose Code. Let me put my Thinking Cap on and see what I can come up with.
Jul 10 '17 #2
Hi ADezii.

I think your code can be used to export my data set to txt and the run some additional code as an auto upload back into the TOA_Report_History_Transpose table.

Would be better if it could do it all internal to Access tho.
Jul 11 '17 #3
Lilit1
3
Hi everyone..
I am a new member here , ))
Jul 11 '17 #4
ADezii
8,834 Expert 8TB
  1. Your particular scenario proved to be quite a challenge! (LOL).
  2. I ended up doing exactly what I did not want to do, and that is to Transpose the Data in a 2-step process.
  3. Step 1 involves Transposing the Field Names only in the Query TOA_Report_History to the Table TOA_Report_History_Transposed.
  4. Step 2 creates a Recordset based on TOA_Report_History_Transposed and Updates each Record in turn.
  5. In its current state, a MAXIMUM Number of 6 Records is allowed in TOA_Report_History. This is due to the inclusion of Fields Record1 thru Record6 only in TOA_Report_History_Transposed and your preset limit in your initial Posting. This MAXIMUM can easily be changed should you so desire.
  6. Enough chatter, I'll let you judge the results yourself and make a determination as to whether or not it is what you are looking for.
  7. I'll not go through the details of the Code, but simply Upload the Demo to you. Should you have anything further to ask, simply do so.
P.S. - Welcome aboard, Lilit1!
Attached Files
File Type: zip Transpose_Revised_2.zip (80.5 KB, 86 views)
Jul 11 '17 #5
Ha great ADezii. I only require the 6 records as its a preset max number for the report but good to know i can extend this if needs be. I will have a look at the demo and see how it works and report back!!!

Thank you very much for your efforts!
Jul 11 '17 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Fabio | last post by:
Hello, is there any quite easy solution for the problem of transposing the rows into the columns? I have the following table with some data in it: dealer date 09.00 10.00 11.00 ...
63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy...
13
by: bill | last post by:
I am trying to convince a client that dotNet is preferable to an Access project (ADP/ADE). This client currently has a large, pure Access MDB solution with 30+ users, which needs to be upgraded....
2
by: Howard William | last post by:
Help. I am a bit flummoxed by the problem of how to transpose "normalized" (in the database sense) data records into columns of for a data entry form, and then back again when the user is...
9
by: Classic-Car-World Ltd | last post by:
Hi, I have some data in a table in columns which I need to convert into rows. This is specification data for some tools etc. The data is currently in the following format: Product No, order,...
3
by: newb | last post by:
Hey guys, I’m new to access and databases and I’m having a bit of trouble coming up with a query that will do what I need. I have three tables in the form of: Table 1: Category ID, Category ...
11
by: Haydee Zimmerman | last post by:
Hoping someone can help me. I have 2 Access tables with a one to many relationship. the 1 side table holds the billing information, the many table side holds the billing id and modifier#. Now I...
7
by: ekariuki | last post by:
Hi Guys, I am a newbee to Bytes currently working on an MS Access database for one of my clients: With respect, I'll get right to it: I have 2 tables: Table 1. TblTrip_Facts Route Name , ...
2
by: eitsubashkumars | last post by:
I have configured remote access VPN with local pool in ASA firewall however im accessing all the resources(my private network such as servers ) through Asa firewall after getting connected the VPN...
0
by: Marc D | last post by:
Peoples... I'm trying to write a simple read/write application for a Magnetic Card Reader/writer (Tyner) I'm able to get everything off the card just fine, and it appears to to be working to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.