Solved

# fractions in drop down menus

Posted on 2007-12-06
394 Views
Hi,

Is it possible to format a dropdown box to display fraction values?

If I have a db value of .33, is there a way to express that in a drop down as a fraction?

Thanks

Bill
0
Question by:billium99
[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

LVL 8

Expert Comment

ID: 20425571
0

LVL 6

Expert Comment

ID: 20425605
Yes,
it is possible ,
dropdown treat source value as a text
simply bind it with datavaluefield and datatextfield
0

LVL 8

Assisted Solution

deadite earned 200 total points
ID: 20425769
Yes, here is some simple VBScript that will give you a fraction:

``````MsgBox Dec2Frac(.33)

Function Dec2Frac(topPart)
count = len(topPart) - InStr(topPart, ".")
mult = 1
For i = 1 to count
mult = mult * 10
Next
Dec2Frac = (topPart * mult) & "/" & mult
End Function
``````
0

LVL 74

Accepted Solution

Jeffrey Coachman earned 300 total points
ID: 20426205
billium99,

Create a table:

FrationID      Fraction      FractionValue
1      1      1
2      3/4      0.75
3      1/2      0.5
4      1/4      0.25
5      1/8      0.125

Then you can create your combox to *Display* the fraction but *Use* the Value.

Here is a sample with a table and a sample form:
https://filedb.experts-exchange.com/incoming/ee-stuff/6039-Access--EE-Q23007970--Display-f.zip

JeffCoachman
0

LVL 1

Author Closing Comment

ID: 31413347
Hi - both solutions work - the second one is a slightly better fit for this project.

Thanks for the help guys!
0

LVL 74

Expert Comment

ID: 20451445
billium99,

I'm glad we were able to help!
:)

JeffCoachman
0

## Featured Post

Question has a verified solution.

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

### Suggested Solutions

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
###### Suggested Courses
Course of the Month4 days, 16 hours left to enroll

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

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