I am not sure if this can even be done, but I have a report that lists equipment and serial numbers that a user selects from a form along with a start date and an projected end date. I currently have a VBA code that will list the dates from date issued to the Projected end date as long as the projected end date is not past 14 days. What I would like to happen is when the report is ran that the dates are listed from the date issued up to the projected end date and if the projected end date is more than 14 days create a second page with all the information as the first but continue to list all the dates until it reaches the projected end date. The current code that i have is as follows:
This is what the report looks like. The dates list on the top row between serial and remarks.
Code:
Private Sub Report_Load()
Dim ColumnDate As Date
Dim ColumnNmbr As Integer
ColumnDate = [Date_Issued]
ColumnNmbr = 1
While ColumnDate <= Me.Projected_End_Date
Select Case ColumnNmbr
Case 1
Me.Text1 = ColumnDate
Case 2
Me.Text2 = ColumnDate
Case 3
Me.Text3 = ColumnDate
Case 4
Me.Text4 = ColumnDate
Case 5
Me.Text5 = ColumnDate
Case 6
Me.Text6 = ColumnDate
Case 7
Me.Text7 = ColumnDate
Case 8
Me.Text8 = ColumnDate
Case 9
Me.Text9 = ColumnDate
Case 10
Me.Text10 = ColumnDate
Case 11
Me.Text11 = ColumnDate
Case 12
Me.Text12 = ColumnDate
Case 13
Me.Text13 = ColumnDate
Case 14
Me.Text14 = ColumnDate
End Select
ColumnDate = DateAdd("d", 1, ColumnDate)
ColumnNmbr = ColumnNmbr + 1
Wend
End Sub
This is what the report looks like. The dates list on the top row between serial and remarks.
Last edited: