Others

Convert Numbers to Indian Rupee Words in a Microsoft Access Query

Ayan MasoodAyan Masood Nov 27, 2026 870 views

Question details

Convert numeric amounts into words using Indian rupee, paise, lakh, and crore terms in an Access query.

Convert Numbers to Indian Rupee Words in a Microsoft Access Query
Product
Microsoft Access
Device & OS
not provided
Scenario
The user wants an Access query or form to display monetary amounts in words using the Indian numbering system.
Observed behavior
The desired output is text such as “Rupees one lakh twenty three thousand four hundred fifty six and seventy eight paise only.”
Before you start

Identify the table and numeric amount field you want to use in the query. Open the database in desktop Microsoft Access and enable its content if prompted so that VBA functions can run.

Solution 1Recommended

Add a VBA function and call it from an Access query

Use a standard VBA module to spell amounts in rupees and paise with lakh and crore grouping.

The function returns text rather than a numeric currency value. It accepts amounts up to 999999999999.99 in absolute value and rounds fractions of a paise using VBA's Round function.

1
Create a standard module

In Access, press Alt+F11 to open the VBA editor, then select Insert > Module.

2
Paste the conversion code

Paste the following code into the new module: Option Compare Database Option Explicit Public Function AmountInIndianWords(ByVal value As Variant) As String On Error GoTo InvalidAmount If IsNull(value) Then AmountInIndianWords = "" Exit Function End If If Not IsNumeric(value) Then GoTo InvalidAmount Dim amount As Currency Dim totalPaise As Double Dim rupees As Double Dim paise As Long Dim result As String amount = CCur(value) If Abs(amount) > 999999999999.99 Then GoTo InvalidAmount totalPaise = Round(Abs(amount) * 100, 0) rupees = Fix(totalPaise / 100) paise = CLng(totalPaise - rupees * 100) result = "Rupees " & IndianNumberWords(rupees) If paise > 0 Then result = result & " and " & IndianNumberWords(paise) & " paise" If amount < 0 And totalPaise > 0 Then result = "Minus " & result AmountInIndianWords = result & " only" Exit Function InvalidAmount: AmountInIndianWords = "Invalid amount" End Function Private Function IndianNumberWords(ByVal n As Double) As String Dim ones As Variant, tens As Variant Dim part As Double, remainder As Double Dim result As String ones = Array("zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen") tens = Array("", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety") If n < 20 Then IndianNumberWords = ones(CInt(n)) Exit Function ElseIf n < 100 Then part = Fix(n / 10) remainder = n - part * 10 result = tens(CInt(part)) ElseIf n < 1000 Then part = Fix(n / 100) remainder = n - part * 100 result = IndianNumberWords(part) & " hundred" ElseIf n < 100000 Then part = Fix(n / 1000) remainder = n - part * 1000 result = IndianNumberWords(part) & " thousand" ElseIf n < 10000000 Then part = Fix(n / 100000) remainder = n - part * 100000 result = IndianNumberWords(part) & " lakh" Else part = Fix(n / 10000000) remainder = n - part * 10000000 result = IndianNumberWords(part) & " crore" End If If remainder > 0 Then result = result & " " & IndianNumberWords(remainder) IndianNumberWords = result End Function

3
Save and compile the module

Select File > Save and give the module a name different from the function, such as modIndianWords. Select Debug > Compile to check the code.

4
Call the function in a query

Open your query in Design View and enter AmountInWords: AmountInIndianWords([Amount]) in an empty Field column. Replace Amount with your numeric field name, then select Run.

5
Check an example

Run the query with an amount of 123456.78. The calculated field should show “Rupees one lakh twenty three thousand four hundred fifty six and seventy eight paise only.”

Add a VBA function and call it from an Access query
Using the result: Null values return blank text, and invalid or out-of-range values return “Invalid amount.” The same function can also be called in an Access form control expression.
Free Microsoft Office alternative

Work with spreadsheet amounts in WPS Office

WPS Office is a free, lightweight alternative for everyday documents and spreadsheets. Its familiar interface and Microsoft Office format support make it easy to move existing files, though it does not run or repair Microsoft Access queries.

Review and format rupee amounts in WPS Spreadsheet.Open and edit Microsoft Excel XLSX and XLS files.Use a familiar interface for everyday office tasks.Move compatible documents and spreadsheets without changing your workflow.
microsoft office alternative - wps office

Frequently Asked Questions

How do I use the function in an Access form?

In the form's Design View, add a text box and set its Control Source to =AmountInIndianWords([Amount]), replacing Amount with your field name.

Why does Access not recognize the function in my query?

Check that the function is declared Public in a standard module, that the module has a different name from the function, and that database content is enabled. In the VBA editor, select Debug > Compile to check for errors.

Can the result include paise and the word “only”?

Yes. The example function appends paise when the rounded paise value is nonzero and ends every valid result with “only.”

What happens when the amount has more than two decimal places?

The function rounds to the nearest paise with VBA's Round function, which uses banker's rounding for midpoint values. Check the rounding rule against your accounting requirements.

Can I use Excel number-to-text VBA code in Access?

Often you can copy the conversion logic into an Access standard module, but Excel-specific references such as worksheet or cell objects must be removed or adapted before calling it from a query.