Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure Combo Box

Status
Not open for further replies.

bigleroy

Programmer
Mar 1, 2002
7
US
Hi,

I'm executing a Stored Procedure with one parameter that will fill a combo box. When I run the program and click on the combo box, first record returned is displayed and the drop down portion of the box appears blank.

Private Sub dbcAccountID_Click(Area As Integer)
Set cmdAccountID = New ADODB.Command
cmdAccountID.ActiveConnection = cnnSOPHIA
cmdAccountID.CommandType = adCmdStoredProc

Set recAccountID = New ADODB.Recordset
varCustName = dbcCustName.Object
cmdAccountID.CommandText = "spP_Select_CustAccountID"


' Call the Stored Procedure


recAccountID.CursorType = adOpenStatic
recAccountID.LockType = adLockOptimistic
Set recAccountID = cmdAccountID.Execute(, varCustName)


Set dbcAccountID.DataSource = recAccountID
Set dbcAccountID.RowSource = recAccountID
dbcAccountID.DataField = "AccountId"
dbcAccountID.ListField = "AccountId"
dbcAccountID.BoundColumn = "AccountId"

Set recAccountID = Nothing

End Sub

Any help would be appreciated.

Thanks,
Leroy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top