Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1473

Vba sql

$
0
0
I was working on the below code and having an issue with it as I want to have the code cycle through all offices and pull all the names by department for example Admin it will show for example all 3 then go to IT and show all 4 names. Can anyone assist me on this thanks.

Code:

Dim strOffice As String
Dim Titles As String

 
  If Not rs2.EOF Then
    Do
 
      Titles = Titles & rs2!Office & " " & rs2![Name] & " " & vbCr
   
      rs2.MoveNext
    Loop Until rs2.EOF
    MsgBox Titles
    End If


Viewing all articles
Browse latest Browse all 1473

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>