If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
how do i set access to use fractions and add/multiply them?
I need to use fractions in a Access Form to calculate sq foot and other board
dimentions. can't find anything in the help file or settings. I need to ba able to add, multiply and divide them. |
#2
|
|||
|
|||
how do i set access to use fractions and add/multiply them?
There's no way built into Access.
I suppose it might be possible to create functions that look at the character value of the fractions (for example, ¼ has an Ascii value of 188, ½ has a value of 189 and ¾ has a value of 190) and translates them to the appropriate value, but that's very limited. How were you intended to get the fractions into Access? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "KevinKBM" wrote in message news I need to use fractions in a Access Form to calculate sq foot and other board dimentions. can't find anything in the help file or settings. I need to ba able to add, multiply and divide them. |
#3
|
|||
|
|||
how do i set access to use fractions and add/multiply them?
It's for a order form for doors my company produces. all measurments are in
inches. if i knew more about VBA i'm certin a bit of code could solve this issue but programming in VBA escapes me and this is due end of week. Thanks for your reply "Douglas J. Steele" wrote: There's no way built into Access. I suppose it might be possible to create functions that look at the character value of the fractions (for example, ¼ has an Ascii value of 188, ½ has a value of 189 and ¾ has a value of 190) and translates them to the appropriate value, but that's very limited. How were you intended to get the fractions into Access? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "KevinKBM" wrote in message news I need to use fractions in a Access Form to calculate sq foot and other board dimentions. can't find anything in the help file or settings. I need to ba able to add, multiply and divide them. |
#4
|
|||
|
|||
how do i set access to use fractions and add/multiply them?
Here is something I found on the internet by googling "convert decimal to
fraction in VB" I played with it and it is okay for even things .125 returns 1/18, etc, but for 1/3 I tried .67, .667, etc. and got useless results. I tried doing 1/3 in VBA and passing it the number results from that and it went away. I got tired of waiting and canceled it. -- Dave Hargis, Microsoft Access MVP "KevinKBM" wrote: It's for a order form for doors my company produces. all measurments are in inches. if i knew more about VBA i'm certin a bit of code could solve this issue but programming in VBA escapes me and this is due end of week. Thanks for your reply "Douglas J. Steele" wrote: There's no way built into Access. I suppose it might be possible to create functions that look at the character value of the fractions (for example, ¼ has an Ascii value of 188, ½ has a value of 189 and ¾ has a value of 190) and translates them to the appropriate value, but that's very limited. How were you intended to get the fractions into Access? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "KevinKBM" wrote in message news I need to use fractions in a Access Form to calculate sq foot and other board dimentions. can't find anything in the help file or settings. I need to ba able to add, multiply and divide them. |
#5
|
|||
|
|||
how do i set access to use fractions and add/multiply them?
TblFractionPart
FractionPartID FractionPart DecimalOfFractionPart TblFractionMeasurement FractionMeasurementID FractionPartID FractionMeasurement TblFractionPart would contain: 1, "/2",.5 2, "/4", .25 3, "/8", .125 4, "/16", .1667 TblFractionMeasurement would contain: 1, 1, 1 2, 2, 1 3, 2, 2 4, 2, 3 5, 3, 1 6, 3, 2 7, 3, 3 8, 3, 4 9, 3, 5 etc to -- 26, 4, 15 On your form where you need to enter a dimension, you need a textbox named wholeinches for entering the whole inches, a combobox named fractionpart for picking the fraction part, a combobox named fractionmeasurement for picking the numerator of the fraction, i.e. 15 for 15/16", a textbox named MyMeasurement to display the measurement and a hidden textbox named myMeasurementValue to contain the value of the measurement. Note combobox, fraction part, needs to be based on TblFractionpart and contain all the fields. I have left it to you to set up the comboboxes. You then need to put the following in the control source of MyMeasurement: =[WholeInches] & " " & [FractionMeasurement].Column(2) & [FractionPart].Column(1) You then need to put the following in the control source of MyMeasurementValue: = [WholeInches] + [FractionMeasurement].Column(2) * [FractionPart].Column(2) PC Datasheet Providing Customers A Resource For Help With Access, Excel And Word Applications "KevinKBM" wrote in message news I need to use fractions in a Access Form to calculate sq foot and other board dimentions. can't find anything in the help file or settings. I need to ba able to add, multiply and divide them. |
#6
|
|||
|
|||
how do i set access to use fractions and add/multiply them?
Thanks Steve this will realy help a lot.
Is there a way to set this as a query? i'm going to have to have about 25 lines on the form and to do this that many times will be a ton of typing. so if there is a wayto do it as multiple rows if not then no problem. and thanks again for the help "Steve" wrote: TblFractionPart FractionPartID FractionPart DecimalOfFractionPart TblFractionMeasurement FractionMeasurementID FractionPartID FractionMeasurement TblFractionPart would contain: 1, "/2",.5 2, "/4", .25 3, "/8", .125 4, "/16", .1667 TblFractionMeasurement would contain: 1, 1, 1 2, 2, 1 3, 2, 2 4, 2, 3 5, 3, 1 6, 3, 2 7, 3, 3 8, 3, 4 9, 3, 5 etc to -- 26, 4, 15 On your form where you need to enter a dimension, you need a textbox named wholeinches for entering the whole inches, a combobox named fractionpart for picking the fraction part, a combobox named fractionmeasurement for picking the numerator of the fraction, i.e. 15 for 15/16", a textbox named MyMeasurement to display the measurement and a hidden textbox named myMeasurementValue to contain the value of the measurement. Note combobox, fraction part, needs to be based on TblFractionpart and contain all the fields. I have left it to you to set up the comboboxes. You then need to put the following in the control source of MyMeasurement: =[WholeInches] & " " & [FractionMeasurement].Column(2) & [FractionPart].Column(1) You then need to put the following in the control source of MyMeasurementValue: = [WholeInches] + [FractionMeasurement].Column(2) * [FractionPart].Column(2) PC Datasheet Providing Customers A Resource For Help With Access, Excel And Word Applications "KevinKBM" wrote in message news I need to use fractions in a Access Form to calculate sq foot and other board dimentions. can't find anything in the help file or settings. I need to ba able to add, multiply and divide them. |
#7
|
|||
|
|||
how do i set access to use fractions and add/multiply them?
Try this in the Lost Focus or AfterUpdate property of the textbox (Text0)
where the fraction is entered: slash = InStr(Me.Text0, "/") Me.Text3 = Left(Me.Text0, slash - 1) / Right(Me.Text0, Len(Me.Text0) - slash) You can change Me.Text3 to a variable or a field in a table if you want to store it KevinKBM wrote: I need to use fractions in a Access Form to calculate sq foot and other board dimentions. can't find anything in the help file or settings. I need to ba able to add, multiply and divide them. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200706/1 |
#8
|
|||
|
|||
how do i set access to use fractions and add/multiply them?
BTW, the above converts ANY fraction to a decimal.
jahoobob wrote: Try this in the Lost Focus or AfterUpdate property of the textbox (Text0) where the fraction is entered: slash = InStr(Me.Text0, "/") Me.Text3 = Left(Me.Text0, slash - 1) / Right(Me.Text0, Len(Me.Text0) - slash) You can change Me.Text3 to a variable or a field in a table if you want to store it I need to use fractions in a Access Form to calculate sq foot and other board dimentions. can't find anything in the help file or settings. I need to ba able to add, multiply and divide them. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200706/1 |
#10
|
|||
|
|||
how do i set access to use fractions and add/multiply them?
On Thu, 28 Jun 2007 13:19:11 GMT, "jahoobob via AccessMonster.com"
u12179@uwe wrote: BTW, the above converts ANY fraction to a decimal. but won't work with the very common syntax "8 3/4" - it will convert a pure fraction OK, but if it's got a prior integer number you'll need to extract just the fraction. John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|