Results 1 to 6 of 6
  1. #1
    Miles R is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    176

    Setting Font size in text box, set to rich text


    Hello,

    I am trying to set the font size (using VBA) for specific text in a text box on an access form where the text is set to rich text.
    I have the code
    <font color=red><font size=12>
    The colour is set to red correctly, but the text is enormous, certainly not 12pt. I have spent a long time scouring the internet and seem to get lots of different ways to set point size, none of which work for me.
    Anyone know the correct way to do this?

    Thanks

    p.s. don't need to change the font type or style, just the colour and size.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    HTML font sizes are not in points, IIRC. They are computed (I think 1 represents the standard font). Try values of 2 or 3.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Miles R is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    176
    Quote Originally Posted by Micron View Post
    HTML font sizes are not in points, IIRC. They are computed (I think 1 represents the standard font). Try values of 2 or 3.
    Thanks for your reply. How bizarre. Yes 2 and 3 are better. Unfortunately this seems to be changing the Font as well - probably to a default. Looks like I will have to set the font type as well.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Why is that bizarre? It has been that way ever since Moses was knee high to a grasshopper. AFAIK, it was made so as to be relative to the resolution used to view the web page. If yours was very different from mine, you may not appreciate having a point size font used on your display. If 2, then it would be relatively the same for both of us regardless of the resolutions involved. You just have to know what the scale is for the values you're working in, right?

    Some Access scales are in Twips or milliseconds. Would you think the same way if you wanted a 2 second timer event and had to code it as 2000 rather than 2?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Miles R is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    176
    Quote Originally Posted by Micron View Post
    Why is that bizarre? It has been that way ever since Moses was knee high to a grasshopper. AFAIK, it was made so as to be relative to the resolution used to view the web page. If yours was very different from mine, you may not appreciate having a point size font used on your display. If 2, then it would be relatively the same for both of us regardless of the resolutions involved. You just have to know what the scale is for the values you're working in, right?

    Some Access scales are in Twips or milliseconds. Would you think the same way if you wanted a 2 second timer event and had to code it as 2000 rather than 2?
    Yes, I see. Not really a user of HTML and web design. It is clear it is not based on the same system as point sizes used in the printing world.
    What I was simply trying to do was put some colour and different point sizes etc in a text box on my access form. The only way of doing this AFAIK is using HTML and rich text, but as you say, it is based on a different system. I think I will stick to just changing the colour and leave the point size as defined in the text box itself. It's near enough to what I want.

    Thanks for you input

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    If your goal is to do this formatting on the entire textbox comments, perhaps conditional formatting would be simpler and fit the bill. If doing this on only part of the contents, then your current approach will do that.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 01-12-2019, 06:02 PM
  2. Rich text field not displaying rich text properly
    By CodeLiftSleep in forum Access
    Replies: 4
    Last Post: 01-24-2018, 10:59 AM
  3. Replies: 3
    Last Post: 06-04-2017, 01:02 PM
  4. Replies: 3
    Last Post: 07-28-2014, 03:02 PM
  5. Rich text - text color and size
    By Subs in forum Reports
    Replies: 3
    Last Post: 11-08-2013, 10:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums