Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2014

    Unanswered: Summarizing All Form Fields Into One

    Hello all,

    I have created a form that populates a table, but I would like to have a text box that would have a summary of all of the fields on my form at the bottom where the user can easily copy and paste the summarized data into the primary management system as a note.

    I am using MS Access 2010.

    Database: Agent_Visit

    Table: Agency

    Form: Agent_Visit
    Form Fields:

    Now at the bottom of the form before the user saves the record I would like to have a text field that would have all of the form field data entered above summarized and separated by commas so the user can copy and paste the data to another location.

    In my attempts I have been able to get the first field to populate in the text box at the bottom by using the code below:
    Private Sub Note_Click()
    Me.Note = Me.Rep
    End Sub

    But I can seem to figure out how to include other fields in the Me.Note text box.

    Any help would be much appreciated

    Thank you in advance

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    Private Sub Note_Click()
        Dim ctl As Control
        Dim str As String
        For Each ctl In Me.Controls
            If ctl.ControlType = acTextbox Then
                If Len(str) > 0 Then str = str & ","
                str = str & Nz(ctl.Value, "")
            End If
        Next ctl
        Me.Note.Value = str
    End Sub
    Have a nice day!

Posting Permissions

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