I am encountering a "Run-Time error 3075" with my code. I think I pretty much write the code right, the weird thing is, when I check the value of my variable, it's cut-off/shorten from what was supposed to be the full value of it, but when I tried outputting it in the "immediate window", it shows the full value.
I supposed to get all of this/my immediate window outputs this:
The quick brown fox jumps over the lazy dog.
But my variable only contains this:
The quick brown fox jumps o
The length of the real output that I'm trying to get is 611.
And then after this output, I'll get the "Run-Time Error 3075".
Here's a sample of my code:
Dim rs2 As DAO.Recordset
Set rs2 = CurrentDb.OpenRecordset("Select * FROM 2011_50K_ServiceText", dbOpenDynaset)
If DCount("*", "2011_50K_ServiceText") = 0 Then 'checks if table is empty
Else
rs2.MoveFirst
While rs2.EOF = False
i = i + 1
i2ndSetInterval = Format(i, "00")
s50KServiceText = rs2!Field1
If InStr(s50KServiceText, "See") > 0 Or InStr(s50KServiceText, "See") = 0 Then
If InStr(s50KServiceText, "See") = 0 Then
Else
s50KServiceText = Left(rs2!Field1, InStr(rs2!Field1, "See") - 1)
End If
sT = "50000"
sFrequency = CStr(getFrequencyInterval(sT))
sFrequency = sFrequency & "_" & CStr(i2ndSetInterval)
sLength = Len(s50KServiceText)
Debug.Print (s50KServiceText)
DoCmd.SetWarnings (WarningsOff)
DoCmd.RunSQL "INSERT INTO 2011_VehicleDistanceBased([Vehicle],[Frequency],[Service_Text]) values ('" + LabelVehicle.Caption + "', '" + sFrequency + "', '" + s50KServiceText + "')"
DoCmd.SetWarnings (WarningsOn)
End If
rs2.MoveNext
Wend
i2ndSetInterval = 0 'set it back to default
i = 0
rs2.Close
Set rs2 = Nothing
End If
Does anyone have any idea? It'll be much appreciated. Thank you