Hi there!
Imagine a table with three fields, ID, NAME and SURNAME...
Is there any way to make a report where you show a split table where you
first show the odd IDs and then the even IDs?
Something like this:
ID | NAME | SURNAME | ID | NAME | SURNAME
1 | Pedro | Almeida | 2 | John | Rambo
3 | ... | ... | 4 | ... | ...
You get the idea =)
Thanks in advance,
Pedro Almeida
Lisboa - Portugal
Do you mean to simply print 2 columns on the page? If your table
contains incremental ID's, and none are missing, the below will work
IF the report is sorted on the ID field.
Make your report with the Page Header the full width of the report.
Place a double set of column labels across the page (as you show
above)
*** Then place only one set of text controls in the Detail section
(starting against the left margin):
[ID] [Name] [SurName]
Then click on
File + PageSetUp + Columns
Set the Number of Columns to 2
Set the column size to whatever is needed to display one column.
Unclick the "Same as Detail" check box.
Set the Column Layout to Across then Down.
Run the report.
Remember that the width of the column * the number of columns + the
space between the columns + the width of the page margins must be less
than the width of the paper.
If you are missing ID's you MIGHT be able to get the same result as
above, but you will have to code the Detail Format event, using
combinations of PrintSection, NextRecord, and MoveLayout.
You can tell which column you are in by reading the report's left
property.
Note: You can check if the ID is even or odd by coding:
If Me![ID] MOD 2 = 1 Then
' It's Odd
' Do this
Else
' It's Even
' Do That
End If
Note: If you really do have a field in your database named "Name", I
would strongly suggest you change it to something more appropriate,
perhaps FirstName, as "Name" is an Access/VBA reserved word and should
not be used as a field name.
See Microsoft KnowledgeBase article:
109312 'Reserved Words in Microsoft Access'
209187 'Acc2000: 'Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'