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