Formatting numbers in combo-boxes - basic.visual
This is a discussion on Formatting numbers in combo-boxes - basic.visual ; Hello NG!
Being a newbee to VB6.0, I'm faced withe the following problem:
I'm using VB6.0 on WinXP Pro to re-engineer a DB-frontend.
There a several frames containing combos based on fixed lists of
values.
This, I like to change ...
-
Formatting numbers in combo-boxes
Hello NG!
Being a newbee to VB6.0, I'm faced withe the following problem:
I'm using VB6.0 on WinXP Pro to re-engineer a DB-frontend.
There a several frames containing combos based on fixed lists of
values.
This, I like to change to combos, whose lists are derived from
database-tables.
Having succeeded in doing so, I now have to cope the fact, that the
format of the values is lost
Within the table (Access '79) the format is "#.##0" (european number-
format, no digits after comma, dot separates the thousands)
Exactly the same format would be appreciated in the VB-form
But since ' combobox1.DataFormat.Format = "#.##0" ' or '
combobox1.DataFormat.Format = "#,##0" ' doesn't work, I'm totally at a
loss.
Any help will be appreciated!
Alex
-
Re: Formatting numbers in combo-boxes
Found the solution with the aid of a friend.
If anyone else stumbles at this point:
With the use of FormatNumber(...), you can format the item before
adding it to the combobox-list
cmb_1.AddItem (FormatNumber(rsI!SB_Euro, 0, vbUseDefault,
vbUseDefault, vbUseDefault))
A.S.
On 16 Mrz., 15:11, "Alex Sauer" <dead.man.walk...@gmx.de> wrote:
> Hello NG!
>
> Being a newbee to VB6.0, I'm faced withe the following problem:
> I'm using VB6.0 on WinXP Pro to re-engineer a DB-frontend.
> There a several frames containing combos based on fixed lists of
> values.
> This, I like to change to combos, whose lists are derived from
> database-tables.
>
> Having succeeded in doing so, I now have to cope the fact, that the
> format of the values is lost
> Within the table (Access '79) the format is "#.##0" (european number-
> format, no digits after comma, dot separates the thousands)
> Exactly the same format would be appreciated in the VB-form
>
> But since ' combobox1.DataFormat.Format = "#.##0" ' or '
> combobox1.DataFormat.Format = "#,##0" ' doesn't work, I'm totally at a
> loss.
>
> Any help will be appreciated!
> Alex
Similar Threads
-
By Application Development in forum ADO DAO RDO RDS
Replies: 14
Last Post: 12-11-2007, 11:08 AM
-
By Application Development in forum Adobe Acrobat
Replies: 0
Last Post: 01-14-2007, 08:05 PM
-
By Application Development in forum basic.visual
Replies: 2
Last Post: 06-02-2005, 07:43 PM
-
By Application Development in forum basic.visual
Replies: 1
Last Post: 01-01-2004, 04:40 AM
-
By Application Development in forum basic.visual
Replies: 0
Last Post: 08-26-2003, 09:29 PM