473,513 Members | 2,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Monthly Calendar view as report

Bob
I've searched this group and have not found any posts since 2001, so
I'm hoping that now there may be a better way.

I have a need to generate a report that looks like a outlook monthly
calendar view. What I'm struggleing with is how do I get the first
day of the month to start on the correct day. Also how to fill up the
days in the week prior to the first day with the remaining days of the
previous month.

I've seen some older posts that suggests 42 subreports on the report.
That part is OK, but I don't know how to get the first day of the
month, then all of the other days into the correct subreport for the
day.

Can anyone help with this one?

Thanks in advance,

Bob

Feb 26 '07 #1
2 6199
Check out Allen Browne's. al***@allenbrowne.com calendar form.

I used that as a basis for a report, create 41 day fields like the form, add
to that 41 text fields for your information. The following function is
called in the ONFORMAT event of the detail section. The source data
[WORKDAY] and [DESC] is from a record set opened in the ONOPEN event of the
report.

Private Function ShowCal() As Boolean
On Error GoTo Err_Handler
Dim dtStartDate As Date 'First of month
Dim iDays As Integer 'Days in month
Dim iOffset As Integer 'Offset to first label for month.
Dim i As Integer 'Loop controller.
Dim iDay As Integer 'Day under consideration.
Dim bshow As Boolean 'Flag: show label
Dim cDay As Date ' Current working day

dtStartDate = Me![dValue] - Day(Me![dValue]) + 1 'First of month

iDays = Day(DateAdd("m", 1, dtStartDate) - 1) 'Days in month.
iOffset = WeekDay(dtStartDate, vbSunday) - 2 'Offset to first label
for month.

For i = 0 To 41
With Me("lblDay" & Format(i, "00"))
iDay = i - iOffset
bshow = ((iDay 0) And (iDay <= iDays))
cDay = DateAdd("d", iDay - 1, dtStartDate)

.Visible = bshow
Me("txtDay" & Format(i, "00")).Visible = bshow

If (bshow) Then
If iDay < 10 Then
Me("txtDay" & Format(i, "00")) = ".." & iDay
Else
Me("txtDay" & Format(i, "00")) = "." & iDay
End If
If rsInfoOK Then
rsInfo.FindFirst "[WorkDay]=#" & cDay & "#"
While Not rsInfo.NoMatch
' Build up the text string of the day from source
data
Me("txtDay" & Format(i, "00")) = Me("txtDay" &
Format(i, "00")) & _

vbCrLf & Left$(rsInfo![Desc], 40), 0))

rsInfo.FindNext "[WorkDay]=#" & cDay & "#"
Wend
rsInfo.MoveFirst
End If
End If

If (bshow) And (.caption <iDay) Then
.caption = iDay
End If

End With

Next

Exit_Handler:
Exit Function

Err_Handler:
MsgBox "Error " & Err.Number & " - " & Err.Description, vbExclamation,
conMod & ".ShowCal"
Resume Exit_Handler
End Function


"Bob" <te*******@bellsouth.netwrote in message
news:11**********************@m58g2000cwm.googlegr oups.com...
I've searched this group and have not found any posts since 2001, so
I'm hoping that now there may be a better way.

I have a need to generate a report that looks like a outlook monthly
calendar view. What I'm struggleing with is how do I get the first
day of the month to start on the correct day. Also how to fill up the
days in the week prior to the first day with the remaining days of the
previous month.

I've seen some older posts that suggests 42 subreports on the report.
That part is OK, but I don't know how to get the first day of the
month, then all of the other days into the correct subreport for the
day.

Can anyone help with this one?

Thanks in advance,

Bob

Feb 26 '07 #2
Bob
On Feb 26, 11:59 am, "paii, Ron" <p...@packairinc.comwrote:
Check out Allen Browne's. a...@allenbrowne.com calendar form.

I used that as a basis for a report, create 41 day fields like the form, add
to that 41 text fields for your information. The following function is
called in the ONFORMAT event of the detail section. The source data
[WORKDAY] and [DESC] is from a record set opened in the ONOPEN event of the
report.

