> I am using the following code to convert fractions to decimals. However, it

> won't convert the number if it is a whole number only. Need help in modification.

If it is a whole number only, then your value will be missing a "/". So, check for y = 0, and if it is, then just use the whole value.

Private Sub Command1_Click()

Dim x As Integer

Dim y As Integer

Dim z As String

Dim a1 As Integer

Dim a2 As Integer

Dim MyNumber As String

DoCmd.GoToControl "Text1"

x = InStr(1, Text1.Text, " ")

y = InStr(x, Text1.Text, "/")

If ( y > 0 ) Then

z = Right$(Text1.Text, Len(Text1.Text) - x)

y = InStr(1, z, "/")

a1 = Val(Left$(z, y - 1))

a2 = Val(Right$(z, Len(z) - y))

MyNumber = Val(Left$(Text1.Text, x - 1)) + a1 / a2

Else

MyNumber = Val(Text1.Text)

End IF

Text1.Text = MyNumber

End Sub

Hope That Helps,

Dex*