
Simple question: - Printing to Text Box
Quote:
> [...]
> I have two problems, firstly making textbox.text = recordset.value only
> shows the last record, it is overwriting all the other records. How do I
> get a carriage return or move on to the next line
I think you have mistaken somehow (a typo?) because in my VB the
Recordset object does not have Value property. Instead, you should use
Fields collection and every Field object has the Value property
which is default so you don't have to type ".Value" explicite.
First of all, you should set MultiLine property of TextBox to True.
I doesn't seem that data bound text control would be good for you,
so you must do something like that:
Dim sTemp As String
While Not rst.EOF
If sTemp <> "" Then sTemp = sTemp & vbCrLf ' This to break the lines
sTemp = sTemp & rst.Fields(0) & vbTab & rst.Fields(1) ' or whatever to retrieve data
rst.MoveNext
Wend
textbox.Text = sTemp
Hope that all data you want to display can fit in both sTemp string
variable and textbox.
Quote:
> The second problem is how to open out the fields in the recordset when
> they are printed in the text box so that they are in neat columns
vbTab (or some of them--look above) should help. Good luck.
RL