The Basics > Configuring Columns at Run Time > Adjusting Column Properties in Code |
Properties of the Column object can be changed at run time using Visual Basic code. For example, changing the DataField property can be done as follows:
Example Title |
Copy Code
|
---|---|
With TDBList1.Columns(0) .DataField = "New DataField" TDBList1.ReBind .Caption = "New Caption" End With |
Note that after changing the DataField property, you must ReBind the list columns so that the new data will appear in the column. You should also change the caption to describe the new field.
Other Column object properties can be changed in a similar fashion. Please refer to Column Object Properties for a complete listing.