[AccessD] Help populating a drop down box in A2K

jeffrey.demulling at usbank.com jeffrey.demulling at usbank.com
Tue Mar 25 15:35:48 CST 2003


Hello all,

I have the following code:

Public Sub FillIssuer()
Dim con As New ADODB.Connection
Dim RS As New ADODB.Recordset
Dim cmdText As String
Dim strList As String

DoCmd.SetWarnings False
DoCmd.OpenQuery "qryDeleteIssuers"
DoCmd.SetWarnings True

strList = ""

con = setconnection
con.Open

cmdText = "SELECT tblIssuers.[Name], tblIssuers.[Number], 
tblIssuers.[Display] From tblIssuers ORDER BY tblIssuers.[Name]"
RS.Open cmdText, con

RS.MoveFirst
While Not RS.EOF
 
    strList = "INSERT INTO tblDisplayIssuers ([Number], Name, Display) 
Values (" & RS("Number") & ", '" & RS("Name") & "', " & RS("Display") & 
");"
 
 
    DoCmd.RunSQL (strList)
 
    RS.MoveNext
Wend
 
con.Close
End Sub

What I want to do is instead of walking through the recordset one record 
at a time, I would like to do one single Insert command.  The data is 
being pulled from a SQL server and should be put into a local db table.

I am using the returned data in a drop-down box. 

Any help or suggestions would be greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030325/e71ae00f/attachment.html>


More information about the AccessD mailing list