JohnBournemouth


Hi,

I've written some code to select 2 fonts in an access form. I also have a link button which, when pressed, will link the secondary font to the first, but will allow the user to select the font size independantly of the first.

I.e. the primary font could be Windings size 12, the secondary could be Times New Roman size 16. When the link button is pressed, the sencondary font would become Windings (along with any additional formatting), but the user would be able to set the font size independently through a textbox/forms v2.0 spinbutton combination.

The font size spinbutton/textbox combo is enabled or disabled, depending on whether the link button is pressed (a toggle button). I also have a hidden label that stores the secondary font setting so that when the button is depressed (i.e. not in link mode), the font settings prior to linkage are restored.

Here's where the problem is: everything is restored correctly, apart from the font size. The fontsize is restored correctly, but when the spinbutton control is disabled, the font size reverts back to its size as of when the fonts were linked... stranger still, if I put a break point at the line of code that restores the font size, it works. If I step through with the debugger, it works. If I just run the code, it doesn't. Very annoying!

My only thoughts on the matter are the following: maybe the setting of fonts isn't immediate (like the opening of recordsets, for example), which would explain the fact it works when I put a break point in

Please help, as I need to move on from this frustrating glitch in order to get my work done!

Thanks in advance

EDIT: I'm using Office XP by the way