Autosize of text box

N

Nandini

I have created a bibliographic database using Access 2003. Here I designed
some forms having text box control. I want to know the exact visual basic
code so that these text boxes can be resized automatically in respect of size
of the text as appeared in different records.
With regards.
 
D

Dorian

In Form Current event:
MyTextBox.Width = <size in twips>

There are 1440 twips to the inch. You will have to calculate needed witth
based on font and number of characters. Not always an exact science as
different characters take up different space unless you use a fixed-with font
like Courier.

-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top