Solved

column width and form in datasheet mode

Posted on 2014-12-05
6
277 Views
Last Modified: 2014-12-05
experts, I am trying to increase the width of a column.  It is a form in datasheet.  I right click the column and change the width but it never saves that width.  I continually have to change it back to what I want when I open the form.

how do save?

thanks
0
Comment
Question by:pdvsa
6 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40483032
Try saving the form on the close event of the form:

Private Sub Form_Close()
    DoCmd.RunCommand acCmdSave
End Sub
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40483050
BTW,

Another option might be to increase the column *height*. (to see more of the text, wrapped)

The column Height values seems to stick after the form is closed...

JeffCoachman
0
 
LVL 36

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40483076
This behavior exists in newer versions of Access.  Older versions retained your settings at design time and even saved settings from run time so if user resized columns or reordered them, form would remember the setting.  Not any more.

I can't guarantee success but some combination of the following may get the resizing to stick.  It randomly works for me but I haven't been able to identify the trigger.  If it doesn't work, your only option is to add code to resize the columns when the form opens (and don't forget to write a nasty graham to MS for breaking this behavior).

1. In design view,
   a. resize field
   b. move it
   c. open the tab dialog and auto sequence
   d. save form
2. In layout view
   a. resize field
   b. move it
   c. save form
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40483149
I have found that if you open the datasheet form (by itself, not as a subform), change the width to what you want, then save the form before closing it, it will generally retain the width you assigned it.  However, for reliable use, and to allow users to size the fields the way they want, I would recommend you implement the technique mentioned in my article on Customizing datasheets to user needs.

This actually resorts to storing each users column width and positioning preferences in a table within your application.
0
 

Author Closing Comment

by:pdvsa
ID: 40483157
that worked.   thank you
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40483287
so my code did not work for you?
...just curious
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question