fractions in drop down menus

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
LVL 1
billium99Asked:
Who is Participating?
 
Jeffrey CoachmanConnect With a Mentor MIS LiasonCommented:
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
 
kebabsCommented:
0
 
divyeshhdoshiCommented:
Yes,
it is possible ,
dropdown treat source value as a text
simply bind it with datavaluefield and datatextfield
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
deaditeConnect With a Mentor Commented:
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

Open in new window

0
 
billium99Author Commented:
Hi - both solutions work - the second one is a slightly better fit for this project.

Thanks for the help guys!
0
 
Jeffrey CoachmanMIS LiasonCommented:
billium99,

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

JeffCoachman
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.