Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 28th, 2003, 12:37 AM
meoj meoj is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 3 meoj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking formulas: convert number to words & compute for running balance

how:

a.) number to word

b.) running balance

Reply With Quote
  #2  
Old November 28th, 2003, 03:16 AM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
Hali,

To convert number to word (you mean text) use:
Str(Number)

Be more specific on both points.

BRegs,

TBÁrpi

Reply With Quote
  #3  
Old December 1st, 2003, 02:26 AM
meoj meoj is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 3 meoj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
my problem actually is about
1.) CONVERTING NUMBER TO WORDS EXAMPLE: NUMBER: 100 WORD: One Hundred

2.) RUNNING BALANCE

i have this column:

ecode employee payable payment balance
11044 Moe Jr. 100.00 50.00 50.00
100.00 150.00
150.00 300.00


can u help me with this

Reply With Quote
  #4  
Old December 1st, 2003, 09:47 AM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
Here is a function that will work, I can't take credit for it becuase I found it on the internet, that converts numbers into word. I use it all the time. You will need to pass you value to it as a string. Use the Str(Number) that TBÁrpi should you to convert the interger value to a string value before passing it to the function

I need more clarification on your second question.

Good Luck

S-






Public Function Convert_Dollar(iDollar As String) As String
'first set up two arrays to convert numbers to words
Dim BigOnes(9) As String
Dim SmallOnes(19) As String
Dim Dollars As String
Dim cents As String
Dim Words As String
Dim Chunk As String
Dim digits As String
Dim leftDigit As String
Dim RightDigit As String
'and populate them
BigOnes(1) = "Ten"
BigOnes(2) = "Twenty"
BigOnes(3) = "Thirty"
BigOnes(4) = "Forty"
BigOnes(5) = "Fifty"
BigOnes(6) = "Sixty"
BigOnes(7) = "Seventy"
BigOnes(8) = "Eighty"
BigOnes(9) = "Ninety"
SmallOnes(1) = "One"
SmallOnes(2) = "Two"
SmallOnes(3) = "Three"
SmallOnes(4) = "Four"
SmallOnes(5) = "Five"
SmallOnes(6) = "Six"
SmallOnes(7) = "Seven"
SmallOnes(8) = "Eight"
SmallOnes(9) = "Nine"
SmallOnes(10) = "Ten"
SmallOnes(11) = "Eleven"
SmallOnes(12) = "Twelve"
SmallOnes(13) = "Thirteen"
SmallOnes(14) = "Fourteen"
SmallOnes(15) = "Fifteen"
SmallOnes(16) = "Sixteen"
SmallOnes(17) = "Seventeen"
SmallOnes(18) = "Eighteen"
SmallOnes(19) = "Nineteen"
'format the incoming number to guarantee six digits
'to the left of the decimal point and two to the right
'and then separate the dollars from the cents
iDollar = Format(iDollar, "000000.00")
Dollars = Left(iDollar, 6)
cents = Right(iDollar, 2)
Words = ""
'check to make sure incoming number is not too large
If Dollars > 999999 Then
'Text2.Text = "Dollar amount is too large"
Exit Function
End If
'separate the dollars into chunks
If Dollars = 0 Then
Words = "Zero"
Else
'first do the thousands
Chunk = Left(Dollars, 3)
If Chunk > 0 Then
GoSub ParseChunk
Words = Words & " Thousand"
End If
'do the rest of the dollars
Chunk = Right(Dollars, 3)
If Chunk > 0 Then
GoSub ParseChunk
End If
End If
'concatenate the cents and display
If cents = 0 Then cents = "No"
Words = Words & " & " & cents & "/100"
'Text2.Text = Words
Convert_Dollar = Words
Exit Function

ParseChunk: digits = Mid(Chunk, 1, 1)
If digits > 0 Then
Words = Words & " " & SmallOnes(digits) & " Hundred"
End If
digits = Mid(Chunk, 2, 2)
If digits > 19 Then
leftDigit = Mid(Chunk, 2, 1)
RightDigit = Mid(Chunk, 3, 1)
Words = Words & " " & BigOnes(leftDigit)
If RightDigit > 0 Then
Words = Words & " " & SmallOnes(RightDigit)
End If
Else
If digits > 0 Then
Words = Words & " " & SmallOnes(digits)
End If
End If
Return




End Function

Reply With Quote
  #5  
Old December 1st, 2003, 05:14 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
SELECT Orders.EmployeeID AS EmpAlias, Sum(Orders.Freight) AS SumOfFreight, Format(DSum("Freight","Orders","[EmployeeID]<=" & [EmpAlias] & ""),"$0,000.00") AS RunTot
FROM Orders
GROUP BY Orders.EmployeeID;


This will give you a running total. Play with it

S-

Reply With Quote
  #6  
Old February 18th, 2004, 01:28 AM
meoj meoj is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 3 meoj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Inquiry

How would i do that? I still can't get it...


Please bear with me, i'm new to access..

Thanks!

Reply With Quote
  #7  
Old February 18th, 2004, 01:55 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
what can't you get

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > formulas: convert number to words & compute for running balance


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway