I am trying to build a string based upon a recordset by concatenating the fields as follows:
I'd like to know if it is possible to format text while building a string of values. What I am trying to do is to populate a large text box on a report in one shot.
If I can, I'd like to separate the lines of text with vbCrLf but for section headers like the one above, I'd like to change the look by underlining, making bold and changing the font size.
I know that I can use Space
to indent or I can also manipulate position by using a scale based upon number of twips. But, I am not sure that I can do what I mention above. Any suggestions are most appreciated.
thanks,
Ben
Code:
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer
Dim db1 As dao.Database, rs1 As dao.Recordset, myString As String, strTxtAttach as String
Set db1 = CurrentDb
myString = "SELECT Field1, Field2, Field3,...WHERE [condition]
Set rs1 = db1.OpenRecordset(sql, dbOpenDynaset, dbSeeChanges)
strTxtAttach = ""
If rs1.Fields("chkBox1") = True Then
strTxtAttach = strTxtAttach & "Per " & Me.Field1 & " Identification Number: " & " " & rs1.Fields("Field2") & vbCrLf & vbCrLf
End If
strTxtAttach = strTxtAttach & Me.FontUnderline("This is the section text to format:")...
Me.txtSection1 = strTxtAttach
I'd like to know if it is possible to format text while building a string of values. What I am trying to do is to populate a large text box on a report in one shot.
If I can, I'd like to separate the lines of text with vbCrLf but for section headers like the one above, I'd like to change the look by underlining, making bold and changing the font size.
I know that I can use Space
thanks,
Ben