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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataCombo W/ Stored Procedure

Status
Not open for further replies.

stacy47

Programmer
Jan 24, 2001
6
US
I'm trying to bind a datacombo box to a command based on a stored procedure. The stored procedure has one parameter. I am trying to refill the combo box after the user provides the parameter by selecting a record from a different combo box. When I refresh, I get an error stating that the field is not valid (Error 545). However, the recordset can be manipulated because I tried doing a recordcount and listing the field names available and this worked fine. The field IS valid. Here's the code:


Private Sub datacombo1_Change()
dataenvironment1.command1 datacombo1.BoundText 'open rs with parameter

datacombo2.Enabled = True 'enable combo for selection

With datacombo2
.DataField = Empty 'clear field
.DataField = "field1"
.BoundColumn = "field1"
.ListField = "field2"
Set .RowSource = dataenvironment1
.RowMember = "command1"
Set .DataSource = dataenvironment1
.DataMember = "command1"
.BoundText = "" 'clear text
End With
End Sub

I'm using msdatlst.ocx(sp3)(oledb). Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top