adding controls to a report at runtime

G

Guest

i have a table structure similar to the following with some sample data.

Part Def Def Def Def Def Def
Total
ID Date Number Code1 Qty1 Code2 Qty2 Code3 Qty3 Other Sort
================================================
5 6/30/04 012009 1 6 4 5 2 4
7 288
6 6/30/04 953399 9 8 12 5 3 3
0 1600
7 6/30/04 953398 22 4 26 3 1 1 0
2400
8 6/30/04 060353 27 18 12 9 15 7 4
3987
9 6/30/04 588238 0 0 0 0 0 0
0 3786
10 6/30/04 953399 8 10 9 6 0 0
0 3786
11 6/30/04 833694 0 0 0 0 0 0
0 106
12 6/30/04 953237 0 0 0 0 0 0
0 14064
13 6/30/04 953399 10 18 20 9 3 4 8
2050

i have a query in place that normalizes the data, what i need to know is how
to add controls at run time. i want my report to look like the following,

Between [StartDate] and [EndDate]
=PartNumber Header======================================
Part Number [PartNum]
=Details Section=========================================
Defect Code Defect Quantitiy DefectPercentage
[defectcode] [defectquantity] [PercofDefectQuantity]
=Part Number Footer======================================
Total sorted: [sumofTotalSort] Total Defects: [sumofDefects]
Percentage of Defects: [DefectPercentage]

for each part number found withing a range. what i need to know is how to
add
[defectcode] and [defectquantity] boxes at run time, so if a part has a list
of five different defects throughout the date range, there will be a column
of five defect codes (along with the corresponding defect quantities,) or if
a part has 10 different defect codes within the date range, there will be a
column of 10 defect codes (along with the corresponding defect quantities).
any help with this would be greatly apprecieated. thanks in advance.
 
G

Guest

i was able to get this to work, thanks for the reply, just one more problem
with this report, i need to be able to get the value that i have set in the
Part number footer section (Total Defects: [sumofDefects]) when the report
opens or else before the Part Number Header section for each part.Not sure
how to do this ( i think i saw something similar to this in these newsgroups,
but i can't find it now. i need this number to get the Defect percentage
([PercofDefectQuantity]) in the Details Section.
(This number is supposed to be the percentage of defects that the particular
defect code is for the part number, given the date range.) thanks for
shedding any light on this you can.

Duane Hookom said:
There is a sample Crosstab report download at
http://www.invisibleinc.com/divFiles.cfm?divDivID=4. The Crosstab.mdb file
has a solution that works.

--
Duane Hookom
MS Access MVP
--

jkendrick75 said:
i have a table structure similar to the following with some sample data.

Part Def Def Def Def Def Def
Total
ID Date Number Code1 Qty1 Code2 Qty2 Code3 Qty3 Other Sort
================================================
5 6/30/04 012009 1 6 4 5 2 4
7 288
6 6/30/04 953399 9 8 12 5 3 3
0 1600
7 6/30/04 953398 22 4 26 3 1 1
0
2400
8 6/30/04 060353 27 18 12 9 15 7 4
3987
9 6/30/04 588238 0 0 0 0 0 0
0 3786
10 6/30/04 953399 8 10 9 6 0 0
0 3786
11 6/30/04 833694 0 0 0 0 0 0
0 106
12 6/30/04 953237 0 0 0 0 0 0
0 14064
13 6/30/04 953399 10 18 20 9 3 4 8
2050

i have a query in place that normalizes the data, what i need to know is
how
to add controls at run time. i want my report to look like the following,

Between [StartDate] and [EndDate]
=PartNumber Header======================================
Part Number [PartNum]
=Details Section=========================================
Defect Code Defect Quantitiy DefectPercentage
[defectcode] [defectquantity] [PercofDefectQuantity]
=Part Number Footer======================================
Total sorted: [sumofTotalSort] Total Defects: [sumofDefects]
Percentage of Defects: [DefectPercentage]

for each part number found withing a range. what i need to know is how to
add
[defectcode] and [defectquantity] boxes at run time, so if a part has a
list
of five different defects throughout the date range, there will be a
column
of five defect codes (along with the corresponding defect quantities,) or
if
a part has 10 different defect codes within the date range, there will be
a
column of 10 defect codes (along with the corresponding defect
quantities).
any help with this would be greatly apprecieated. thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top