J
Jim Fox
I have a report that I created that has no data, just boxes, lines and one
date field not tied to anything. Basically this report will just print
pages according to the dates you entered. Then according to the day, it
will hide certain boxes.
Here is the code (BELOW) I've drummed up, but how do I use it to print out a
range of pages?
THANKS
Jim
Private Sub Report_Page()
Dim DDate As Date, StartDay As Date, EndDay As Date
StartDay = InputBox("What is the first day you'd like to print?", "START")
EndDay = InputBox("What is the last day you'd like to print?", "FINISH")
DDate = StartDay
Do Until DDate = EndDay + 1
Me![B1].Visible = True
Me![B2].Visible = True
Me![B3].Visible = True
Me![B4].Visible = True
Me![B10].Visible = True
Me![B11].Visible = True
If Format(DDate, "DDD") = "Sun" Then
DDate = DDate + 1
ElseIf Format(DDate, "DDD") = "Mon" Or Format(DDate, "DDD") = "Thu" Then
Me![TheDate] = DDate
Me![B10].Visible = False
Me![B11].Visible = False
Me![B1].Visible = False
Me![B2].Visible = False
Me![B3].Visible = False
Me![B4].Visible = False
ElseIf Format(DDate, "DDD") = "Tue" Then
Me![TheDate] = DDate
Me![B10].Visible = False
Me![B2].Visible = False
Me![B3].Visible = False
Me![B4].Visible = False
ElseIf Format(DDate, "DDD") = "Wed" Then
Me![TheDate] = DDate
Me![B1].Visible = False
Me![B2].Visible = False
Me![B3].Visible = False
Me![B4].Visible = False
Else
Me![TheDate] = DDate
End If
DDate = DDate + 1
Loop
End Sub
date field not tied to anything. Basically this report will just print
pages according to the dates you entered. Then according to the day, it
will hide certain boxes.
Here is the code (BELOW) I've drummed up, but how do I use it to print out a
range of pages?
THANKS
Jim
Private Sub Report_Page()
Dim DDate As Date, StartDay As Date, EndDay As Date
StartDay = InputBox("What is the first day you'd like to print?", "START")
EndDay = InputBox("What is the last day you'd like to print?", "FINISH")
DDate = StartDay
Do Until DDate = EndDay + 1
Me![B1].Visible = True
Me![B2].Visible = True
Me![B3].Visible = True
Me![B4].Visible = True
Me![B10].Visible = True
Me![B11].Visible = True
If Format(DDate, "DDD") = "Sun" Then
DDate = DDate + 1
ElseIf Format(DDate, "DDD") = "Mon" Or Format(DDate, "DDD") = "Thu" Then
Me![TheDate] = DDate
Me![B10].Visible = False
Me![B11].Visible = False
Me![B1].Visible = False
Me![B2].Visible = False
Me![B3].Visible = False
Me![B4].Visible = False
ElseIf Format(DDate, "DDD") = "Tue" Then
Me![TheDate] = DDate
Me![B10].Visible = False
Me![B2].Visible = False
Me![B3].Visible = False
Me![B4].Visible = False
ElseIf Format(DDate, "DDD") = "Wed" Then
Me![TheDate] = DDate
Me![B1].Visible = False
Me![B2].Visible = False
Me![B3].Visible = False
Me![B4].Visible = False
Else
Me![TheDate] = DDate
End If
DDate = DDate + 1
Loop
End Sub