-
Check This coding
My check1 recordset contains no1 field with 11/2, 5/3, 4, 6
So this coding converts them to decimal by dividing 11/2 etc.
But this is done when the datas are in fraction form but not with others.
(ie) it converting only 11/2 and 5/3 but not 4 and 6.
Pls help me in converting them also.
Private Sub Command1_Click()
rs.Open "check1", db, 3, 2
Do While Not rs.EOF
Set lvwItem = ListView1.ListItems.Add(, , rs.Fields.Item(0).Value)
rs.MoveNext
Loop
rs.Close
For i = 1 To ListView1.ListItems.Count
Set item1 = ListView1.ListItems(i)
a = Left([item1], InStr([item1], "/") - 1)
b = Right([item1], Len([item1]) - InStr([item1], "/"))
c = IIf([b] = [item1], [item1], ([a] / [b]))
MsgBox c
Next
End Sub
-
Re: Check This coding
Something like this?
Code:
For i = 1 To listview1.listitems.Count
'determine existence of /
If InStr(listview1.listitems(i), "/") > 0 Then
'convert
End If
Next