¿alguien me puede explicar para q sirven las propiedas boundcolumn y boundtext ?

juanolas
25 de Septiembre del 2003
Hola a todos ,agradeceria a alguien que me explicase para que sirven las propiedades boundcolumn y boundtext del datacombo o sino que me digan donde puedo encontrar una explicacion ,ya que la ayuda que tengo no lo explica nada bien ,gracias.

sdemingo
25 de Septiembre del 2003
boundcolumn:

Returns or sets the name of the source field in a Recordset object that is used to supply a data value to another Recordset.

Syntax

object.BoundColumn [= value]

The BoundColumn property syntax has these parts:

Part Description
object Anobject expression that evaluates to an object in the Applies To list.
value Astring expression that specifies the name of a field in the Recordset created by the Data control specified by the RowSource property.


Remarks

Generally, when working with the DataList and DataCombo controls, you use two Data controls; one to fill the list as designated by the Listfield and RowSource properties and one to update a field in a database specified by the DataSource and DataField properties.

The ListField property designates the field used to fill the list. The second Data control, as designated by the DataSource property, manages a Recordset containing a field to be updated. Once the user chooses one of the items in the list, the field specified by the BoundColumn property is passed to the field in the second Data control, as designated by the DataSource and DataField properties. This way you can designate one field to fill the list, and another field (from the same Recordset) to pass as data to the Recordset designated by the DataSource and DataField properties when an item is selected.

If the field specified by the BoundColumn property can't be found in the Recordset, a trappable error occurs.

Data Type

String


sdemingo
25 de Septiembre del 2003
boundtext:

Returns or sets the value of the field specified by the BoundColumn property.

Syntax

object.BoundText [= value]

The BoundText property syntax has these parts:

Part Description
object Anobject expression that evaluates to an object in the Applies To list.
value Astring expression that specifies a data value.


Remarks

After a user makes a selection with a DataList or DataCombo control, the BoundText property contains the field value of the BoundColumn property. When an item in the list is selected, the item becomes available to the Data control specified by the DataSource property. The selection also appears in the text box portion of the DataCombo control where it can be edited. If the user enters a value in the text box portion, the list portion attempts to position to a matching item. If a match is found, the BoundText property value is set, based on the field value of the BoundColumn property. If no match is found, the BoundText property is set to Null.

You can use the BoundText property value to create a query that can then be used to find specific records:

Dim strQ As String
StrQ = "Select * From Products Where SupplierID = " & DataList1.BoundText
' Use the new query with an ADO Data Control to return a new recordset.
Adodc1.RecordSource = strQ

Positioning the Data control, specified by the DataSource property, to a new record sets the BoundText property to the value specified by DataField. The DataList or DataCombo control then searches the records in the list to see if the BoundText value matches the value of the field in the BoundColumn property. If a match is found, the record is highlighted in the list or placed in the text box portion of the DataCombo control.

Data Type

String