Solved

fractions in drop down menus

Posted on 2007-12-06
6
384 Views
Last Modified: 2010-04-21
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
Comment
Question by:billium99
6 Comments
 
LVL 8

Expert Comment

by:kebabs
ID: 20425571
0
 
LVL 6

Expert Comment

by:divyeshhdoshi
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

by:deadite
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

Open in new window

0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 74

Accepted Solution

by:
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

by:billium99
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

by:Jeffrey Coachman
ID: 20451445
billium99,

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

JeffCoachman
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

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

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

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now