Duane Hookom Appointments

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all
I have a copy of Duane Hookom's calendar report database. What I want is the
weekly schedule report to open on the current week. Does anyone know how to
do this? any help would be great!

Cheers
Lee
 
The code for the command button that opens the report would need to be
something like:

Private Sub cmdWeekAtAGlance_Click()
On Error GoTo Err_cmdWeekAtAGlance_Click

Dim stDocName As String
Dim strWhere as String 'Added
Dim datStart as Date 'Added
Dim datEnd as Date 'Added
'get the Sunday of this week 'Added
datStart = DateAdd("d",-Weekday(Date),Date)+1 'Added
'get the Saturday of this week 'Added
datEnd = datStart + 6 'Added
strWhere = "[WeekOf] Between #" & datStart & _
"# AND #" & datEnd & "#" 'Added
stDocName = "rptAppointWeekly"
DoCmd.OpenReport stDocName, acPreview, , strWhere 'modified

Exit_cmdWeekAtAGlance_Click:
Exit Sub

Err_cmdWeekAtAGlance_Click:
MsgBox Err.Description
Resume Exit_cmdWeekAtAGlance_Click

End Sub
 
Back
Top