Results 1 to 13 of 13
  1. #1
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    fontname changing (2007)

    i'm looking for a method so that the user can change the font f.e. reports just by saying it in a record.
    F.e. i have a table where the value of txtfont = Tahoma
    I wan't that in the report the company name then tahoma is.
    Same for my startupform.
    Is there a code for?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: fontname changing (2007)

    You can use the On Format event of the detail section of the report:
    <code>
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.txtCompany.FontName = Nz(Me.txtFont, "Calibri")
    End Sub
    </code>
    This will set the font of the txtCompany control to the name contained in txtFont, and if that is blank to Calibri.

    Note: you'll have to put txtFont as a text box in the detail section; you can hide it if you wish by setting its Visible property to No.

    You can do the same for a single form using the On Current event of the form. It won't work in a continuous or datasheet form.

  3. #3
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fontname changing (2007)

    thanks that did the trick.

  4. #4
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fontname changing (2007)

    Aparently it does not work in a multiple report? I mean a report with more than one record :-(
    A single report is no problem, is there a sollution for that kind report?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: fontname changing (2007)

    It should work for a report with multiple records. See the attached demo (in Access 2000 format)
    Attached Files Attached Files

  6. #6
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fontname changing (2007)

    Ok, but it is not for my detail section but for my reportheader.
    When I put that code where you putted it in a single report it works, but not when there are more then one.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: fontname changing (2007)

    I'm sorry, I don't understand. A report has only one report header.
    Could you explain in more detail what exactly you want to accomplish?

  8. #8
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fontname changing (2007)

    In the header the name of the company is displayed, I wan't that if the company owner want to change his font, just in a table has to change it.
    so he/she does not have to change every report.
    Is it possible?

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: fontname changing (2007)

    OK, I completely misunderstood your intent, sorry about that.

    Is the company name displayed in a label in the report header or in a text box?

  10. #10
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fontname changing (2007)

    Sorry that I did not mentioned that, it is a textbox that has to be shown on every page

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: fontname changing (2007)

    The report header is only displayed on the first page of the report, not on every page. You need the page header to display something at the top of every page.

    You can use code similar to the code I posted before in the On Format event of the page header section.

  12. #12
    Star Lounger
    Join Date
    Mar 2002
    Location
    Haaltert, Belgium
    Posts
    84
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: fontname changing (2007)

    strange, I did before the same and did not work
    and now it does work, strange

    again many thanks

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: fontname changing (2007)

    That's the magical influence of Woody's Lounge! <img src=/S/wink.gif border=0 alt=wink width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •