S
seeker
I have developed the following code and when I run the report numbers are not
filled in but when I step through the code it does populate the report. What
is the problem?
Private Sub Report_Page()
Dim rs As DAO.Recordset
Dim intcount As Integer
Set rs = CurrentDb.OpenRecordset("qryrandomnumbergenerator")
intcount = 1
While Not rs.EOF
Select Case intcount
Case 1
txtTop1 = rs!TopNumber
txtBottom1 = rs!BottomNumber
Case 2
txtTop2 = rs!TopNumber
txtBottom2 = rs!BottomNumber
Case 3
txtTop3 = rs!TopNumber
txtBottom3 = rs!BottomNumber
Case 4
txtTop4 = rs!TopNumber
txtBottom4 = rs!BottomNumber
Case 5
txtTop5 = rs!TopNumber
txtBottom5 = rs!BottomNumber
Case 6
txtTop6 = rs!TopNumber
txtBottom6 = rs!BottomNumber
Case 7
txtTop7 = rs!TopNumber
txtBottom7 = rs!BottomNumber
Case 8
txtTop8 = rs!TopNumber
txtBottom8 = rs!BottomNumber
Case 9
txtTop9 = rs!TopNumber
txtBottom9 = rs!BottomNumber
Case 10
txtTop10 = rs!TopNumber
txtBottom10 = rs!BottomNumber
Case 11
txtTop11 = rs!TopNumber
txtBottom11 = rs!BottomNumber
Case 12
txtTop12 = rs!TopNumber
txtBottom12 = rs!BottomNumber
Case 13
txtTop13 = rs!TopNumber
txtBottom13 = rs!BottomNumber
Case 14
txtTop14 = rs!TopNumber
txtBottom14 = rs!BottomNumber
Case 15
txtTop15 = rs!TopNumber
txtBottom15 = rs!BottomNumber
Case 16
txtTop16 = rs!TopNumber
txtBottom16 = rs!BottomNumber
Case 17
txtTop17 = rs!TopNumber
txtBottom17 = rs!BottomNumber
Case 18
txtTop18 = rs!TopNumber
txtBottom18 = rs!BottomNumber
Case 19
txtTop19 = rs!TopNumber
txtBottom19 = rs!BottomNumber
Case 20
txtTop20 = rs!TopNumber
txtBottom20 = rs!BottomNumber
Case 21
txtTop21 = rs!TopNumber
txtBottom21 = rs!BottomNumber
Case 22
txtTop22 = rs!TopNumber
txtBottom22 = rs!BottomNumber
Case 23
txtTop23 = rs!TopNumber
txtBottom23 = rs!BottomNumber
Case 24
txtTop24 = rs!TopNumber
txtBottom24 = rs!BottomNumber
Case 25
txtTop25 = rs!TopNumber
txtBottom25 = rs!BottomNumber
Case 26
txtTop26 = rs!TopNumber
txtBottom26 = rs!BottomNumber
Case 27
txtTop27 = rs!TopNumber
txtBottom27 = rs!BottomNumber
Case 28
txtTop28 = rs!TopNumber
txtBottom28 = rs!BottomNumber
Case 29
txtTop29 = rs!TopNumber
txtBottom29 = rs!BottomNumber
Case 30
txtTop30 = rs!TopNumber
txtBottom30 = rs!BottomNumber
Case 31
txtTop31 = rs!TopNumber
txtBottom31 = rs!BottomNumber
Case 32
txtTop32 = rs!TopNumber
txtBottom32 = rs!BottomNumber
Case 33
txtTop33 = rs!TopNumber
txtBottom33 = rs!BottomNumber
Case 34
txtTop34 = rs!TopNumber
txtBottom34 = rs!BottomNumber
Case 35
txtTop35 = rs!TopNumber
txtBottom35 = rs!BottomNumber
Case 36
txtTop36 = rs!TopNumber
txtBottom36 = rs!BottomNumber
End Select
intcount = intcount + 1
rs.MoveNext
Wend
End Sub
filled in but when I step through the code it does populate the report. What
is the problem?
Private Sub Report_Page()
Dim rs As DAO.Recordset
Dim intcount As Integer
Set rs = CurrentDb.OpenRecordset("qryrandomnumbergenerator")
intcount = 1
While Not rs.EOF
Select Case intcount
Case 1
txtTop1 = rs!TopNumber
txtBottom1 = rs!BottomNumber
Case 2
txtTop2 = rs!TopNumber
txtBottom2 = rs!BottomNumber
Case 3
txtTop3 = rs!TopNumber
txtBottom3 = rs!BottomNumber
Case 4
txtTop4 = rs!TopNumber
txtBottom4 = rs!BottomNumber
Case 5
txtTop5 = rs!TopNumber
txtBottom5 = rs!BottomNumber
Case 6
txtTop6 = rs!TopNumber
txtBottom6 = rs!BottomNumber
Case 7
txtTop7 = rs!TopNumber
txtBottom7 = rs!BottomNumber
Case 8
txtTop8 = rs!TopNumber
txtBottom8 = rs!BottomNumber
Case 9
txtTop9 = rs!TopNumber
txtBottom9 = rs!BottomNumber
Case 10
txtTop10 = rs!TopNumber
txtBottom10 = rs!BottomNumber
Case 11
txtTop11 = rs!TopNumber
txtBottom11 = rs!BottomNumber
Case 12
txtTop12 = rs!TopNumber
txtBottom12 = rs!BottomNumber
Case 13
txtTop13 = rs!TopNumber
txtBottom13 = rs!BottomNumber
Case 14
txtTop14 = rs!TopNumber
txtBottom14 = rs!BottomNumber
Case 15
txtTop15 = rs!TopNumber
txtBottom15 = rs!BottomNumber
Case 16
txtTop16 = rs!TopNumber
txtBottom16 = rs!BottomNumber
Case 17
txtTop17 = rs!TopNumber
txtBottom17 = rs!BottomNumber
Case 18
txtTop18 = rs!TopNumber
txtBottom18 = rs!BottomNumber
Case 19
txtTop19 = rs!TopNumber
txtBottom19 = rs!BottomNumber
Case 20
txtTop20 = rs!TopNumber
txtBottom20 = rs!BottomNumber
Case 21
txtTop21 = rs!TopNumber
txtBottom21 = rs!BottomNumber
Case 22
txtTop22 = rs!TopNumber
txtBottom22 = rs!BottomNumber
Case 23
txtTop23 = rs!TopNumber
txtBottom23 = rs!BottomNumber
Case 24
txtTop24 = rs!TopNumber
txtBottom24 = rs!BottomNumber
Case 25
txtTop25 = rs!TopNumber
txtBottom25 = rs!BottomNumber
Case 26
txtTop26 = rs!TopNumber
txtBottom26 = rs!BottomNumber
Case 27
txtTop27 = rs!TopNumber
txtBottom27 = rs!BottomNumber
Case 28
txtTop28 = rs!TopNumber
txtBottom28 = rs!BottomNumber
Case 29
txtTop29 = rs!TopNumber
txtBottom29 = rs!BottomNumber
Case 30
txtTop30 = rs!TopNumber
txtBottom30 = rs!BottomNumber
Case 31
txtTop31 = rs!TopNumber
txtBottom31 = rs!BottomNumber
Case 32
txtTop32 = rs!TopNumber
txtBottom32 = rs!BottomNumber
Case 33
txtTop33 = rs!TopNumber
txtBottom33 = rs!BottomNumber
Case 34
txtTop34 = rs!TopNumber
txtBottom34 = rs!BottomNumber
Case 35
txtTop35 = rs!TopNumber
txtBottom35 = rs!BottomNumber
Case 36
txtTop36 = rs!TopNumber
txtBottom36 = rs!BottomNumber
End Select
intcount = intcount + 1
rs.MoveNext
Wend
End Sub