Add a blank table to Report

  • Thread starter Thread starter mark909
  • Start date Start date
M

mark909

I want to add a blank table to a report like in word but i cant see anyway of
doing it apart from adding individual labels to create the grid?

Any ideas?

:)
 
Besides labels, you can use boxes or lines. There are no table structures
that you can add. You can use Automation to output your data to Word or
Excel and create a grid there, if you like.
 
Thanks Alvin. Please could you point me in the right direction to get the
output of queries into excel as this is something i need to look at in the
near future.

bhicks im simply trying to create a grid that can be hand written upon as
the report will be used for surveys
 
Click on the query in the database window to select it. Then:

Tools >>> Office Links >>> Analyze with Excel
 
Create a table Dummy with column Counter of number data type, and
enter values from1 to 100 say. Then base the report (or a subreport
if you want the grid within another bound report) on a query such as:

SELECT NULL AS a, NULL AS b, NULL AS c
FROM Dummy
WHERE counter<=5;

This will give you a grid 3x5. Add side-by side text boxes bound to
the columns (a,b and c in this example) to the detail section and in
the detail section's Format event procedure put:

Dim lngHeight As Long
Dim X1 As Single
Dim Y1 As Single
Dim Y2 As Single
Dim X2 As Single

Me.DrawStyle = 0

' Find the height of the tallest control in the row
Dim ctrl As Control
For Each ctrl In Me.Section(acDetail).Controls
If ctrl.Height > lngHeight Then
lngHeight = ctrl.Height
End If
Next ctrl

If PrintCount = 1 Then
' Draw the box around the record
For Each ctrl In Me.Section(acDetail).Controls
X1 = ctrl.Left
X2 = ctrl.Left + ctrl.Width
Y1 = ctrl.Top
' add twenty twips at bottom to
' avoid tight cropping to text
Y2 = lngHeight + 20
Me.Line (X1, Y1)-(X2, Y2), vbBlack, B
Next ctrl
End If

As you are drawing an empty grid you don't really need to bother
avoiding tight cropping to the text, but using this code to draw a
grid around bound controls you'll find it looks better if you do.

Ken Sheridan
Stafford, England
 
Back
Top