PDA

Click to See Complete Forum and Search --> : Unbinding cotrols


lenin
Jul 7th, 2000, 03:25 AM
Hi,
Can someone let me know if it is possible to unbind controls easily. I have a form with a couple of datacombo's. When the user selects an option on the first combo, it call's an SP and populates the second. I bind the results of the Stored Procedure to the second combo.

This works fine, except that when I call a procedure to display the records from another SP, and try to bind them, all bind ok except for the one I bound earlier.

What I need to do is unbind the control after the contents have been saved to our database.

Select Case m_actionType
Case fqry_ACTION_TYPE.em_NONE
Exit Sub
Case fqry_ACTION_TYPE.em_CURRENT
Exit Sub
'
' Run SP to return relevant contact details based on customer
'
Case fqry_ACTION_TYPE.em_ADD
If IsNumeric(cmbQuery(fqry_CMB_CUSTOMER).BoundText) Then
If deUSD.rsContact.State = adStateOpen Then
deUSD.rsContact.Close
End If
Call deUSD.contact(CInt(cmbQuery(fqry_CMB_CUSTOMER).BoundText))
'
' Binding Contact Control
'
With cmbQuery(fqry_CMB_CONTACT)
Set .DataSource = deUSD
.DataMember = "contact"
.DataField = "contact_name"
.BoundColumn = "num"
Set .RowSource = deUSD
.RowMember = "contact"
.ListField = "contact_name"
End With
Else
Exit Sub
End If
End Select

I have tried setting datasource / member to Nothing but this does not do it.

Thanks in advance.

Lenin