Table in Report

  • Thread starter Thread starter TitaniaTiO2
  • Start date Start date
T

TitaniaTiO2

I would like to have a table (or at least the blocks of a table) in my
report. I want the table to be the same number of rows no matter how many
values my query places into the report (anywhere from 1 to 16).

I need the table to always be the same length to match a specified template.

How can I make the table always be there? If I put in the blocks of the
table with the desired number of rows, only one entry appears. If I set-up
only one row then I get the number of rows that I have data for, but no extra.

I cannot predict the number of rows I will have data for.

The second question would be, if I have more then 16 values, can I make the
data go to a second column in the table?

Thanks!
 
TitaniaTiO2 said:
I would like to have a table (or at least the blocks of a table) in my
report. I want the table to be the same number of rows no matter how many
values my query places into the report (anywhere from 1 to 16).

I need the table to always be the same length to match a specified template.

How can I make the table always be there? If I put in the blocks of the
table with the desired number of rows, only one entry appears. If I set-up
only one row then I get the number of rows that I have data for, but no extra.

I cannot predict the number of rows I will have data for.

The second question would be, if I have more then 16 values, can I make the
data go to a second column in the table?

Thanks!


No idea what you mean by the 'blocks of a table. Do you want a break after
every 16 rows in the report and have 16 lines showing even if you have no
data for them? I use this for printing Audio table covers

If yes, then the answer is here
http://support.microsoft.com/kb/q119073/

But just in case you don't like 'Accessese' here it is in English.

Go to Design View of your report. Click on the section of your report that
will be repeated (usually the Details section) Click on the Properties
button.
On the Events page, next to On Print type

=PrintLines([Report],[TotGrp])
In the Format page choose Yes next to Keep Together.

click the Code button and paste this
Option Compare Database
Option Explicit

Global TotCount As Integer

' Call the SetCount() function from the group header section's
' OnPrint property using the syntax: =SetCount(Report)

Function SetCount(R As Report)
TotCount = 0
R![ArtName].Visible = True
'subsitute the name of your controls in these lines
R![Role].Visible = True
R![txtRole2].Visible = True
R![txtArtName2].Visible = True
End Function

' Call the PrintLines() function from the detail section's OnPrint
' property using the syntax: =PrintLines(Report,[TotGrp]).

Function PrintLines(R As Report, TotGrp)
TotCount = TotCount + 1
If TotCount = TotGrp Then
R.NextRecord = False
ElseIf TotCount > TotGrp And TotCount < 16 Then
R.NextRecord = False
R![ArtName].Visible = False

R![Role].Visible = False
R![txtRole2].Visible = False
R![txtArtName2].Visible = False


End If
End Function


My controls are called Artname, Role, txtRole2 & txtArtName2. Swap these
with the names of your controls (fields. labels. text boxes)
To simulate the grid lines in a table, I've drawn a Box around each control
so that when they are made invisible, an empty box still remains.

I'm not sure about doing this with 2 columns however. You may have to
experiment with that.
Evi
 
Back
Top