Re: Bold Format Only Part of a Text Box Control

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You can use the Print method of the report in the On Format event. For
instance if you were reporting the Customer table from Northwind and wanted
to concatenate the CustomerID and CompanyName with the first part bolded you
could use the following code in the On Format event of the section
containing the text. NOTE: the CustomerID and CompanyName would need to be
bound to controls in that report section. The controls could/should be
invisilbe.

My code also assume you add an invisible line named "LineTop" where you want
the text to appear.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Dim intSpacing As Integer
intSpacing = 60 'space between fields
Me.CurrentX = Me.LineTop.Left
Me.CurrentY = Me.LineTop.Top
Me.FontSize = 10
Me.FontBold = True
Me.Print Me.CustomerID 'must be bound control
Me.FontBold = False
Me.CurrentY = Me.LineTop.Top
Me.CurrentX = Me.CurrentX + intSpacing
Me.Print Me.CompanyName 'must be bound control
End Sub


--
Duane Hookom
MS Access MVP

"laknight" <laknight@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:16524704-1CFE-45A6-940B-61525DBBEC09@xxxxxxxxxxxxxxxx
I have this as a control on one of my reports.

=RTrim([PART]) & " [ " & RTrim([Description]) & " ]"

It is two fields, concatenated together with right trim so that they
flow/slide together nicely. Is there a way to specify just the [PART]
field
to print in BOLD or is there another way to get text boxes to slide
together
without using concatenation??

Thanks for your help!


.



Relevant Pages

  • Re: drop down list within a query?
    ... I have done as suggested and i now get this message "The command or action ... When the code window opens the cursor will be flashing between 2 ... Let's assume it is a CustomerID number you need as criteria. ... Run the Report. ...
    (microsoft.public.access.queries)
  • Re: Alternate rows with bold font
    ... Opened report in design view ... property of a line control. ... alternate between bold font and normal font to make the report easier to ... Code the Detail Section Format event: ...
    (microsoft.public.access.reports)
  • Re: Alternate rows with bold font
    ... Viewed report in design view ... This is why I need to alternate between bold and normal font. ... property of a line control. ... Code the Detail Section Format event: ...
    (microsoft.public.access.reports)
  • Re: In a report -Using a calculated field in Select Case causes Er
    ... Now, run your report. ... The line has not executed, but it will be the next to execute. ... Dave Hargis, Microsoft Access MVP ... I put the code in the On Format event and the error went away. ...
    (microsoft.public.access.modulesdaovba)
  • Re: report returns Field ID instead of value
    ... Check on your report ... when I run the query normally, the datasheet returns the correct name so I ... CustomerID is a number. ... If you look at TblOrder, ...
    (microsoft.public.access.queries)