Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Create A Calendar Report

Status
Not open for further replies.

grobermatica

Programmer
Jul 26, 2006
16
GB
Hi,

I've already created a report which uses snaked (column) formatting with gives 7 columns for a months worth of data.

I'm having trouble formatting the report so that it appears like a calendar... i.e so that the first day is a monday (or possibly a sunday?) At present the first day appears as whatever the day happens to be on the 1st of the month.

Any help would be much appreciated.

Craig
 
Check the various calendar reports at
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Hi dhookom,

Thanks for your reply... I had actually already seen this and the reports in the sample databse don't do what I want. I'm looking for a report which shows the whole month... the sort you would see in a calendar that you would buy that has 1 page for each month... I'll attempt an example below:

Mon Tues Wed Thurs Fri Sat Sun
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31


So it has ocurred in the example above that the 1st falls on a wednesday... how do I make this happen in an access report?

Cheers

Craig
 
You can use the example as provided and use a little code to hide the day subreport if the month of the date isn't in the month you want to display.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
So are you saying that I need to query the whole year and narrow the results down using code? Isn't there a way to do it by only querying the month, then change where the results start using code?

Cheers


Craig
 
Your queries can filter the dates to whatever you want. If you were looking at my samples, they attempted to provide some ideas for report layout, not necessarily query criteria.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I've sorted it... for anyone who's interested here's the code I used... its a bit messy but I'm no pro:

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim intDay As Integer
Dim intDayValue As Integer

intDay = Format(Me.ConstDate, "d")

If intDay = 1 Then

    Select Case Me.Day
    
        Case Is = "mon"
        
        Case Is = "tue"
        intDayValue = 1
        
        Case Is = "wed"
        intDayValue = 2
        
        Case Is = "thu"
        intDayValue = 3
        
        Case Is = "fri"
        intDayValue = 4
        
        Case Is = "sat"
        intDayValue = 5
        
        Case Is = "sun"
        intDayValue = 6
    
    
    End Select
    
        If intDayValue >= FormatCount Then
                 
                 Me.MoveLayout = True
                 Me.NextRecord = False
                 Me.PrintSection = False
        Else
        End If
Else
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top