B
BethHill
Hello,
I have a report in Access 2003 with a two groupings. In the detail section
of the report, I have a wide text box (name is Text0) that is not bound. On
the "On Format" procedure of the detail section, I have the following code:
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT * from [tbl Main]")
rs.MoveFirst
intLength = 0
stResults = ""
If rs.EOF = True And rs.BOF = True Then Exit Sub
Do Until rs.EOF 'Do this procedure until the End of File is reached.
intLength = 0
stResults = ""
Do Until Len(stResults) >= 50
intLength = Len(rs!Req_ID)
Do Until intLength >= 12
stResults = stResults & rs!Req_ID & " "
intLength = Len(stResults)
Loop
text0.Value = stResults
rs.MoveNext
Loop 'The text box is full
Loop 'End of File
rs.Close
db.Close
End Sub
I have several Msgbox in the code that if taken out, the "no current record"
appears. I want the report to open with the recordset at the end of the code
but at the end of the code, I get the "no current record" error message.
Once I click OK and stop the debugging process, the report opens in design
view. What am I doing wrong?
I have a report in Access 2003 with a two groupings. In the detail section
of the report, I have a wide text box (name is Text0) that is not bound. On
the "On Format" procedure of the detail section, I have the following code:
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT * from [tbl Main]")
rs.MoveFirst
intLength = 0
stResults = ""
If rs.EOF = True And rs.BOF = True Then Exit Sub
Do Until rs.EOF 'Do this procedure until the End of File is reached.
intLength = 0
stResults = ""
Do Until Len(stResults) >= 50
intLength = Len(rs!Req_ID)
Do Until intLength >= 12
stResults = stResults & rs!Req_ID & " "
intLength = Len(stResults)
Loop
text0.Value = stResults
rs.MoveNext
Loop 'The text box is full
Loop 'End of File
rs.Close
db.Close
End Sub
I have several Msgbox in the code that if taken out, the "no current record"
appears. I want the report to open with the recordset at the end of the code
but at the end of the code, I get the "no current record" error message.
Once I click OK and stop the debugging process, the report opens in design
view. What am I doing wrong?