VBA string value Truncates and reads (???.????ú ? ???????.?.?y????ú ???? )

sri123

New member
Local time
Today, 08:18
Joined
Dec 2, 2014
Messages
6
Here is the Scenario:
I have table with Column Name "Notes", one of these Notes record has below value
qqwerrrrrrqreqwerewrqewreqwrewrewioruioqweuroiuweo ruoweiquriuqweoruoweiuriouqweoriqwerrrrrrqreqwerew rqewreqwrewrewioruioqweuroiuweoruoweiquriuqweoruow eiuriouqweoriqwerrrrrrqreqwerewrqewreqwrewrewiorui oqweuroiuweoruoweiquriuqweoruoweiuriouqweoriwerrrr rrqreqwerewrqewreqwrewrewioruioqweuroiuweoruoweiqu riuqweoruoweiuriouqweori

I am trying to pull this value from table and trying to append for all records.

Set db = CurrentDb()

Set rs = db.OpenRecordset("qrySummaryNotes")
rs.Filter = "[tabName] = 'General'"
Set rsNew = rs.OpenRecordset
'dbNotes = rs.Fields("totalNotes")
If rsNew.RecordCount > 0 Then

If Not (rsNew.EOF And rsNew.BOF) Then

rsNew.MoveFirst

Do Until rsNew.EOF = True

dbNotes = rsNew.Fields("totalNotes")
strNotes = strNotes & vbCrLf & vbCrLf & dbNotes

rsNew.MoveNext

Loop
End If

Now the strNotes is reading half value correct: Please see below, why am I seeing these strange ?????

qqwerrrrrrqreqwerewrqewreqwrewrewioruioqweuroiuweo ruoweiquriuqweoruoweiuriouqweoriqwerrrrrrqreqwerew rqewreqwrewrewioruioqweuroiuweoruoweiquriuqweoruow eiuriouqweoriqwerrrrrrqreqwerewrqewreqwrewrewiorui oqweuroiuweo  ???.????ú ? ???????.?.?y????ú ????
?? ?.???.?Ñ?  
? ???????.???y????????
?y?.????????????? ???​
 
I'm actually surprised you got a field of that length to work. The magic number for a lot of things in Access is 255. As a general rule of thumb, you cannot have more than 255 characters per field. Maybe that's why the code is erroring out. However, that's entirely a guess as I haven't tested any of it.
 
Well, I don't think so, it should accept more than 255.. I have tested in many scenarios.. 65k
 

Users who are viewing this thread

Back
Top Bottom