Column width in a subform?

Discussion in 'Microsoft Access Form Coding' started by Rolf Rosenquist, Nov 27, 2004.

  1. Cannot figure out how to fix the column width of a datasheet in a subform,
    so that users cannot change them. Is it not possible to lock it?

    / Rolf
     
    Rolf Rosenquist, Nov 27, 2004
    #1
    1. Advertisements

  2. Rolf Rosenquist wrote:

    >Cannot figure out how to fix the column width of a datasheet in a subform,
    >so that users cannot change them. Is it not possible to lock it?



    Use the ColumnWidth property (check Help for details).

    --
    Marsh
    MVP [MS Access]
     
    Marshall Barton, Nov 27, 2004
    #2
    1. Advertisements

  3. Rolf Rosenquist

    Dale Fye Guest

    As Marshall states, you can set their width, but I have never been able to
    figure out a way to actually prevent the user from changing the width at run
    time. The only alternative I have come up with is to use a continuous form,
    put the rows right on top of each other. By doing this, you set the text
    box widths at design time and don't have to worry about it after that.

    Actually, the only time I use datasheets is when I want to present my user
    with a lot of data at one time, and let them figure out what is of use to
    them. Using the data sheet also allows them to change the order of the
    columns during run time, although they will always come back up in the
    format that they were designed in.

    HTH
    Dale

    "Rolf Rosenquist" <> wrote in message
    news:%...
    > Cannot figure out how to fix the column width of a datasheet in a subform,
    > so that users cannot change them. Is it not possible to lock it?
    >
    > / Rolf
    >
    >
     
    Dale Fye, Nov 27, 2004
    #3
  4. Here is a previous post of mine on this subject.

    From: Stephen Lebans
    ()
    Subject: Re: Freeze Column?
    View: Complete Thread (3 articles)
    Original Format
    Newsgroups: microsoft.public.access.forms,
    microsoft.public.access.formscoding,
    Date: 2003-12-24 11:53:00 PST

    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/library/default.asp?url=/library/en-us/dnsmart
    01/html/sa01b1.asp

    2) An API solution is here:
    http://www.lebans.com/autocolumnwidth.htm
    The AutoSizing project also contains a method to FREEZE the
    ColumnWidths.


    After reading Michael's article you would then do something similiar
    along these lines:

    From: Bill Murphy ()
    Subject: Re: Freezing columns in a continuous subform


    View this article only
    Newsgroups: microsoft.public.access.forms
    Date: 2004-03-31 13:03:23 PST



    Thanks Stephen. In Michael Kaplan's article I found a tip which led me
    to
    the answer. Here's some sample code that I am using in the load event
    of a
    data sheet subform which works well:

    ' Freeze each column needed

    Me![Project].SetFocus
    DoCmd.RunCommand (acCmdFreezeColumn)

    Me![Lender#].SetFocus
    DoCmd.RunCommand (acCmdFreezeColumn)

    Me![Loan#].SetFocus
    DoCmd.RunCommand (acCmdFreezeColumn)

    All three columns will be frozen at the left of the data sheet, and the
    user
    can scroll horizontally for all other columns in the data sheet.

    Bill



    --

    HTH
    Stephen Lebans
    http://www.lebans.com
    Access Code, Tips and Tricks
    Please respond only to the newsgroups so everyone can benefit.


    "Dale Fye" <> wrote in message
    news:...
    > As Marshall states, you can set their width, but I have never been

    able to
    > figure out a way to actually prevent the user from changing the width

    at run
    > time. The only alternative I have come up with is to use a continuous

    form,
    > put the rows right on top of each other. By doing this, you set the

    text
    > box widths at design time and don't have to worry about it after that.
    >
    > Actually, the only time I use datasheets is when I want to present my

    user
    > with a lot of data at one time, and let them figure out what is of use

    to
    > them. Using the data sheet also allows them to change the order of

    the
    > columns during run time, although they will always come back up in the
    > format that they were designed in.
    >
    > HTH
    > Dale
    >
    > "Rolf Rosenquist" <> wrote in message
    > news:%...
    > > Cannot figure out how to fix the column width of a datasheet in a

    subform,
    > > so that users cannot change them. Is it not possible to lock it?
    > >
    > > / Rolf
    > >
    > >

    >
    >
     
    Stephen Lebans, Nov 27, 2004
    #4
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    Column width

    Guest, Mar 7, 2004, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    175
    Jeff Boyce
    Mar 7, 2004
  2. Guest

    SuBform - Column width control

    Guest, May 26, 2005, in forum: Microsoft Access Form Coding
    Replies:
    0
    Views:
    233
    Guest
    May 26, 2005
  3. Ron Weiner

    Maximum width if a subform in Access 2K

    Ron Weiner, Jun 26, 2006, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    401
  4. Sarah

    Link Subform to subform within another subform

    Sarah, Feb 29, 2008, in forum: Microsoft Access Form Coding
    Replies:
    2
    Views:
    327
    Sarah
    Mar 1, 2008
  5. Changing column bound, width, and column count

    , Oct 9, 2008, in forum: Microsoft Access Form Coding
    Replies:
    1
    Views:
    516
    Douglas J. Steele
    Oct 10, 2008
Loading...

Share This Page