Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Apr 2002
    Location
    Onekama, Michigan, USA
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Column width adjustment in datasheet view (A97 SR2)

    I have a main form with a subform. The subform default view is datasheet and has 7 fields. I have meticulously adjusted the width of each column to properly accommodate the data. Is there something that can be done to prevent the user from adjusting/modifying the width of these columns.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Column width adjustment in datasheet view (A97 SR2)

    No, I don't think so. But you can simulate the look of a datasheet with a continuous form:

    Format the text boxes to have no special effect and to have a gray border.
    Align them along the top of the detail section without any space in between.
    Make the detail section the same height as the text boxes.

    Put the field labels in the subform header.

    Forgot to mention why I suggest this - must be Friday!

    In a continuous form, users can't change "column" widths.

  3. #3
    Star Lounger
    Join Date
    Apr 2002
    Location
    Onekama, Michigan, USA
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Column width adjustment in datasheet view (A97 SR2)

    One of the functions for the subform is to allow the user to select a column by clicking on the header and then press a SortAscending button which sorts all of the records based on that field. Can this be accomplished on a continuous form? Can all of the cursor movement functions (page up, page down, arrow keys, etc.) be made to function like they do on a datasheet? It is so much easier and faster to navigate through records and fields on a datasheet. That is why I have avoided a continuous form.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Column width adjustment in datasheet view (A97 SR2)

    Sorting is easy: whether in a datasheet, continuous or single form, you can click in any field and then click one of the sorting buttons on the toolbar. Or right-click and select one of the sorting options from the context menu.

    PageUp and PageDown, ArrowLeft and ArrowRight act the same in a continuous form as in a datasheet.

    Only the ArrowUp and ArrowDown don't take you to the previous/next record by default. You could accomplish that by setting the KeyPreview property of the form to Yes and putting a bit of code in the Form_KeyDown event handler:

    Select Case KeyCode
    Case vbKeyDown
    DoCmd.GoToRecord , , acNext
    Case vbKeyUp
    DoCmd.GoToRecord , , acPrevious
    End Select

    plus a bit of error handling to prevent error messages when the user is on the first of last record.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •