472,780 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,780 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 8748
"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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.