when I am trying to declare some strings in my code it would appear the access doesnt seem to like my last declared string. I have to add a unused string at the end before it will move on. This only seems to happen if I set the last string to nothing.
heres a basic module for you to replicate:
Public Function test()
Dim test1, test2 As String
Set test1 = Nothing
Set test2 = Nothing
End Function
if you try step through this is will compain about the string "test2". Error message: Compile error. object required.
now if you change the code to:
Public Function test()
Dim test1, test2, test3 As String
Set test1 = Nothing
Set test2 = Nothing
End Function
it will then continue to work (as long as you never then try use test3)
anyone any ideas why this is doing this? I am running Access 2010 x64(office 2010 pro) or I am going about clearing the strings the wrong way.
Regards,
Michael
heres a basic module for you to replicate:
Public Function test()
Dim test1, test2 As String
Set test1 = Nothing
Set test2 = Nothing
End Function
if you try step through this is will compain about the string "test2". Error message: Compile error. object required.
now if you change the code to:
Public Function test()
Dim test1, test2, test3 As String
Set test1 = Nothing
Set test2 = Nothing
End Function
it will then continue to work (as long as you never then try use test3)
anyone any ideas why this is doing this? I am running Access 2010 x64(office 2010 pro) or I am going about clearing the strings the wrong way.
Regards,
Michael