Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataGrid - Changing Boolean to True/False
Message
From
27/11/2001 10:12:57
 
 
To
26/11/2001 15:48:33
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00585940
Message ID:
00586312
Views:
19
>>I have a user-defined SQL extract that populates a DataGrid from SQL 7.0 tables.
>>How do I change the default numeric value for a boolean field to True/False? I already know how to change the column caption and alignment. Thanks for any help.
>>
>>Stan Symons
>
>You can use this code to change the format of logical fields in an MS Datagrid control: (oRSD is the grid's datasource, ADO recordset)
>
   For Each clmn In Grid1.Columns
>      If oRSD.Fields(clmn.ColIndex).Type = adBoolean Then
>         With clmn.DataFormat
>            .Type = 5
>            .TrueValue = "True"
>            .FalseValue = "False"
>         End With
>      End If
>   Next
>
>Hope this helps.

Thanks for the tip, but I followed Eric's suggestion to modify the Select with a Case statement - That was easy. It's nice to know about the DataFormat property for future reference.
Previous
Reply
Map
View

Click here to load this message in the networking platform