PDA

View Full Version : Macro



Juckhfi
03-22-2011, 01:20 PM
Hi,

I have Database in Ms Access 2003

I would like to disable printing reports till Friday evening

User can be able to print the reports from that Ms Access Database on Friday evening

Any help I really appreciate

Thanks a lot

HiTechCoach
04-01-2011, 11:35 PM
You could add somethind like this to each report's On Open Event.


Private Sub Report_Open(Cancel As Integer)

If Weekday(Date) = 5 Then
If (Time < #6:00:00 PM# Or Time > #10:00:00 PM#) Then

MsgBox "run report can only be run between 6:00 pm an 10:00 pm"
Cancel = True
End If

Else

MsgBox "report can only be run on Friday"
Cancel = True


End If

End Sub