Report problem with Query/Table

Elysyn

New Member
Joined
Dec 11, 2003
Messages
23
Good Day!

I have a problem with a report I am creating. I would like the layout to look like this...

Headings:___Bucket1_____Bucket2_____Bucket3______Bucket4
Data:______Skill Name___Skill Name__Skill Name___Skill Name

The information is being taken from a table (tblSkillBuckets) set up like this:

Headings:___SkillName____SkillNumber___BucketNumber
_____________Alpha___________2_____________1
_____________Beta____________3_____________1
_____________Delta____________4_____________2
Etc...

I've created 5 queries, 4 for each separate bucket and one that pulls them all together, but it creates 252 records for each bucket (Bucket 1 should only have 3) I've also tried setting the Record Source for the Report as tblSkillBuckets and using SQL (both in Row Source in Properties and in code) and I get no data in return.

Here is the latest code attempt:
Code:
Private Sub Report_Open(Cancel As Integer)

Dim Bucket1 As String

Bucket1 = "SELECT tblSkillBuckets.Name, tblSkillBuckets.Num, tblSkillBuckets.Bucket FROM tblSkillBuckets"
Bucket1 = Bucket1 & "WHERE tblSkillBuckets.Bucket = 1;"

Me.cmbBucket1.RowSource = Bucket1

End Sub


I'm confused, because this really seems like it should be working. Do any of you have any ideas or suggestions?

Thanks!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Start with a two field table holding your basic data.
First field is the Bucket number and the second the skill.

Then create this crosstab query:
Code:
TRANSFORM Count(Table1.fld2) AS CountOffld2
SELECT Table1.fld2, Count(Table1.fld2) AS [Total Of fld2]
FROM Table1
GROUP BY Table1.fld2
PIVOT Table1.fld1;

You can use the wizard interface, but it's going to want a third field to 'count' the instances even though the crosstab query syntax does not require it. Might be easiest if you just created this one from SQL - or added a third field with the # 1 in it temporarily just to satisfy the wizard interface.

Base the report off the above query or possibly add it as the Report Recordsource

Mike
 
Upvote 0

Forum statistics

Threads
1,221,674
Messages
6,161,215
Members
451,691
Latest member
fjaimes042510

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top