Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Start Time Issue

Author  Topic 

saidev
Posting Yak Master

101 Posts

Posted - 2006-09-05 : 18:34:22
Hi Guys,
I have a Report that is printing from 12:00:00AM.
I want the Start time is from 6 AM. Can you guys modify the code or help me with any new suggestion. Appreciate your help
Thanks,


Option Compare Database
Public strStartDateVar As Date
Public strEndDateVar As Date

Private Sub Report_Open(Cancel As Integer)
Dim strSQL As String
Dim intWeekDay As Integer
Dim intTemp As Integer
Dim intDiff As Integer

'strStartDateVar = Month(Forms!frmReportPicker!axMonthlySchedule) & "/01/" & Year(Forms!frmReportPicker!axMonthlySchedule)
strStartDateVar = Format(Forms!frmReportPicker!axAirDate1, "mm/dd/yyyy")
intWeekDay = Weekday(strStartDateVar, vbMonday)
intTemp = intWeekDay - (intWeekDay - 1)
intDiff = intWeekDay - intTemp
If intDiff <> 0 Then
strStartDateVar = DateAdd("d", -intDiff, strStartDateVar)
End If

'strEndDateVar = Month(Forms!frmReportPicker!axMonthlySchedule) & "/01/" & Year(Forms!frmReportPicker!axMonthlySchedule)
strEndDateVar = Format(Forms!frmReportPicker!axAirDate1, "mm/dd/yyyy")
intWeekDay = Weekday(strEndDateVar, vbMonday)
intTemp = intWeekDay - (intWeekDay - 7)
intDiff = intWeekDay - intTemp
If intDiff <> 0 Then
strEndDateVar = DateAdd("d", -intDiff, strEndDateVar)
End If


End Sub

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2006-09-05 : 20:06:07
This bit of code won't even get executed until the report is started. So the scheduling is done elsewhere. Most likely it's an NT scheduled task so that's a good place to start looking.

HTH,

Tim
Go to Top of Page
   

- Advertisement -