<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=988560622-25032003>Jeffrey, if a stored procedure (SPROC) is what
populating the combo box (and you are in an ADP) then all you have to do is
place the following in the combo box's OnEnter event:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=988560622-25032003></SPAN></FONT> </DIV><FONT><SPAN
class=988560622-25032003>
<DIV><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial color=#0000ff
size=2></FONT><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial
color=#0000ff size=2></FONT><FONT face=Arial color=#0000ff size=2></FONT><FONT
face=Arial color=#0000ff size=2></FONT><BR><FONT face=Arial color=#0000ff
size=2>Me.YourComboBox.RowSource = "EXEC YourSprocNameHere '" &
YourParameter & "'"</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV></SPAN></FONT><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff
size=2>if you have no parameter to send to the SPROC, then it is even
easier:</FONT></SPAN></DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff
size=2>Me.YourComboBox.RowSource = "EXEC YourSprocNameHere"</FONT></SPAN></DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff size=2>or if
it simply a view then just place the view's name in the combo's recordsource
filed as you would a query.</FONT></SPAN></DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff size=2>If you
are not using an ADP, and instead are using an MDB, you should be able to simply
put the name of the query as the rowsource for you combo Doesn't your
query/sproc return the result set that you want for your
combo?</FONT></SPAN></DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff
size=2>HTH</FONT></SPAN></DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=988560622-25032003><FONT face=Arial color=#0000ff
size=2>David</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
accessd-bounces@databaseadvisors.com
[mailto:accessd-bounces@databaseadvisors.com]<B>On Behalf Of
</B>jeffrey.demulling@usbank.com<BR><B>Sent:</B> Tuesday, March 25, 2003 1:36
PM<BR><B>To:</B> accessd@databaseadvisors.com<BR><B>Subject:</B> [AccessD]
Help populating a drop down box in A2K<BR><BR></FONT></DIV><BR><FONT
face=sans-serif size=2>Hello all,</FONT> <BR><BR><FONT face=sans-serif
size=2>I have the following code:</FONT> <BR><BR><FONT face=sans-serif
size=2>Public Sub FillIssuer()</FONT> <BR><FONT face=sans-serif size=2>Dim con
As New ADODB.Connection</FONT> <BR><FONT face=sans-serif size=2>Dim RS As New
ADODB.Recordset</FONT> <BR><FONT face=sans-serif size=2>Dim cmdText As
String</FONT> <BR><FONT face=sans-serif size=2>Dim strList As String</FONT>
<BR><BR><FONT face=sans-serif size=2>DoCmd.SetWarnings False</FONT> <BR><FONT
face=sans-serif size=2>DoCmd.OpenQuery "qryDeleteIssuers"</FONT> <BR><FONT
face=sans-serif size=2>DoCmd.SetWarnings True</FONT> <BR><BR><FONT
face=sans-serif size=2>strList = ""</FONT> <BR><BR><FONT face=sans-serif
size=2>con = setconnection</FONT> <BR><FONT face=sans-serif
size=2>con.Open</FONT> <BR><BR><FONT face=sans-serif size=2>cmdText = "SELECT
tblIssuers.[Name], tblIssuers.[Number], tblIssuers.[Display] From tblIssuers
ORDER BY tblIssuers.[Name]"</FONT> <BR><FONT face=sans-serif size=2>RS.Open
cmdText, con</FONT> <BR><BR><FONT face=sans-serif size=2>RS.MoveFirst</FONT>
<BR><FONT face=sans-serif size=2>While Not RS.EOF</FONT> <BR><FONT
face=sans-serif size=2> </FONT><BR><FONT face=sans-serif
size=2> strList = "INSERT INTO tblDisplayIssuers ([Number], Name,
Display) Values (" & RS("Number") & ", '" & RS("Name") & "', "
& RS("Display") & ");"</FONT> <BR><FONT face=sans-serif size=2>
</FONT><BR><FONT face=sans-serif size=2> </FONT><BR><FONT
face=sans-serif size=2> DoCmd.RunSQL (strList)</FONT> <BR><FONT
face=sans-serif size=2> </FONT><BR><FONT face=sans-serif
size=2> RS.MoveNext</FONT> <BR><FONT face=sans-serif
size=2>Wend</FONT> <BR><FONT face=sans-serif size=2>
</FONT><BR><FONT face=sans-serif size=2>con.Close</FONT> <BR><FONT
face=sans-serif size=2>End Sub</FONT> <BR><BR><FONT face=sans-serif
size=2>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.</FONT> <BR><BR><FONT face=sans-serif size=2>I am using the returned
data in a drop-down box. </FONT> <BR><BR><FONT face=sans-serif
size=2>Any help or suggestions would be greatly
appreciated.</FONT></BLOCKQUOTE></BODY></HTML>