ph*******@gmail.com wrote:
Is there a reason why i keep getting this run time error, i never
gotten it before. Can someone help me out with this? here is my code:
With rstout
'first check if not on EOF
If Not (rstin.EOF) Then
rstin.MoveFirst
'loop through all the records rstIN (table tblPhongParseIN)
Do While Not rstin.EOF
'set strField1 to tblPhongParseIN Field1
strField1 = rstin("ID")
cutstring = Left([strField1], InStr([strField1], " ") -
1)<------This is where i get the error.
strfield4 = rstin("amt_issued")
THank you.
Phong,
When I try MsgBox (Left("My Text", -1)), I get error message 5. That
seems to suggest that " " is not being found in [strField1] causing a
-1 to show up in the Length argument. Also, assuming strField1 is
declared to be a string, there shouldn't be any square brackets around
it. Maybe Access is looking for Me.strField1 because of the square
brackets. Anyway, MsgBox("*" & strField1 & "*") to see if it contains
a blank or not. I also don't see why you need to require a " " in an
'ID' field. Perhaps use an If..Then..Else on whether or not
InStr(strField1, " ") = 0.
James A. Fortune