Can't change font size in VBA Code Editor in MS Access 2016 (1 Viewer)

wisekat

Registered User.
Local time
Tomorrow, 00:53
Joined
Feb 16, 2017
Messages
18
I am using Access 2016 on a laptop with an UHD screen (it's an ASUS N552VW model). I can change the font, but not its size. When I open Tools\Options, then the Editor Format tab I can change the value in the Font combobox, but any change in the Size combo is not saved and applied.

Does any body know, is it a known issue with MS Access on high-resolution screens? Is there any other way to increase the font size (through the registry and the like)?
 

Minty

AWF VIP
Local time
Today, 22:53
Joined
Jul 26, 2013
Messages
10,371
That sounds a bit weird - it appears to work correctly on Access 2010 and 2013 versions. Maybe try a office repair?

Does it work in other VBA apps? Excel ?
 

sneuberg

AWF VIP
Local time
Today, 14:53
Joined
Oct 17, 2014
Messages
3,506
I tried this in Access 2013 and found that if I change the font in Access it changes in the font in OutLook VBA so apparently they use the same settings and perhaps the same VBA editor program.

What about other applications? Can you change the font size in Notepad?
 

wisekat

Registered User.
Local time
Tomorrow, 00:53
Joined
Feb 16, 2017
Messages
18
You just confirmed that VBA is the same for all Office apps.

I can change font in Notepad. It seems, this is a problem that appears only in the Office VBA.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 22:53
Joined
Sep 12, 2006
Messages
15,658
the font size would be changed at a "control" level of a form, surely


where exactly are you changing it?

I can't see a "tools/options"
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:53
Joined
Feb 28, 2001
Messages
27,188
Dave (Gemma...) - DatabaseTools >> Visual Basic >> Tools >> Options >> Editor Format

Wisekat - Notepad doesn't support VBA. The font you changed there is embedded in the document and is part of the information saved in the .TXT file preamble.

Interesting that the VBA editor doesn't appear to save that font-size information, but even more interesting that it shares that font-name setting with other clients of VBA. Let me ask a question of clarification:

When you try to change the font size, does it actually change it? (And then reverts to the original size after some other action).

If so, at what point do you detect the reversion to the previous size? When you close and then re-open the VBA editor window or when you close and re-open the App? Did you use the menu-bar's save icon or option at the time you made the size change?

As an experiment, can you open the code window, make the options change for font size only, use the save icon/option, close it all out, and then open things back to the code window? I.e. make NO changes to content, ONLY to the font-size setting, then try to save that - and see if it retained the change?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:53
Joined
Feb 28, 2001
Messages
27,188
Follow-up: On Win7/64 & Ac2013, when I perform that experiment the font size changes and is retained (a) when I close and then re-open the VBA window and (b) when I close and then re-open the entire app.

More significant is that the change affected another database. This means that what we are discussing is a registry setting, NOT an application setting. So I got curious.

First thing of note: VBA has SEPARATE SETTINGS from the default settings for other OFFICE members. If you are comfortable with at least viewing your registry, what you want to see is:

computer\HKEY_CURRENT_USER\software\Microsoft\VBA\7.0\Common

Then you can see that "FontFace" holds the name and "FontHeight" holds the size (in points) of the font.

Exploring other items under the general VBA heading found only placeholders, nothing of importance. However, this explains a lot of things. (Doesn't fully explain the original complaint.)

If this is a REGISTRY setting rather than a DOCUMENT setting, then the question is: Why does it allow you to save an item (FontFace) but not save the immediately adjacent item (FontHeight)?

{After thinking a bit more, a significant fact is that when you open a VBA editor window, it becomes possible to have another image running in that window that isn't a child of the Access parent app window. Using Resource Monitor, the best I can determine is that some process is running under a service host or task host shell. It won't name the action image that is running, not that I needed to know, but if I close the VBA window, that unidentified item goes away. So that shows it ISN'T an Access window.}

So I figured this ought to be something someone else has seen - and it IS.

https://answers.microsoft.com/en-us...cel-2016/2f51c62d-bf74-4029-92ee-5aaebc292e39

I cannot easily reproduce the solution that appears in that thread, but the experiment is clear that somehow the VBA editor is interacting with screen resolution. I will leave it to you as to whether you want to diddle your screen resolution DOWN, increase font size, and then diddle resolution back UP to see if that changes the problem.

If that is it, I can only guess you were attempting a font size that somehow "tripped" the editor's settings as "too big" and therefore disallowed the change. Those of us who COULD make the change must not have picked an "impossible" font size. OR the problem only occurs in Ac2016 and a VBA version after 7.0
 
Last edited:

sneuberg

AWF VIP
Local time
Today, 14:53
Joined
Oct 17, 2014
Messages
3,506
computer\HKEY_CURRENT_USER\software\Microsoft\VBA\7.0\Common

Then you can see that "FontFace" holds the name and "FontHeight" holds the size (in points) of the font.

It may be yet diffferent in Access 2016 but in Access 2013 I found these in

computer\HKEY_CURRENT_USER\software\Microsoft\VBA\7.1\Common
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:53
Joined
Feb 28, 2001
Messages
27,188
My bad. I typed that I was running Ac2013 but I had forgotten for a moment that on the machine in question, I was one version back, on Ac2010.
 

wisekat

Registered User.
Local time
Tomorrow, 00:53
Joined
Feb 16, 2017
Messages
18
I do know that Notepad does not use VBA at all ;) Another forum user asked me to check whether I can change the font in other apps in my Windows. I think, a general font problem in the OS implied.

Well, I can't change the font of the VBA code editor at all. When I open the Tools\Options dialog, I can set the new font size, but when I click Ok, nothing happens in the code window - the font remains the same.

And I do not set an enormous font size - just want to increase it from 8pt to 10pt.

Most likely, the problem is related to my UHD screen of 282ppi. Let me experiment more.
 

wisekat

Registered User.
Local time
Tomorrow, 00:53
Joined
Feb 16, 2017
Messages
18
I have not managed to solve my problem yet. Some interesting observations.

1) I see a strange behavior with the registry key HKEY_CURRENT_USER\SOFTWARE\Microsoft\VBA\7.1\Common. If I change the FontHeight value manually using the regedit tool and launch VBA IDE, I see the font of the same size (8pt). However, if I change the font size in Tools\Options, FontHeight is always reset to 8 regardless of the font size I select.

2) If I click the gray bar left to the code editor pane to set a breakpoint, it is set, but it is marked with a red ellipse but not a circle. I think The_Doc_Man was right that the visual representation of the VBA window comes from another process, and it squeezes the output!

