473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Datasheet forms and column widths

Can I have a datasheet form automatically "fit" the column widths when
the form opens?

Nov 13 '05 #1
3 8025
You can set the ColumnWidth property of the individual columns to -2 to
adjust each column width to fit the size of the visible text.

For example:

Forms![Customers]![Address].ColumnWidth = -2
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
<dh*****@daubert.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
Can I have a datasheet form automatically "fit" the column widths when
the form opens?
Nov 13 '05 #2
I do not know of anyway to set the columns widths at the datasheet level.
However, if you name your textboxes systematically (for example, "txt...")
you can loop through the controls collection and set their column width
according.

Dim ctl as Control

Dim ctl As Control

For Each ctl In Me.subfrm.Controls
If Left(ctl.Name, 3) = "txt" Then
ctl.ColumnWidth = -2
End If
Next ctl
--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
<dh*****@daubert.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
Can I have a datasheet form automatically "fit" the column widths when
the form opens?
Nov 13 '05 #3
For programmatic control for forms in Datasheet view my standard
response is:
1) Michael Kaplan has an excellent article on manipulating Datasheets
here:
http://msdn.microsoft.com/libr*ary/d...y/e*n-us/dnsma
rt01/html/sa01b1.asp
2) An API solution is here:
http://www.lebans.com/autocolu*mnwidth.htm
The AutoSizing project also contains a method to FREEZE the
ColumnWidths.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
<dh*****@daubert.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
Can I have a datasheet form automatically "fit" the column widths when
the form opens?


Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: A Clark | last post by:
I have a subform that displays a datasheet. There are a couple of different queries that can be displayed in the datasheet. The queries are available in a combo box on the main form. The problem...
1
by: Fred Ferreira | last post by:
Hi there Does anybody know how I can lock the column widths at Datasheet form view?
1
by: George Kandaz | last post by:
Steve, I posted a question to your last post almost a week ago, but never heard from you again. Please read my last message, as follows. Thanks. ...
1
by: DFS | last post by:
I'm wanting to give my users some options in a datasheet view * drag the columns around * set the widths * show or hide columns, etc. If they do this, the changes don't 'stick' because they're...
5
by: deekay | last post by:
I want to allow users to resize and reposition columns of a datasheet but for a prompt to be brought up and only the layout only to be saved if they select "save changes". This is the way it works...
2
by: Midsomer | last post by:
Hi. I have an Access database with a form containing 4 datasheets and I allow the user to change column widths. On closing the form, a routine is fired that saves each column width to an INI file....
14
by: fh217 | last post by:
Hi I have a datasheet with 32 columns, the first 2 columns are frozen and disabled. What I would like to do is as a user tabs thru a row on the sheet is to shift the sheet to the left so it...
1
by: tom taol | last post by:
Currently, there are 3 datasheets in a form. and, i changed column widths of each form(datasheet type) by the way, there is not keep the column width in ms access. for example, i close the form,...
5
by: Deano | last post by:
I have five subforms each living in a page on a tab control. Each form is in datasheet view. The time has come to resize both the forms and the subforms. I am able to change the column widths...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.