Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / August 2005

Tip: Looking for answers? Try searching our database.

ComboBox won't load ItemData(0)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wes Peters - 15 Aug 2005 20:55 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.