display yes instead of -1
display yes instead of -1
display yes instead of -1
display yes instead of -1
display yes instead of -1
display yes instead of -1 display yes instead of -1 display yes instead of -1 display yes instead of -1 display yes instead of -1 display yes instead of -1 display yes instead of -1 display yes instead of -1
display yes instead of -1 display yes instead of -1
display yes instead of -1
Go Back  Xtreme Visual Basic Talk > > > display yes instead of -1


Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2016, 01:06 PM
starmanMike starmanMike is offline
Junior Contributor
 
Join Date: Oct 2005
Location: near Norwich, UK
Posts: 287
Default display yes instead of -1


Hi,
I have an MSFlexgrid that displays an access table, one column of which (the third column) is boolean and displays -1 and 0. Is there any way of converting these values in the recordset to simply "yes" and "no" respectively? (There's also a databound label that needs to do the same). I thought I'd found the answer in this forum (of course!) but the below code doesn't work - apparently 'columns' isn't a valid property. Is that because it's an ADO property? If so, is there a DAO equivalent?
Code:
1st of all U must Add reference: Microsoft Data Formatting Object Library 6.0 then...
Private Sub Form_Load()
Adodc1.Visible = False
Dim fmtBooleanData As New StdDataFormat
fmtBooleanData.Type = fmtBoolean
fmtBooleanData.TrueValue = "Yes"
fmtBooleanData.FalseValue = "No"
Set dgSales.Columns(2).DataFormat = fmtBooleanData
End Sub
Note: dgSales is a name of Datagrid...
Yes, I know it's old and crochety but I am using DAO (the project is based on a former one that used DAO) so I removed the 1st line in the sub, and added the reference as he says.

Last edited by starmanMike; 09-30-2016 at 05:50 PM.
Reply With Quote
  #2  
Old 10-01-2016, 04:01 PM
starmanMike starmanMike is offline
Junior Contributor
 
Join Date: Oct 2005
Location: near Norwich, UK
Posts: 287
Default problem fixed

Okay, problem sorted completely, and I used ADO too! Will try to use it in future. But it was really hard to do seemingly simple stuff like a record count. Used sql instead!
Reply With Quote
Reply

Tags
fmtbooleandata, dao, reference, displays, column, 1st, fmtbooleandata.truevalue, fmtboolean, stddataformat, fmtbooleandata.type, private, object, library, formatting, data, microsoft, false, adodc1.visible, form_load, fmtbooleandata.falsevalue, dim, based, removed, added, line


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
display yes instead of -1
display yes instead of -1
display yes instead of -1 display yes instead of -1
display yes instead of -1
display yes instead of -1
display yes instead of -1 display yes instead of -1 display yes instead of -1 display yes instead of -1 display yes instead of -1 display yes instead of -1 display yes instead of -1
display yes instead of -1
display yes instead of -1
 
display yes instead of -1
display yes instead of -1
 
-->