473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

new to using format$(xxxxxxx."currency")

I have had no success using the format function as follows (the two
lines of code run one after the other):

'displays a running total of lblAmtdue.Caption
'contents in txtTotal.Text
txtTotal.Text = lblAmtdue.Caption + Val(txtTotal.Text)

'tries to format contents of txtTotal.Text as currency; doesn't work
txtTotal.Text = Format$(txtTotal.Text, "Currency")

Of what obvious formatting error am I guilty?

Bill
Jul 17 '05 #1
1 8788
"Bill Stanard" <ws******@palmertrinity.org> wrote in message
news:4f**************************@posting.google.c om
I have had no success using the format function as follows (the two
lines of code run one after the other):

'displays a running total of lblAmtdue.Caption
'contents in txtTotal.Text
txtTotal.Text = lblAmtdue.Caption + Val(txtTotal.Text)

'tries to format contents of txtTotal.Text as currency; doesn't work
txtTotal.Text = Format$(txtTotal.Text, "Currency")

Of what obvious formatting error am I guilty?


the first thing I'd do is eliminate all the implicit data conversions

Dim cTotal As Currency
cTotal = CCur(lblAmtdue.Caption) + CCur(txtTotal.Text)
txtTotal.Text = Format$(cTotal, "Currency")

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Lasse Edsvik | last post by:
can you guys please tell me why i cant use currency as a name in my querystring? note: i NEED to use it since i'll be linking to a remote site were they get that info from querystring <%...
7
by: Philip Nelson | last post by:
Folks, I've been exercising my mind recently about the complexities of implementing a "currency" data type within DB2 to cope with multiple currencies. A monetary value is often simply...
5
by: eliffman | last post by:
I'm trying to populate an array with the records from a recordset. But I'm getting an error. Here's the code: Dim db As Database, qd As QueryDef, rs As Recordset Dim MyArray() As Double, i As...
5
by: Dan C Douglas | last post by:
I have just installed VS.NET 2003 on my computer. I have a project that I have been developing on VS.NET 2002. I haven't upgraded this project to VS.NET 2003 yet and I am still developing it in...
2
by: kiran | last post by:
Hi, I am able to create instance of Culture Info for different cultures. How will I get number format as "$ ###,###,##0.00" from CultureInfo.NumberFormat. I need it in this format so that I...
18
by: Atara | last post by:
In my apllication I use the following code: '-- My Code: Public Shared Function strDate2Date(ByVal strDate As String) As System.DateTime Dim isOk As Boolean = False If (strDate Is Nothing)...
0
by: niklang | last post by:
Hi everybody, First post but i really need some help with this as its driving me mad. I need to format a number to be a currency and when i saw that this was supported already by the...
3
by: shill57957 | last post by:
I have a query: SELECT .AH_TICKNO, Format((.AH_AMOUNT-.AH_TRNAMT)/.AH_AMOUNT,"Percent") AS DIF INTO FROM ; I dont want to format as a percent, I want it to go into the table with 4 decimal...
5
by: Bob | last post by:
Hello Folks, I am bring backa data reader dr from the database/ So I have a number of fields such as dr To put this in a table I use "<td>" + dr.ToString() + "</td>" But I want to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.