I have a combo box with a stored procedure as a row source and I want the
first item in the list to appear instead of it being blank. I used the
ComboBox = Combox.ItemData(0) and it worked until I made a change to the sp.
I adjusted settings on the combo box to be 3 columns instead of two and
added column headers.
Any thoughts?
Thanks,
Wes
The sp is:
Alter Procedure spGetPlansActive
@CustID int
As
SELECT tblPlans.PlanID,tblPlans.PlanName,tblPlans.ReceiptDate
FROM tblPlans
WHERE (@CustID = CustID) And (tblPlans.Inactive = 0)
ORDER BY tblPlans.PlanName
Sylvain Lafontaine - 15 Aug 2005 21:28 GMT
Refresh the Views/Stored Procedures/Functions window with F5 or View ->
Refresh.
If this doesn't work (it should), then try remplacing ItemData(0) with
Column(0,0). Recompiling all modules can also be of some help.

Signature
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
>I have a combo box with a stored procedure as a row source and I want the
> first item in the list to appear instead of it being blank. I used the
[quoted text clipped - 22 lines]
>
> ORDER BY tblPlans.PlanName
Brendan Reynolds - 16 Aug 2005 10:17 GMT
It's the column headers - when you add them, they become ItemData(0), and
the first row of data becomes ItemData(1).
You could change the code to point to ItemData(1) instead of ItemData(0), or
use something like this, so that it will keep working even if you decide to
hide the column headers again ...
Private Sub Form_Load()
If Me.Combo0.ColumnHeads Then
Me.Combo0 = Me.Combo0.ItemData(1)
Else
Me.Combo0 = Me.Combo0.ItemData(0)
End If
End Sub

Signature
Brendan Reynolds (MVP)
>I have a combo box with a stored procedure as a row source and I want the
> first item in the list to appear instead of it being blank. I used the
[quoted text clipped - 22 lines]
>
> ORDER BY tblPlans.PlanName
aaron.kempf@gmail.com - 19 Aug 2005 02:49 GMT
jesus friggin christ; that just amazes me-- is this documented? has it
always been like this?