Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to formatting multi-column combo ?

Status
Not open for further replies.

stvhui

Programmer
Jul 17, 2002
13
ID
Hello to you,
I'm uisng vfp7

How to formatting multi-column combo ?

My combo had 3 column (character,character,numeric)

I wanna to format the numeric column becomes "999,999,999.99"

How ?

Please advice
Steven
 
stvhui

The only way I can think of doing this is to manipulate the data a little, here a sample form to show you how to do it:
Code:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


	**************************************************
*-- Form:         form1 (c:\dopr\form1.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   08/26/02 10:31:05 AM
*
DEFINE CLASS form1 AS form


	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"


	ADD OBJECT combo1 AS combobox WITH ;
		ColumnCount = 0, ;
		ColumnWidths = "", ;
		RowSourceType = 6, ;
		RowSource = "myCursor.fieldmodi", ;
		FirstElement = 1, ;
		Height = 24, ;
		Left = 36, ;
		NumberOfElements = 0, ;
		Top = 36, ;
		Width = 264, ;
		Name = "Combo1"


	PROCEDURE Init
		LOCAL i,cValue
		nValue=100000000
		CREATE CURSOR myCursor (fieldid c(9),fieldn n(10),fieldmodi c(20))
		FOR i = 1 TO 100
		  INSERT INTO myCursor (fieldid) VALUES (ALLTRIM(STR(nValue)))
		  nValue = nValue+1
		endfor
		UPDATE myCursor set fieldn = VAL(fieldid)
		UPDATE myCursor set fieldmodi = TRANSFORM(fieldn,"999,999,999")
	ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Mike Gagnon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top