Results 1 to 11 of 11

Thread: number to word

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    169

    number to word

    Dear friends,

    I have a function for converting number to word for netamt.

    function name is num_to_word.

    How to call the function in a form(while calculating netamt).Please guide me.

  2. #2
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: number to word

    Can you post your function?

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: number to word

    vb Code:
    1. num_to_word(this_is_the_number_parameter_I_pass)
    2.  
    3. 'Eg.
    4. MsgBox num_to_word(14)
    (a guess without seeing your Function)

  4. #4
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: number to word

    If the function is in a module, you want to declare it Public:
    Code:
    Public Function num_to_word( ... ) As String

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jul 2006
    Posts
    169

    Re: number to word

    Thanks for your mail.

    I want to call num_to_word function in select function.
    How to call funtion in a select query?

    suppose net_amt column.
    select num_to_word(val(net_amt)) ........gives error

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: number to word

    Assuming that you mean a Select query (SQL), you can't - you can only use functions that the database provides.

    You will need to run the function against the recordset fields (as part of your display process) instead.

  7. #7
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: number to word

    Or have an index table in the database that can give the wanted results, ie.
    Code:
    SELECT a.id, b.word FROM amounts a, words b WHERE b.word_id = a.net_amt
    word_id in this sample would link a certain number to certain word. The words table would be very simple, having only word_id and word columns in the table.

  8. #8

  9. #9

  10. #10

  11. #11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width