Text controls that grow horizontally

R

Rod

I'm trying to create a text string comprised of various text controls for a
bibliography list. I need to format one of the controls (the title in
italic) different from the others. I haven't found a way of doing this
through the format function.

I know that controls can grow vertically. Is there a way for controls to
grow horizontally to allow for a text string?
 
D

Duane Hookom

If everything fits on one line, you might be able to use the Print method of
your report. Assuming you have two bound text boxes in your detail section
for FirstName and LastName. You want them to display with a bold lastname
followed by a non-bold firstname. Make both text boxes hiddent and use code
like the following. The +50 determines the spacing between the lastname and
firstname

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.CurrentY = Me.LastName.Top
Me.CurrentX = Me.LastName.Left
Me.FontBold = True
Me.Print Me.LastName
Me.FontBold = False
Me.CurrentY = Me.LastName.Top
Me.CurrentX = Me.CurrentX + 50
Me.Print Me.FirstName
End Sub
 
R

Rod

Thanks Duane, for your reply. Unfortunately, at least half of the entries
will be more than one line. As you can imagine, this is a bit frustrating
that Access doesn't provide formatting options in text strings. It is such
an obvious need. I've looked at Leban's website. But I'd need to be a
professional programmer to figure it out.

That there isn't a simple, straightforward way to handle this common need is
beyond me.

Again, thanks for your suggestion.
 
D

Duane Hookom

I haven't really found much of a need for Rich Text in my apps. The
functionality is available in most versions through either Leban's solution
or I believe Access 2007.

Whenever I need advanced formatting, I generally merge my Access records to
Word.
 

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