Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 14th, 2009, 09:54 AM
Registered User
Join Date: Sep 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default After execution the DataGrid1.Columns(0).Caption property is set to Field.Name

What is wrong this property?
I use Adodc1 and DataGrid1.
I try to do this by code.
Set DataGrid1.DataSource = Me.Adodc1
Me.DataGrid1.Columns(0).Caption = "Phone"
Me.DataGrid1.Columns(0).NumberFormat = "000 00 00"
Me.DataGrid1.Columns(0).DataField = "fld1"
But it is not working. Instead the caption property is set “fld1”.
The property NumberFormat is not shown correctly too.
Please help me.
Reply With Quote
  #2 (permalink)  
Old December 9th, 2009, 06:37 AM
Authorized User
Join Date: Oct 2007
Location: doncaster, , United Kingdom.
Posts: 46
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via MSN to debbiecoates
Default datafrid number format

I do a similar thing, but set it like this, it works fine, hope this helps

sub sSetGrid()
fmtNumber.Format = "#,##0; (#,##0)"
With Me.DataGrid_SpendProfile
.Columns(0).Visible = False
.Columns(1).Visible = False
.Columns(2).Visible = True
.Columns(2).Locked = True
.Columns(3).Visible = True
.Columns(3).width = 1000
.Columns(3).Alignment = dbgRight
Set .Columns(3).DataFormat = fmtNumber
End With
end sub so in your case you would need to use something like this fmtNumber.Format = "## ## ####" Set .Columns(3).DataFormat = fmtNumber

Last edited by debbiecoates; December 9th, 2009 at 06:42 AM..
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
chp 01, get[property name] and set[property name] sandeepgreaternoida BOOK: Professional PHP 5 ISBN: 978-0-7645-7282-1 0 May 12th, 2009 01:12 AM
Caption Field Brendan Bartley Access 2 June 2nd, 2006 07:24 AM
Alter Table and Caption Property swoozie Access 0 May 24th, 2006 12:38 PM
Control button caption and visible property chacquard Access VBA 7 September 9th, 2005 11:14 AM
How to add 2 columns in DataGrid1.DataKeyField drasko C# 0 December 6th, 2003 09:47 AM

All times are GMT -4. The time now is 01:41 PM.

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