Thanks for ur quick reply and the thing is I am not good at vb coding.Any way I will try with this. Am I going to get only horizontal lines only. or both horizontal and vertical lines also. Vertical Lines in the sense between fields, to like everything is in a box format.
Could u give the description next to each statement so that I can easily under stand the code.
Thanks
Vad
----- Duane Hookom wrote: -----
You should remove the box/rectangle/line controls and use the Line method to
draw all boxes. The following code will draw 24 horizontal lines that are
spaced the same as the height of the detail section. You can add a loop to
print the vertical lines. The last code below shows how to draw a complete
calendar on a page.
Private Sub Report_Page()
Dim intRows As Integer
Dim intLoop As Integer
Dim intTopMargin As Integer
intRows = 24
intDetailHeight = Me.Section(0).Height
intTopMargin = 360
For intLoop = 0 To intRows
Me.CurrentX = 20
Me.CurrentY = intLoop * intDetailHeight + intTopMargin
Me.Print intLoop + 1
Me.Line (0, intLoop * intDetailHeight + intTopMargin)-Step(Me.Width,
0)
Next
End Sub
Private Sub Report_Page()
Dim lngDayHeight As Long
Dim lngDayWidth As Long
Dim datRptDate As Date
Dim intStartWeek As Integer
Dim lngTopMargin As Long
Dim dat1stMth As Date
Dim datDay As Date
Dim lngTop As Long
Dim lngLeft As Long
datRptDate = Date
dat1stMth = DateSerial(Year(datRptDate), Month(datRptDate), 1)
intStartWeek = DatePart("ww", dat1stMth)
lngDayHeight = 2160 'one & half inch
lngDayWidth = 1440 'one inch
lngTopMargin = 720 'half inch
Me.FontSize = 22
'loop through all days in month
For datDay = dat1stMth To DateAdd("m", 1, dat1stMth) - 1
'find the top and left corner
lngTop = (DatePart("ww", datDay) - intStartWeek) * _
lngDayHeight + lngTopMargin
lngLeft = (Weekday(datDay) - 1) * lngDayWidth
If Weekday(datDay) = 1 Or Weekday(datDay) = 7 Then
Me.DrawWidth = 8
Else
Me.DrawWidth = 1
End If
'draw a rectangle for day
Me.Line (lngLeft, lngTop)-Step _
(lngDayWidth, lngDayHeight), , B
Me.CurrentX = lngLeft + 50
Me.CurrentY = lngTop + 50
Me.Print Day(datDay)
Next
End Sub
--
Duane Hookom
MS Access MVP
Vad said:
Hi! I created a report based on aquery.It has 5 fields.
in between the fields I kept vertical lines to show the details in a
Rectangular box format.records were less than 10, lets say 5. I want to display those 5 records
followed by 5 blank boxes.