Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# decimal to fraction conversion

Posted on 1998-06-24
Medium Priority
353 Views
I need to convert decimal numbers to fractions in Access 97.
With Excel you can just format the cells is there a way to do it in Access?
0
Question by:Desrosiers
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• Learn & ask questions
1 Comment

LVL 6

Accepted Solution

devtha earned 800 total points
ID: 1975715
Function getpart (var As Double)

Dim var1 As String, var2 As String, var3 As String, var4 As String

var1 = Mid\$(Str(var), 1, InStr(Str(var), ".") - 1)
var2 = Mid\$(Str(var), InStr(Str(var), ".") + 1, 99)

Select Case var2
Case "2"
var3 = "1/5"
Case "25"
var3 = "1/4"
Case "33"
var3 = "1/3"
Case "4"
var3 = "2/5"
Case "5"
var3 = "1/2"
Case "6"
var3 = "3/5"
Case "66"
var3 = "2/3"
Case "75"
var3 = "3/4"
Case "8"
var3 = "4/5"
Case Else
Exit Function
End Select
MsgBox var3

End Function

See if this funcion solves your question.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
###### Suggested Courses
Course of the Month11 days, left to enroll

#### 719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.