TextWidth like method for Access Forms

C

Chris Zoumas

Hi, I'am currently working on a form with a msFlexGrid control on it and I
would like
to resize grid's collumns so as to fit the data (emulate the Column AutoFit
of Excel..).
In VB forms there is a textwidth method but in Access2000 there is no such
utility.
I have tried to use the "GetMaxWidth" method of the "Access97 Developers
Handbook" by
Litwin-Getz-Gilbert but when the execution comes to the line of the so
called exported
function "adh_accTwipsFromFont" I'am getting an Error saying that this
function doesn't
have an entry point in "msaccess.exe". I would like to ask if there is a
conflict between the
two versions of Access97 and Access2000 for the exported functions and if so
which is the
substitute for the above mentioned function. If there isn't any substitute
what can I do to
mesure the textwidth in Access forms..

TIA, Chris
 
A

Arvin Meyer

For an Access datasheet only, you can use the .ColumnWidth property to
resize a column to the width of the visible text:

Me.txtMyTextbox.ColumnWidth = -2

A 0 will hide the column, and a -1 sets the column to the default width (as
defined in Tools ... Options)

With an MSFlexGrid, you are limited to those functions which *may* be
supported in Access. Doug's solution to go to Stephen Leban's site is also a
viable one.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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