Results 1 to 5 of 5
  1. #1
    Jamaluddin is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Dec 2011
    Posts
    16

    Post Date in Word

    Hi ALL

    I am trying to create a report which is basically a School Certificate. The requirement is that I need to print the Issue Date, means the current system date be printed in ENGLISH WORDS rather Alpha-numeric format, i.e.: instead of 11 Mar 2012, I need some thing like this: Eleven March Two Thousand and Twelve.

    Please suggest a fruitful solution for the said situation.



    Jamal

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    You could write a custom function.

    Google: VBA convert number to words

    Here is one: http://www.vbexplorer.com/VBExplorer/tips/src36.asp
    and another approach http://www.codeproject.com/Articles/...Number-to-Word

    Most, if not all, of these code samples concern currency, for check printing, so will have to modify for your requirement. Could write function specific to your situation. Because you have finite set of numbers to convert - 31 days and then however many (50?) years you want, could just build one long Select Case structure.

    You will have to parse each date part and call the function with each to return words for day and year. Something like:

    = ConvertFunction(Day(Date())) & " " & Format(Date(),"mmmm") & " " & ConvertFunction(Year(Date()))

    Alternatively, you can have a table of the numbers and their word equivalents and do a Lookup on the table. This would be fairly quick and simple.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Jamaluddin is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Dec 2011
    Posts
    16

    Post

    Quote Originally Posted by June7 View Post
    Alternatively, you can have a table of the numbers and their word equivalents and do a Lookup on the table. This would be fairly quick and simple.


    Thanks June7. can you give me an example for this alternative please? I can't figure out how to do this.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    A table of numbers and word equivalents, like:
    Number Words
    1 One
    2 Two
    2012 Two Thousand and Twelve

    Then can use DLookup to return the word string.
    DLookup("[Words]", "NumberWords", "[Number]=" & Day(Date()))
    DLookup("[Words]", "NumberWords", "[Number]=" & Year(Date()))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Jamaluddin is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Dec 2011
    Posts
    16
    Thanks.... a simple and good solution for complex situation ...

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access to Word - Multiple Word Templates?
    By alpinegroove in forum Programming
    Replies: 11
    Last Post: 06-12-2012, 04:42 PM
  2. Return date from Word to Access
    By lizzywu in forum Import/Export Data
    Replies: 3
    Last Post: 11-23-2011, 01:56 AM
  3. Reserved word
    By squirrly in forum Access
    Replies: 6
    Last Post: 09-20-2011, 02:43 PM
  4. Replies: 1
    Last Post: 07-27-2010, 07:06 AM
  5. access to word please help!
    By fiesta_rich in forum Import/Export Data
    Replies: 2
    Last Post: 04-14-2009, 09:27 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums