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
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