Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to plug nembers to text ! 1

Status
Not open for further replies.

andrep

Technical User
Feb 27, 2002
40
CA
Could someone please tell me where the code goes !
there are two functions

Function english(ByVal N As Currency) As String
and
Private Function EnglishDigitGroup(ByVal N As Integer) As String

I am trying to call the function off the lost focus of the amount entered.

Private sub_amount_Click
Call function english(N)
end sub

i get an error on the call because of the (N) i believe ????

any help appreciated.
Thanks
 
Why not add a line before calling the function to convert the data into a string? "The beauty of the second amendment is, that it will not be needed until they try to take it." - Thomas Jefferson

WebMaster:
 
Thanks, but could you be more explicit ! I have never used
functions before so i am at a loss !

 
Why are you advising the conversion to string when the function prototype specfied a surrency value for the argument?

I think the real isue is the lack of a receiving variable, as in:

strMyCheckAmt = english(SomeNumericVariable)

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Ok let me be blunt here !

Where does the private sub go ?
Where does the function go !

What do I call the function of the private sub ?

My field containing the value i want into text is called amount!

And finally how do i get to write the results into the text field called text9.

Hope someone can clear this up for me once and for all !

Excuse my ignorance as i stated before i am green with functions! and when there is a (byval N) in the brackets
i am on another planet!

Thanks again all those who have tried to help !



 
I am trying to call the function off the lost focus of the amount entered.

Private sub_amount_Click
Call function english(N)
end sub


The "ByVal N as Currency" guy in the function code means that you are going to pass the function a VALUE, and it's called N, and it better be a CURRENCY value

e.g. Call ENGLISH(123.45)

So your call to ENGLISH in the SUB Amount_CLICK needs to pass a number, not an "N"...

Both functions RETURN a string value, probably some kind of text like "Dollars" or "One Hundred" or something..

Here's a step-by-step

Function DoSomething(Input as Integer) as String

DoSomething = "You passed me" & Input

end function


x = Call DoSomething(100)

x = "You passed me 100"

See how it works? You ASSIGN the value of something to be the result returned by a function when you pass the function something else...

MyStuff = DoSomething(FOO)





Ex-JimAtTheFAA
78.5% of all statistics are made up on the spot.
Another free Access forum:
 
Thanks you so much Jim for clearing this up for me!
the problem was i was filling the amount field and trying
to send the result to another field !

Not working beautifully !

Thanks again
André
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top