Private Function ShowCal() As Boolean
On Error GoTo Err_Handler
Dim dtStartDate As Date 'First of month
Dim iDays As Integer 'Days in month
Dim iOffset As Integer 'Offset to first label for month.
Dim i As Integer 'Loop controller.
Dim iDay As Integer 'Day under consideration.
Dim bshow As Boolean 'Flag: show label
Dim cDay As Date ' Current working day

dtStartDate = Me![dValue] - Day(Me![dValue]) + 1 'First of month

iDays = Day(DateAdd("m", 1, dtStartDate) - 1) 'Days in month.
iOffset = WeekDay(dtStartDate, vbSunday) - 2 'Offset to first label
for month.

For i = 0 To 41
With Me("lblDay" & Format(i, "00"))
iDay = i - iOffset
bshow = ((iDay 0) And (iDay <= iDays))
cDay = DateAdd("d", iDay - 1, dtStartDate)

.Visible = bshow
Me("txtDay" & Format(i, "00")).Visible = bshow

If (bshow) Then
If iDay < 10 Then
Me("txtDay" & Format(i, "00")) = ".." & iDay
Else
Me("txtDay" & Format(i, "00")) = "." & iDay
End If
If rsInfoOK Then
rsInfo.FindFirst "[WorkDay]=#" & cDay & "#"
While Not rsInfo.NoMatch
' Build up the text string of the day from source
data
Me("txtDay" & Format(i, "00")) = Me("txtDay" &
Format(i, "00")) & _

vbCrLf & Left$(rsInfo![Desc], 40), 0))

rsInfo.FindNext "[WorkDay]=#" & cDay & "#"
Wend
rsInfo.MoveFirst
End If
End If

If (bshow) And (.caption <iDay) Then
.caption = iDay
End If

End With

Next

Exit_Handler:
Exit Function

Err_Handler:
MsgBox "Error " & Err.Number & " - " & Err.Description, vbExclamation,
conMod & ".ShowCal"
Resume Exit_Handler
End Function

"Bob" <techno...@bellsouth.netwrote in message

news:11**********************@m58g2000cwm.googlegr oups.com...
I've searched this group and have not found any posts since 2001, so
I'm hoping that now there may be a better way.
I have a need to generate a report that looks like a outlook monthly
calendar view. What I'm struggleing with is how do I get the first
day of the month to start on the correct day. Also how to fill up the
days in the week prior to the first day with the remaining days of the
previous month.
I've seen some older posts that suggests 42 subreports on the report.
That part is OK, but I don't know how to get the first day of the
month, then all of the other days into the correct subreport for the
day.
Can anyone help with this one?
Thanks in advance,
Bob- Hide quoted text -

- Show quoted text -
Thanks for your rapid reply. I'll try it shortly and post my results!

Bob

Feb 26 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
12784
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments...
3
2413
by: Chuck Van Den Corput | last post by:
In one of my apps, I developed a calendar report composed of a 6x7 grid of subreports, one for each potential day in a month (the worst case scenario is that a month spans 6 weeks, like July 2005)....
16
3036
by: DFS | last post by:
If you're listening, I want the middle of the calendar (showing 1 month) to open below the cursor position. It currently opens just to the right and below the cursor position. I hunted through...
1
3721
by: Paul H | last post by:
Can anyone give me some pointers as to how to construct a form or forms that will allow me to see a schedule of meeting rooms Booked or Available as a nice visual display. The Query that holds the...
9
14347
by: MikeSA | last post by:
Hi I a trying to create a chart that reflects monthly cumulative totals from a query. The query fields show sales opportunities forecasted invoice date (OppForInvDate), Opportunity Description and...
14
2228
by: magmike | last post by:
Can I do anything with the calendar buttons? I want to display a number on the buttons. I'm using the calendar control on a form that sets a call back date and time. The user can click on the...
1
2510
by: shaggawoo | last post by:
Hello from Nova Scotia Canada. Hi there, Im struggling a bit here and I thought I might seek out some advice. Nice to meet you all. My situation is that im running a database that records...
5
1493
by: Vaudousi | last post by:
Hi Dear Friends Is it possible to integrate Lebans calendar on a form in lieu and place of the Microsoft MonthView ? Many TKS in advance. José
3
6528
by: polisian | last post by:
I'm trying to write a program that makes a monthly calendar. I want it to pull the names of the months out of a file then use seperate functions to assign each an integer 1 through 12, given the...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.