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

Formatting in multi-field controls

Status
Not open for further replies.

Robbo1974

Technical User
Jun 1, 2001
151
GB
Hi all,

I have a control in a report which pulls together a set of values from various fields thus:

Code:
Control Source = "Order Number " & [oldordernumber] & ", placed by " & [placedby] & " on " & [date] & " Type = " & [Type]

To display an order, who placed it, when it was placed and hat type of order it was.

I want to display the field [type] in bold, leaving the rest as normal.

How can I do it?

Thanks in advance, Iain Robbo ;-)
 
Sounds like you want to Format the Type only but would have to set it something like this:

Private Sub ReportHeader0_Print(Cancel As Integer, _
PrintCount As Integer)
Dim MyDate

MyDate = Date
Me.FontBold = True
' Print report title in bold.
Me.Print("Sales Management Report")
Me.Print(MyDate)
End Sub

I think you would want to set the FontBold to True before the statement [type] then to False after the [Type]
I can expect anything and everything of myself;
But can only accept or reject what you have to offer!
 
Hi Namsha,

I'm a bit confused here! All I want to do is format a section of the displayed characters in the control. The control is located in the detail section of the report.

Example:

Order Number is R555

It was placed by John Smith

It was placed on 13/04/02

The type of order is repeat

So I want the control to display like this:

Order Number R555, placed by John Smith on 13/04/02 Type = Repeat

I don't see how the above code would do this, could you explain a little more please?

Thanks, Iain :) Robbo ;-)
 
Try in VB code in the report open Me.Type.FontBold = True I was merely showing you how to set a certain field to Print to Bold but in Report Open you should be able to set that field to that format. I can expect anything and everything of myself;
But can only accept or reject what you have to offer!
 
Thanks Namsha,

I've tried

Code:
Private Sub Report_Open(Cancel As Integer)

Me.Type.FontBold = True

End Sub

on the open event for the report, but it breaks with the message:

"Compile Error:

Method or data member not found"

with the text
Code:
.FontBold =
highlighted

All of my references seem to be correct.

The problem seems to be that I only want a certain part of the field to display in bold rather than the whole field, which the above code covers. Any other ideas?

Robbo ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top