how can i Integration all texts from a column in a form to a textBox ?

m00j

New member
Local time
Today, 05:48
Joined
Oct 6, 2009
Messages
6
this code can add all text from table to textbox in form

Code:
Set db = CurrentDb
Set rs = db.OpenRecordset("names")
For i = 1 To rs.RecordCount

text1.SetFocus
text1.Text = text1.Text & " " & rs(1)

rs.MoveNext

Next i

is it any way to add all text from Fields in form in to textbox in same form?
 
Try something like this on the onCurrent Event on your form:

Code:
Dim ctl As Control, frm As Form, strText as string
    Set frm = Me

   strText = ""
    
    For Each ctl In frm.Controls
        If ctl.ControlType = acTextBox Then
            strText = strText & ctl.Value & " "

        End If
    Next ctl

Me.text1 = strText
 

Users who are viewing this thread

Back
Top Bottom