formatting a field depending on another field

ssh

Registered User.
Local time
Today, 14:30
Joined
May 22, 2002
Messages
49
How can I set font size of a field based on a value of another field? Example, font size of field1 should be 126 points cause field2 value is 126. Thanks.
 
Essentially you can use VBA code to dynamically change the values. It depends on when you want to format the textbox; when the value is changed or as the default for the form
If for example it is when the value in txt1 is changed

Sub txt1 after_update
me.txt2.fontsize = me.txt1
me.repaint
End Sub.

However, if you change the font size, the size of the textbox will not so your text may not fit into the box.
 
It worked but I put the code to Detail_Format and dropped me.repaint (it gave errors). And I have large enough field to accept any sizes. Thanks!
 
Sorry, my fault for not looking at which forum it was posted in. The me.repaint repaints a form and has no function in a report, hence the error.
Glad the important bit worked though!
 

Users who are viewing this thread

Back
Top Bottom