Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
' Formula Name : @PageNumbers_Roman
' Comments : converts a number to Roman numerals
' Original code from [URL unfurl="true"]http://www.utteraccess.com/forums/access/access330925.html[/URL]
' Uses Basic Syntax
Dim Digits As String
Dim intCounter As Number
Dim intDigit As Number
Dim strTmp As String
Dim intIn As Number
Digits = "ivxlcdm"
'To show them as UpperCase Roman numerals, comment the above line,
' and uncomment the next
'Digits = "IVXLCDM"
[COLOR=red]intIn = PageNumber[/color]
intCounter = 1
Do While intIn > 0
intDigit = intIn Mod 10
intIn = intIn \ 10
Select Case intDigit
Case 1
strTmp = Mid(Digits, intCounter, 1) & strTmp
Case 2
strTmp = Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & strTmp
Case 3
strTmp = Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & strTmp
Case 4
strTmp = Mid(Digits, intCounter, 2) & strTmp
Case 5
strTmp = Mid(Digits, intCounter + 1, 1) & strTmp
Case 6
strTmp = Mid(Digits, intCounter + 1, 1) & Mid(Digits, intCounter, 1) & strTmp
Case 7
strTmp = Mid(Digits, intCounter + 1, 1) & Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & strTmp
Case 8
strTmp = Mid(Digits, intCounter + 1, 1) & Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & Mid(Digits, intCounter, 1) & strTmp
Case 9
strTmp = Mid(Digits, intCounter, 1) & Mid(Digits, intCounter + 2, 1) & strTmp
End Select
intCounter = intCounter + 2
Loop
Formula = strTmp