OnFormat Event for Calendar Detail Duane Hookom

L

laknight

I'm adapting Duane Hookom's Annual Calendar report to display an annual
calendar with the count of number of quotes shown on each calendar day. Duane
uses an OnFormat property in the report with formats the daily date in a row
of 7. What I would like to do is take my record field called "CountOfQuotes"
and place it directly below the date on the calendar. I already have the
field on the report in the correct place but I'm not sure how to add my field
name to Duane's OnFormat Event. Here is Duane's code. Maybe Duane or someone
else can help me. Thanks.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.txtDate.Left = (Weekday(Me.txtDate) - 1) * _
Me.Width / 7
If Weekday(Me.txtDate) <> 7 And Month(Me.txtDate) = Month(Me.txtDate +
1) Then
Me.MoveLayout = False
End If

End Sub
 
D

Duane Hookom

Add the field to the record source of the month subreport. You can then add a
text box where ever you want in the subreport. Modify the code to move you
txtNewTextBoxName along with txtDate.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.txtDate.Left = (Weekday(Me.txtDate) - 1) * _
Me.Width / 7
Me.txtNewTextBoxName.Left = (Weekday(Me.txtDate) - 1) * _
Me.Width / 7
If Weekday(Me.txtDate) <> 7 And Month(Me.txtDate) = Month(Me.txtDate +
1) Then
Me.MoveLayout = False
End If

End Sub
 
L

laknight

Thanks Duane. Works great. I tried using a separate if statement for the
second text box and it wasn't working. Much appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top