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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formating concatenated text in a textbox

Status
Not open for further replies.

Jose30

Programmer
Oct 24, 2005
9
PT
Hello folks.

I am creating a DB to manage certificates. Therefor if a trainee concludes a traning course I have to print a Certificate.

Ok. This part is simple a its done. My problem is that the certificate is a TextBox with the concatenated fields and I need use several text formats like Bold, Underline, etc.

Its possible to do this?

Thanks
 
The only way to format a text box with multiple "styles" is to use a Rich Text Format control. Have you considered merging your records with Word?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Well...

No. How would I do that? How can I creat a Rich Text format Control?

Thanks

 
Do you need to use a just a single text box? I have a report/certificate where name is a concatenation, but other info is seperate text boxes or labels.

 
Well I think yes, because the different lenght of the data in the fields, leaves blank spare spaces between two labels in the report.

Sorry about my poor English. I am Portuguese and I am not used to write in English.

Thanks

 
I think Microsoft has a RTF control but I would search Stephen Leban's site (might be off-line at the moment).

To merge with Word, select Tools->Office Links->Merge It with Microsoft Word.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
ok thanks I will try that.

Lets see if it works

Thank you all

 
well i can't merge it. I can only subscribe it, and it loses the pictures



 
What are you attempting to merge? You should merge with a query or table. Where are the pictures coming from? Are they different for each certificate?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I have a background picture in the certificate. its the same picture for every certificate. and when i subscribe it to Word file i loose the background and some special charaters.

 
You can add the graphic to the background of your Word document. Don't expect any graphics to pass from Access to Word.

If you have questions about merging data into a Word document you can ask here but the best place to ask would be a Word forum or news group.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
ok sorry. let me ask something else is it possible, thru VBA, create a text report right?

and if it so is it possible to format the text with VBA correct?

If it is tell me the method or the function to do so.

Thx

Sorry about the Word Question.

 
You can use the Print method in a report's code module to print text about anywhere on your report and of about any font, color,... It becomes very difficult to get these printed values to line up, center, etc. You set their Top and Left positions using Me.CurrentX and Me.CurrentY.

Here is a very simple demonstration of using the print event. You could substitute the printed values with text bound to invisible controls on your report.
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Dim lngY As Long
    lngY = 500
    CurrentX = 2000
    Me.FontSize = 20
    Me.FontName = "Arial"
    Me.FontBold = True
    Me.ForeColor = vbBlue
    CurrentY = lngY
    Me.Print "Hello "
    Me.FontBold = True
    Me.ForeColor = vbGreen
    CurrentY = lngY
    Me.Print "There "
    Me.FontBold = False
    CurrentY = lngY
    Me.ForeColor = vbRed
    Me.Print "Buddy"
End Sub

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Ok thx this what I needed.

This is the way i'll try.

 
Ok its beautifull thanx.

Last Question!!!!

How can i Separate one record from the other?

I used a cycle With to rotate thru the Recordset but he print all records in the same page.

This is the last one I promisse.

Thanks in advance

 
I wouldn't use any recordset other than the report's record source. You would need to bind fields from the record source to invisible controls. Then rather than using rs![LastName], you would reference the text box bound to LastName, Me.txtLastName.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top