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

Report from Crosstab Query

Is there a way to mak ea dynamic report from a cross tab query?
Basically the query may generate a different number of columns of data
depending on the conditions that are set at run time. For example....
Assume:
1) The rows lists managers.
2) The columns list employees.
3) The 'grid' lists a count of tasks.

Sitaution:
1) The query and report will be generated for only a single manager.
2) Employees with no tasks should not show up in the report.
3) The number and combination of employees who have tasks will change.

Desired Result:
A query driven report that can list in crosstab format a listing of
employees and there task count by manager.
All I can see in building a report from crosstab is where you have to
manually build it each time you 'columns' change.

Nov 12 '05 #1
1 1404
Add a bunch of textboxes to your report detail section. Add more
textboxes than what you think you would need. Name them like txt0,
txt1, txt2, txt3, txt4...txt50. Set the visible property of each
textbox to false. Then in VBA code you set the recordsource property of
the report to your crosstab query. You count how many fields are in the
resulting query. Say the query returns 20 columns, you loop through
your report controls collection and set the visible property to true for
20 of your textboxes and simultaneously set the control source for each
textbox.

Private Sub Report_Open(...)
Dim i As Integer, RS As Recordset
Me.Recordsource = "Select * From qry1"
Set RS = CurrentDB.Openrecordset("qry1")
For i = 0 to RS.Fields.Count - 1
Me.Controls("txt" & i).Vislble = True
Me.Controls("txt" & i).ControlSource = RS(i).Name
Next
End Sub

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
3
by: Edward | last post by:
ACCESS 2k I need to design a report based on a rota system for staff at various shops. The data is effectively stored in a single table, along the lines of: Initials (e.g. BH, FG, RM etc.)...
4
by: No Spam | last post by:
Dear Access 2000 users, I have a crosstab query that puts together certain information perfectly. It has a criteria that is based on a form that limits how many columns are returned based on...
15
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows...
3
by: deejayquai | last post by:
Hi I've created a crosstab query and displayed it as a sub-report in my main report. This is fine until the data changes and the column names become incorrect. I know I have to create a...
3
by: Bryan | last post by:
I've been looking over this newsgroup, but I can't find an answer to my problem. I see that a few others have posted this issue over the years, but none of them got a response. I'll give it...
1
by: Brad | last post by:
Thanks for taking the time to read my question. I have a table of data that has Date, Data and Category. I need to show, in a report, each Categories Data by Date. The Date has to be it's own...
2
by: Ecohouse | last post by:
I'm using Access 2002. I'm creating a report dynamically using a crosstab query. I found the code for this on the Microsoft site. I noticed that the report doesn't go past six pages. How can I...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.