Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 24th, 2009, 08:09 AM
Authorized User
Join Date: Oct 2007
Posts: 46
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via MSN to debbiecoates
Default Changinf the Data Format of Fields in a Datagrid

can anyone help me please.

i have a datagrid attached to an adodb datasource. One of the columns in my datagrid is a currency field.

I am trying to format that column in the datagrid to display the currency

I have the WROX Book Professional VB6 Databases, by Charles Williams, on page 299 he shows an example of how to do this, however, i cant get it to work, i keep getting a error 438 object doesnt support this property or method

this is the code that i am using on the load event of my form

Dim fmtcurr As New StdDataFormat
fmtcurr.Format = "Currency"
Set Me.Adodc1.Recordset = GetRecordset("Select * from PROJECTFUNDINGPACKAGE where ProjectiD = 10001")
Me.DataGrid1.Columns(3).DataFormat = fmtcurr
Old February 24th, 2009, 09:15 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi

The data format should be a standard format.. I don't know what is StdDataFormat, maybe is a custom class, but the grid only accepts standard formats (in facts, the format is a string with the name) Maybe you missed something about this examples??


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
================================================== =========
I know that CVS was evil, and now i got the
================================================== =========

Similar Threads
Thread Thread Starter Forum Replies Last Post
SELECTING CERTAIN FIELDS IN A DATAGRID??? twyce General .NET 1 November 14th, 2008 02:22 PM
custom format of fields barmanvarn BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 May 22nd, 2006 11:24 AM
All fields of datagrid are Null hexOffender VB Databases Basics 0 March 23rd, 2006 02:22 PM
how to Export in PDF Format with Parameter fields navid Crystal Reports 2 February 2nd, 2006 04:06 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.