this SOMETIMES crashes, but in one build allways...
dim lcItem$
lcItem = Replace(lcItem, Chr(0), "")
-----
lcItem = Replace(lcItem, Chr$(0), "")...and this NOT
this SOMETIMES crashes, but in one build allways...
dim lcItem$
lcItem = Replace(lcItem, Chr(0), "")
-----
lcItem = Replace(lcItem, Chr$(0), "")...and this NOT
What exactly are you trying to accomplish with your code. It does not look too useful to me; unless you are trying to crash Access. Your Dim statement will create a Variant variable and not a String, in case you didn't know that. The $ means very little in VBA.
Hi, OK, may be...
Dim lcItem As String ' NOT lcItem$
lcItem = Replace(lcItem, vbNullChar, vbNullString) ' OK
-------------------------
i am removing vbNullChar from my string
But such 'lcItem$' i have EVERYWHERE in my code![]()
I have Crash problems now
OK, i replace all suffixes ('$' ,...) with explicit declaration (as string ,..)
String variables are initialized to a ZLS (ZeroLengthString) and if I remember correctly, Nulls are not allowed in Strings in VBA.
I looks like I will have to apologize for the misleading info I gave you. Apparently the VB Type Declaration Characters are alive and well within VBA just not used very much. I'm still wondering why you follow a Dim statement with a Replace() function.
I'm still wondering why you follow a Dim statement with a Replace() function. ...
I have posted NOT full code, only Error relevant part...