Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Rich Text?

Status
Not open for further replies.

aldi

IS-IT--Management
May 10, 2002
421
CA
Has any of you ever wrote or are in the process of creating an application that uses a RichTextBox. If you had. How did you do to print?

A while ago I wrote an access application that display a list of Orders entered in BusinessVision (accounting package) after you select one of them you are presented with all the information pertaining to the selected order and gives you the opportunity to enter instructions for production, in this case I used a regular text box which has no formatting capabilities - boldness, colors etc and I used access reports to print three different reports.

Now I was asked to add formatting capabilities to the software. Then I decided to move it to VB6 using pervasive SQL 2000i as the backend. Now I have the following problems:

1) I don't know how to save the rich text contents into the pervasive DB. I tried using longvarchar and longvarbinay but doesn't work.

2) How do I do to print? Can I use CR? I have v8.5 dev edition but I don't see how to add a RTF box to the canvas report. If I use PrintForm I am limited to the size of the form and this work order program sometimes needs more than two pages of instructions.

Any enlighting will be very well appreciated!!!!!

please help!
 

To save the contents to the db to keep its formatting use TextRTF instead of Text. For Printing use...
[tt]
RTB.SelStart = 0
RTB.SelPrint Printer.hDc
[/tt]

Good Luck

 
Hi vb5prgrmr and thank you for your prompt response

I used TextRTF but it gives me the error:

"Multiple-step OLE DB operation generated error. Check each OLE DB status value, if available. No work was done."

Do you know what is wrong?

Thanks again,
 
vb5prgrmr,
I too am having this problem. I am sending the text by editing a recordset:

Public Sub Send_Msg()
With FrmCHAT.AdoCHAT
CmdType = adCmdTable
If (RTInvite) Then
StrSQL = "TBL_INVITE"
Else
StrSQL = "CHAT_MSG"
End If
Call Refresh_Ado
With .Recordset
.AddNew
.Fields(0).Value = Now()
.Fields(1).Value = LOGIN_Name & ": " & NewChatMsg
.Update
End With
End With
End Sub

and do not see the formatting in ACCESS.
 
I set the field to store the textRTF to MEMO formatting in MSAccess and have no problems with the datasource of the Rich text box set to this field or reading with a recordset.
(I used Access97)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top