473,321 Members | 1,622 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,321 software developers and data experts.

Help with Pivot columns and data in Access VBA. Sample attached

1
Guys I have been breaking my head for the past three days with this. I really need this to be done.
I need my columns with data pivoted and also have a title column adjacent populated with “column names” for reference.
I did achieve a bit of it but the Do loop is not working for me. You can see it in my attached sample.

This is my data table:
Expand|Select|Wrap|Line Numbers
  1. tblData
  2. id    FName    LName    NumofCars    NumofBikes    NumofVans    TotalCount
  3. 1    James    Philman    2    0    1    3
  4. 2    Robery    KINSEY    1    1    2    4
This is what my results should look like:
Expand|Select|Wrap|Line Numbers
  1. tblResult
  2. id    Title    ItemCount
  3. 1    NumofVans    1
  4. 1    NumofBikes    0
  5. 1    NumofCars    2
  6. 2    NumofVans    2
  7. 2    NumofBikes    1
  8. 2    NumofCars    1
Things to note:
1. In the result set some of the columns are skipped during pivot like Fname, LName, TotalCount.
2. I also need the item count to be “Numeric field”. When I change it in my table I get an error during run time.

I really appreciate any help I can get with this. Thanks in advance.

JJ
Attached Files
File Type: zip MyTestResults.zip (47.2 KB, 49 views)
Nov 11 '13 #1
1 1042
zmbd
5,501 Expert Mod 4TB
JJNero:
Your database is not normalized: > Database Normalization and Table Structures.

Once you normalize your data a simple agregate query should return the expected results.


Please understand, many of us cannot or will not d/l un-requested attachments. This has absolutely nothing to do with who you are... In my case, such d/l are prohibited by my ITSec staff. For many others, it is part of "safe computing/best practices" not to d/l such files. A practical example as to why can be found here http://bytes.com/topic/access/answer...l-ms-products. this unfourtunate Member opened a file from a trusted source and is now haveing all sorts of issues!
Nov 11 '13 #2

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

Similar topics

0
by: sedefo | last post by:
I ran into this Microsoft Patterns & Practices Enterprise Library while i was researching how i can write a database independent data access layer. In my company we already use Data Access...
0
by: NB | last post by:
Hi My file server runs Win 2000 Pro and has Office XP installed. I host a data access page contaning Pivot Table on the server. In the page body I have some reference to an lpk file on the...
0
by: Dave | last post by:
I am trying to develop Data Access Pages (DAP) within Access 2003, specifically using Pivot Table Lists. When creating pivot tables as forms, all of my records in a table consisting of over 18,000...
0
by: sunilkeswani | last post by:
Hi I have a Data Access Page which is linked to a Access Database table, and the page represents data in a Pivot Chart format. I want to know if there is any way by which - the pivot chart...
9
by: Clint | last post by:
Hey all - Excuse the cross-post ... I'm not sure what the appropriate newsgroup would be for this question. I have a question that I'm not quite sure how to ask. For all I know, I have the...
0
by: Tim Barnes | last post by:
I am going through a revision of my product where I am trying to abstract out the data access layer, where I have traditionally just dragged/dropped data adapters and generated datasets using...
0
by: dord | last post by:
I am developing a reuseable data access library for Access, MSSQL, MySQL, Oracle and etc, for some of other projects. Initially I build up classes for each database, and a client application is...
0
by: niveditharao | last post by:
i want to know how can i use two pivot columns in a single query. or ---- pivot <pivotcolumn1> for < > in.... pivot <pivotcolumn2> for < > in....
1
by: munkee | last post by:
I cant figure out how to construct a query for my pivot chart in access. I basically have the following table: tblCorrective CorrectiveLinkID - Number - FK CorrectiveActionID - Autonumber...
4
by: nimster123456 | last post by:
Hi i have created a query and need to basically Pivot the data in a similar to Excel - the only difficulty is that i ahve nearly 5 million rows of data. I cannot use a crosstab as this does not...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.