Re: OnFormat action not executed when exporting to PDF

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



Hi Hakan,

I tried your test case, and found that with Me.Text1.FontWeight=1000 I got the behaviour you describe. However, if I change that to Me.Text1.FontWeight=700 (using the value given in the help file for enumeration of the Bold constant), then the PDF file (and the print preview) does show bold text.

HTH,

Rob


"Hakan Naslund" <HakanNaslund@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:7CF7392F-9AB5-46B9-80EA-FBFD7F78F3AF@xxxxxxxxxxxxxxxx
I have some reports that utilize the section onformat action to change a
textbox's fontweight depending on field value... This works great both on
report print and preview!

With 2007 SP1, we have the ability to create pdf's directly from access
which is great! But it seems that the onformat code is not executed in this
case...!

To reproduce, we can make a simple report:

create an emtpy report in design mode.
add 2 text boxes.
set the control source to ="TEXT" for both.
on one of the controls onformat event, add code to make the text bold:
Me.Text1.FontWeight=1000

Save the report as Report1.

if you open the report in print preview (or if you print it), you'll see
that one of the "TEXT" messages are in bold.

Now, open the vba editor and in the direct window type:
docmd.OutputTo acOutputReport
,"Report1",acFormatPDF,"c:\Report1.pdf",true,,,acExportQualityPrint
A pdf file is created and opened in your pdf viewer. Notice that this time,
none of the text boxes are in bold!

Is this by design or is it a bug? Any ideas how to get around it?

.



Relevant Pages

  • MailMerge in Access XP problem
    ... CAMP DAY UPDATE - Subject would be bold. ... I tried to do this in an Access Report, but couldn't get the Bold to ... work and still get the report format I needed. ... it appears that the single record solution will not work. ...
    (microsoft.public.access.formscoding)
  • 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: OnFormat action not executed when exporting to PDF
    ... Strange behaviour though... ... "Rob Parker" wrote: ... does show bold text. ... we can make a simple report: ...
    (microsoft.public.access.reports)
  • Re: Can we set two different text parametars in one textbox?
    ... Not sure I would call it an "easy solution" though. ... that on your report, Access is likely to think you are referring to the Name ... Roman, bold, italic, 15 points and "female" in Times New Roman, bold, 12 ...
    (microsoft.public.access.reports)
  • OnFormat action not executed when exporting to PDF
    ... But it seems that the onformat code is not executed in this ... we can make a simple report: ... that one of the "TEXT" messages are in bold. ... A pdf file is created and opened in your pdf viewer. ...
    (microsoft.public.access.reports)