Results 1 to 2 of 2

Thread: Take the values from a table into a string? How?

  1. #1
    Pirre001
    Guest

    Question Take the values from a table into a string? How?

    I have a table in access with a lot of rows. Now I want theese rows (every row in the table is a name) into a string. Every row should be separate with an ;. How do i do that?

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim db As Database
    3.     Dim rs As Recordset
    4.     Dim s As String
    5.     Set db = OpenDatabase("C:\TEST.MDB")
    6.     Set rs = db.OpenRecordset("Table1")
    7.     While Not rs.EOF
    8.         s = s & rs("Field1") & ";"
    9.         rs.MoveNext
    10.     Wend
    11.     Debug.Print s
    12. End Sub
    -= a peet post =-

Posting Permissions

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



Click Here to Expand Forum to Full Width