sefak169
10-07-2009, 05:06 AM
Database: Microsft Sql Server 2005 express edition
Front End: Microsoft Visual Basic 6.0
Grid: Video Flex Grid (Component One)
I need to input my a currency sign in the amount column along with amount.
I Know That There is a built in function in video flex grid for currency format which adds $ sign n column
but as i m working on multi currency software so i want to show other currencies too like pound ,Yen or canadian dollar
so i need some thing like this
A$400
c$400
¥400
RMB400
Yen400
Flyguy
10-07-2009, 01:22 PM
Set the ColFormat property, the $ is translated in the local currency symbol, see code and attached picture.
Private Sub Form_Load()
Dim i As Long
Dim dValue As Double
With VSFlexGrid1
.Rows = 10
.Cols = 3
' Formatted results for column 2
.ColFormat(2) = "$#,#0.00"
.TextMatrix(0, 2) = .ColFormat(2)
For i = 1 To 9
dValue = Round(Rnd * 1000, 3)
.TextMatrix(i, 1) = dValue
.TextMatrix(i, 2) = dValue
Next i
.AutoSize 1, .Cols - 1
End With
End Sub
sefak169
10-09-2009, 05:30 AM
thx for the reply flyguy
i do know abt that but i wana use multiple currencies
eg
How Do I Handle Following Example
1) User pays US Dollars To Vendor (Cash Payment Form)
2)User Reicives YEN from customer (Cash Receive Form)
at the same time two forms are open one dealing with us dollars and other in YEN
where as default currency is Pound
or if possible
A$400
c$400
¥400
RMB400
Yen400
In One Column
pls let me know if i m not clear abt my question
sefak169
10-09-2009, 07:59 AM
Private Sub sb_set_currency_signs()
Dim i As Integer
With grd(c_grdCPVoucher)
For i = 1 To .Rows - 1
.TextMatrix(i, c_grdcolAmount) = Format(.TextMatrix(i, c_grdcolAmount), "¥###,###,##0.00")
Next i
End With
End Sub
i used the above code to format curreincies but there is a problem tht when i try to edit the amount column the currency sign is still there it is not removed as it does while using .colformat property
I CAN DO THE FOLLOWING
i can remove the currency sign if i capture before edit event
and then again format it by capturing after edit event
the value of the column can be extracted by using .valuematrix function
but puting this code in all 350 forms really is pain in the a.. :(
so any other suggestions u have in mind would really be appreciated
Flyguy
10-09-2009, 11:25 AM
The currency sign is generated based on the current Regional Settings of the PC.
So you can not have to different currency signs at the same time.
You have to hard code it. Sorry.