3) I've read the answers.microsoft.com link "font size in vba editor in excel 2016" mentioned above. As I see, those who have this unchangeable font size problem use a high-resolution screen.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:53
Joined
Feb 28, 2001
Messages
27,188
Definitely points to an interaction with the screen resolution! I was never able to find the name of the image that was running in that child process. It is probably shared among all members of Office that can use VBA.
 

wisekat

Registered User.
Local time
Tomorrow, 00:53
Joined
Feb 16, 2017
Messages
18
It seems, the Office developers have finally fixed this problem. At least, I can set any desired font size in the VBA code editor on my UltraHD ASUS monitor in my copy of MS Access 2016 Version 1708 (Build 8431.2107 Click-to-Run).
 

missinglinq

AWF VIP
Local time
Today, 17:53
Joined
Jun 20, 2003
Messages
6,423
Interestingly, I think, in v2007, the default Font Size is 19, a size that doesn't even appear in the dropdown box for choosing the size, and it a size change will 'stick,' if you're reducing the size...it simply won't change/stick if you're attempting to increase the size, and this appears to be true regardless of the font being used.

Linq ;0)>
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:53
Joined
Sep 21, 2011
Messages
14,310
I'm on 2007 adn mine is set at 10. I can change up to 24 with the dropdown and enter 19 in it's place. The size changes sticks. Yet if I open Excel it is still set to 10.?

Never thought about changing the size of the font. Certainly my old eyes would thank me for it. :)
Interestingly, I think, in v2007, the default Font Size is 19, a size that doesn't even appear in the dropdown box for choosing the size, and it a size change will 'stick,' if you're reducing the size...it simply won't change/stick if you're attempting to increase the size, and this appears to be true regardless of the font being used.

Linq ;0)>
 

wisekat

Registered User.
Local time
Tomorrow, 00:53
Joined
Feb 16, 2017
Messages
18
More interesting info. I can change the font size in the VBA code editor when I use it on an UltraHD screen with the scale factor of 200%, but the same VBA environment does not allow me to do this on a screen with 300% zoom. Tested it on my UltraHD ASUS MG24UQ monitor and ASUS N552VW laptop.
 

Users who are viewing this thread

Top Bottom