I've got an Access application which is behaving rather strange. It has trouble handling strings correctly in VBA at random places.
For example:
When stepping through the code it leaves out the bold part " AS ID, ". But when I add an extra space somewhere in that line, than it behaves correctly.
Similar problems in other parts of the application too. I've already tried decompiling etc, to clean things up. I even made a new mdb and imported all objects and code, but no effect.
Has someone every seen anything like this too? I cannot imagine being the first to have this problem.
Another example would be:
Here it leaved out the entire first line. When stepping through the code the string would still be empty after executing only the first line. But again, by adding a space somewhere inside the string, it would work again.
This is Access 2003 SP3, VBA6.3.
For example:
Code:
strSQL = "SELECT " & strOmschrijving & " AS Omschrijving, CStr(V.Jaar) + ' ' + Format(V." & strPeriode
strSQL = strSQL & ",'00') AS Bereik1, " & CStr(intNiveau) & " AS Niveau, " & strID & [B][U]" AS ID, "[/U][/B]
strSQL = strSQL & CStr(GeefMaxSortering + 1) & " + (3000-V.Jaar)*10000 - V." & strPeriode & " AS Sortering, " & vbNewLine
When stepping through the code it leaves out the bold part " AS ID, ". But when I add an extra space somewhere in that line, than it behaves correctly.
Similar problems in other parts of the application too. I've already tried decompiling etc, to clean things up. I even made a new mdb and imported all objects and code, but no effect.
Has someone every seen anything like this too? I cannot imagine being the first to have this problem.
Another example would be:
Code:
strSQL = [B][U]"SELECT B.SorteerCentrumID, B.PeriodeID, PER.Jaar, PER.Week, PER.Tijdvak, B.Datum, B.ProcesCode, "[/U][/B]
strSQL = strSQL & "Sum(Nz(B.WaardeOchtend,0)) AS WaardeOchtend, Sum(Nz(B.WaardeMiddag,0)) AS WaardeMiddag, " & vbNewLine
strSQL = strSQL & "Sum(Nz(B.WaardeAvond,0)) AS WaardeAvond, Sum(Nz(B.WaardeNacht,0)) AS WaardeNacht, "
strSQL = strSQL & IIf(blnIsSorteerdag, "Sum(Nz(B.WaardeNachtVolgend,0)) AS WaardeNachtVolgend ", "NULL AS WaardeNachtVolgend ")
Here it leaved out the entire first line. When stepping through the code the string would still be empty after executing only the first line. But again, by adding a space somewhere inside the string, it would work again.
This is Access 2003 SP3, VBA6.3.