• Column width adjustment in datasheet view (A97 SR2)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Column width adjustment in datasheet view (A97 SR2)

    Author
    Topic
    #372319

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #594844

      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.

      • #594854

        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.

        • #594858

          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.

    Viewing 0 reply threads
    Reply To: Column width adjustment in datasheet view (A97 SR2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: