F
francvs
Hi all,
is there any way to print a string with different font weights/styles
in a detail_format (or detail_print) function?
Let's clear my problem a bit more: I am writing a report which should
display records from a query in different ways, depending on the value
of a particular field. Moreover, the report should sweep away the
(frequent) empty fields it encounters on its road.
What i did so far is to make the fields invisible from the design view,
and then build a properly formatted string from the
Me.fieldname.values.
But this prevents me from setting the fonts the way I want, except for
the whole report. Can't I "set" the properties of a single piece of
string?
Any idea? Thanks in advance.
this is my code:
Private Sub Corpo_Format(Cancel As Integer, FormatCount As Integer)
Dim rpt As Report
Dim strMyRecord As Variant
Set rpt = Me
With rpt
.ScaleMode = 3
.FontName = "Trebuchet"
.FontSize = 11
End With
rpt.CurrentX = 0
rpt.CurrentY = 0
' this is the formatting I need to do
If IsNull(Me.Specifiche_Autore.Value) Then
strMyRecord = Me.Autore.Value & ", " & Me.Titolo.Value & ". " &
_ Me.Sottotitolo.Value
ElseIf Me.Autore.Value = "AAVV" Then
strMyRecord = Me.Specifiche_Autore.Value & " (cur.), " &
Me.Titolo.Value & ". " & _
Me.Sottotitolo.Value
Else
strMyRecord = Me.Autore.Value & " (cur.), " & Me.Titolo.Value &
". " & _ Me.Sottotitolo.Value & _
vbNewLine & "Altri aut.:" & Me.Specifiche_Autore.Value
End If
rpt.Print strMyRecord
End Sub
is there any way to print a string with different font weights/styles
in a detail_format (or detail_print) function?
Let's clear my problem a bit more: I am writing a report which should
display records from a query in different ways, depending on the value
of a particular field. Moreover, the report should sweep away the
(frequent) empty fields it encounters on its road.
What i did so far is to make the fields invisible from the design view,
and then build a properly formatted string from the
Me.fieldname.values.
But this prevents me from setting the fonts the way I want, except for
the whole report. Can't I "set" the properties of a single piece of
string?
Any idea? Thanks in advance.
this is my code:
Private Sub Corpo_Format(Cancel As Integer, FormatCount As Integer)
Dim rpt As Report
Dim strMyRecord As Variant
Set rpt = Me
With rpt
.ScaleMode = 3
.FontName = "Trebuchet"
.FontSize = 11
End With
rpt.CurrentX = 0
rpt.CurrentY = 0
' this is the formatting I need to do
If IsNull(Me.Specifiche_Autore.Value) Then
strMyRecord = Me.Autore.Value & ", " & Me.Titolo.Value & ". " &
_ Me.Sottotitolo.Value
ElseIf Me.Autore.Value = "AAVV" Then
strMyRecord = Me.Specifiche_Autore.Value & " (cur.), " &
Me.Titolo.Value & ". " & _
Me.Sottotitolo.Value
Else
strMyRecord = Me.Autore.Value & " (cur.), " & Me.Titolo.Value &
". " & _ Me.Sottotitolo.Value & _
vbNewLine & "Altri aut.:" & Me.Specifiche_Autore.Value
End If
rpt.Print strMyRecord
End Sub