I'm trying to return a value that is part of my original number. It's returning the first value just like I want but every value after that is returning the first value again. I'm guessing that I don't have the record moving to the second record which I thought would happen with my movenext statement. As you can tell I'm not great at this yet and have wrote this code in DAO but was hoping somebody might be able to give me a jumpstart.
Function Test(x) As Double
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("ITEM", , dbForwardOnly)
Set x = rst("ISBN1"
rst.MoveFirst
Do Until rst.EOF
If (Left([x], 3)) = "978" Then
i = (Mid([x], 5, 6))
Test = x
Else
rst.MoveNext
End If
Loop
End Function
Thanks in advance
Brad
Function Test(x) As Double
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("ITEM", , dbForwardOnly)
Set x = rst("ISBN1"
rst.MoveFirst
Do Until rst.EOF
If (Left([x], 3)) = "978" Then
i = (Mid([x], 5, 6))
Test = x
Else
rst.MoveNext
End If
Loop
End Function
Thanks in advance
Brad