Automatically adjust query column to fit data?

joe789

Registered User.
Local time
Today, 12:34
Joined
Mar 22, 2001
Messages
154
Hi Folks,

I have a set of queries that reside on a form ... everything works fine, but it seems like Access decides how large or small a column width is when the queries are automatically ran in the form. Is there a way to have these columns automatically grow to the point where all the data in the table can be read? If I adjust this manually by making a cross with my mouse in-between each and every field and double clicking, even if I save the query it won't save the column widths ... and I don't want to do a hard set of column width because some data may not need all that space whereas other columns might. For example:

Full Name -> Column Name
Johnny Applseed ->Data in column

My query would show:

Full Nam -> Column Name
Johny A -? Data in Column

And the user would then have to manually expand or contract that column to see all the data in the field.

Any easy ideas?

Thank you for the help,

Joe
 
Your users should not be using a query to manipulate data. They should be using forms to interact with your tables.

1. Create a form based on your query
2. Set the Default View of the form to Datasheet
3. In the After Update event of the Full Name textbox, put this code:
Code:
Me.[COLOR=Blue]txtFullName[/COLOR].ColumnWidth = -2
I have assumed that you will call the textbox name txtFullName.
 

Users who are viewing this thread

Back
Top Bottom