creating a report from a query that has a calandar at the bottom

  • Thread starter Thread starter Awoll
  • Start date Start date
A

Awoll

Hello,

I was wondering if it is possible to create a report that has a calandar at
the bottom of the page and query results at the top. What I'm looking to do
is pull the customer first and last name with thier membership dates listed
at the top of the page, and to print the current month calendar in the
middle and bottom of the page. I want to be able to run the report so that
is prints every customer listed in the customer table out. That is one
report per person with the calendar. This well be active everymonth to print
a new list. The customers use it to sign in on. Is there a way for this to
be done?

Thanks,

Aaron
 
I'm not real clear what your calendar would look like. You can use the line
method to draw a calendar with code in the On Page event. Copy the following
into the on page event of a report and make sure the width is at least 7
inches.

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
 
Back
Top