Skip to content

Instantly share code, notes, and snippets.

@bnjcbsn
Created January 20, 2016 14:17
Show Gist options
  • Save bnjcbsn/028bc7f4ac5dd1ab5b97 to your computer and use it in GitHub Desktop.
Save bnjcbsn/028bc7f4ac5dd1ab5b97 to your computer and use it in GitHub Desktop.
' Access VBA
' loops through a single column recordset and builds a csv text string
' that can be inserted into a query
' modified from unknown internet sources
' my NY resolution is to capture sources when culling ideas from internet
If rs.RecordCount <> 0 Then
rs.MoveLast
rs.MoveFirst
Do Until rs.EOF
ap = rs.AbsolutePosition
rc = rs.RecordCount - 1
If ap < rc Then
cslist = cslist + CStr(rs!Value) & ","
Else
cslist = cslist + CStr(rs!Value)
End If
rs.MoveNext
Loop
End If
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment