retain orig format in unbound tbox

G

Guest

I have created a concatenated text box, in Access 2003, thanks to some very
good help from an earlier post. Now I have the info displaying exactly how I
want it, except the different parts of the concatenation need to be formatted
differently, basically they need the formatting of the original bound tbox,
not the single unbound.
How do I format the different parts of the unbound box individually, or
preferrably, how can I keep the original format of each part of the
concatenation.?
Here is what I currently have. I'm new to the coding side, so feel free to
point out any mistakes. All I know is it shows me what I want to see:))

Option Compare Database ' Use database order for string comparisons.
Option Explicit
Dim FirstPass As Integer


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Local Error GoTo Detail_Format_Err
If Not FirstPass Then
Me!AllAuthors = Me![Author]
FirstPass = True
Else
Me!AllAuthors = Me!AllAuthors & ", " & Me![Author]
Me!OtherInfo = Me!AllAuthors & ". " & "(" & Me![YearDate] & "). " &
Me![TitleofArticle] & ". " & Me![NameofJournal] & ", " & Me![VolNumber] & "("
& Me![issueNumber] & "), " & Me![pageNumbers] & "."
End If
Detail_Format_End:
Exit Sub
Detail_Format_Err:
MsgBox Error$
Resume Detail_Format_End
End Sub

Private Sub grpHeaderTitle_Format(Cancel As Integer, FormatCount As Integer)
Me!AllAuthors = Null
FirstPass = False

End Sub
 
T

tina

concatenated data is always a String (text) data type. so you can use the
Format(), UCase(), LCase() and StrConv() functions to set up each portion of
the string *as you concatenate it*. for example, and keeping in mind that i
don't know anything about your data:

Me!AllAuthors = Me!AllAuthors & ", " & UCase(Me![Author])
Me!OtherInfo = Me!AllAuthors & ". " & "(" & Format(Me![YearDate],
"yyyy") & "). " &
StrConv(Me![TitleofArticle], vbProperCase) & ". " & Me![NameofJournal] & ",
" & Me![VolNumber] & "("
& Me![issueNumber] & "), " & Me![pageNumbers] & "."

suggest you read up on the functions listed above, so you'll understand how
they work.

hth
 
L

Larry Linson

Tina is correct, but if you had hoped to have some parts of the same text
box be bold, some normal, some italic, some not italic, some underlined,
some not underlined -- that is not possible in an Access text box until
Access 2007. But the text capitalization, etc., that Tina describes should
work just fine.

Larry Linson
Microsoft Access MVP
Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top