I want to program a textbox control's width to the size of it's calculated. So if the calculated output is 3.67 then I want the text box width to be 3.67". I'm very basic in my programming with Access and don't see how to do this. HELP!
I want to program a textbox control's width to the size of it's calculated. So if the calculated output is 3.67 then I want the text box width to be 3.67". I'm very basic in my programming with Access and don't see how to do this. HELP!
You can set the Width property of the textbox:
Me.TextboxName.Width = xxx
Note the measurement is probably in twips not inches.
Thank you Paul. Bear with me. So where do I set this property for? I tried under Format Width and won't let me. I also tired in the OnClick under Events and I get an error. I'm such a novice but I feel like I'm trying to do something really simple and can't get it to work.
Thanks again. I tired this as well before. I don't get the error any more but the text box doesn't change size - stays the same size as is in the Width property in the Format section. Not sure if it's because I'm using old Access 2007 or what.
Just tested and it worked as expected. Are you sure you didn't set the textbox to the size it already was? Are you sure code is running? Try adding a message box:
MsgBox "setting width"
Me.TextboxName.Width = 1000
It looks as though the code is not running as I don't get that Msg Box. Thought I was going crazy! Not sure why code wouldn't be running?
How are you calculating the width? Are textboxes set for a non-proportional font?
Is this code behind a continuous view form? Setting properties of controls in continuous view will affect all records.
Did you select [Event Procedure] in the Click event property?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.