<br><font size=2 face="sans-serif">David,</font>
<br>
<br><font size=2 face="sans-serif">Your message made me think and I have gone from an MDB to an ADP. Much easier to deal with.</font>
<br>
<br><font size=2 face="sans-serif">Thanks for the help.</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>"David McAfee" <DMcAfee@haascnc.com></b></font>
<br><font size=1 face="sans-serif">Sent by: accessd-bounces@databaseadvisors.com</font>
<p><font size=1 face="sans-serif">03/25/2003 04:57 PM</font>
<br><font size=1 face="sans-serif">Please respond to accessd</font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To: "'accessd@databaseadvisors.com'" <accessd@databaseadvisors.com></font>
<br><font size=1 face="sans-serif"> cc: "'jeffrey.demulling@usbank.com'" <jeffrey.demulling@usbank.com></font>
<br><font size=1 face="sans-serif"> Subject: RE: [AccessD] Help populating a drop down box in A2K</font></table>
<br>
<br>
<br><font size=2 color=blue face="Arial">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:</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Arial"><br>
Me.YourComboBox.RowSource = "EXEC YourSprocNameHere '" & YourParameter & "'"</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Arial">if you have no parameter to send to the SPROC, then it is even easier:</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Arial">Me.YourComboBox.RowSource = "EXEC YourSprocNameHere"</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Arial">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>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Arial">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>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Arial">HTH</font>
<br><font size=3 face="Times New Roman"> </font>
<br><font size=2 color=blue face="Arial">David</font>
<br><font size=2 face="Tahoma">-----Original Message-----<b><br>
From:</b> accessd-bounces@databaseadvisors.com [mailto:accessd-bounces@databaseadvisors.com]<b>On Behalf Of </b>jeffrey.demulling@usbank.com<b><br>
Sent:</b> Tuesday, March 25, 2003 1:36 PM<b><br>
To:</b> accessd@databaseadvisors.com<b><br>
Subject:</b> [AccessD] Help populating a drop down box in A2K<br>
</font>
<br><font size=2 face="sans-serif"><br>
Hello all,</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="sans-serif"><br>
I have the following code:</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="sans-serif"><br>
Public Sub FillIssuer()</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
Dim con As New ADODB.Connection</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
Dim RS As New ADODB.Recordset</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
Dim cmdText As String</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
Dim strList As String</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="sans-serif"><br>
DoCmd.SetWarnings False</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
DoCmd.OpenQuery "qryDeleteIssuers"</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
DoCmd.SetWarnings True</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="sans-serif"><br>
strList = ""</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="sans-serif"><br>
con = setconnection</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
con.Open</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="sans-serif"><br>
cmdText = "SELECT tblIssuers.[Name], tblIssuers.[Number], tblIssuers.[Display] From tblIssuers ORDER BY tblIssuers.[Name]"</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
RS.Open cmdText, con</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="sans-serif"><br>
RS.MoveFirst</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
While Not RS.EOF</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
<br>
strList = "INSERT INTO tblDisplayIssuers ([Number], Name, Display) Values (" & RS("Number") & ", '" & RS("Name") & "', " & RS("Display") & ");"</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
<br>
<br>
DoCmd.RunSQL (strList)</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
<br>
RS.MoveNext</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
Wend</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
<br>
con.Close</font><font size=3 face="Times New Roman"> </font><font size=2 face="sans-serif"><br>
End Sub</font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="sans-serif"><br>
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><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="sans-serif"><br>
I am using the returned data in a drop-down box. </font><font size=3 face="Times New Roman"> <br>
</font><font size=2 face="sans-serif"><br>
Any help or suggestions would be greatly appreciated.</font><font size=2 face="Courier New">_______________________________________________<br>
AccessD mailing list<br>
AccessD@databaseadvisors.com<br>
http://databaseadvisors.com/mailman/listinfo/accessd<br>
Website: http://www.databaseadvisors.com<br>
</font>
<br>
<br>