Duane Hookom Appointments

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
 
D

Duane Hookom

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
 

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