T
Tony Colson via AccessMonster.com
Hello All,
I have a rather large Access application that used to work completely before
I installed Visual Studio .Net (maybe that means something)?
Prior to installing VS .Net my code would appropriately break when I tried
indexing into a Collection by key if there was no object in the Collection
with that key.
For example the following scenario previously would work fine:
Public Sub testcollection()
Dim c1 As New collection, c2 As New collection
Const NAME = "sss"
c1.Add c2, NAME
Set c2 = Nothing
On Error GoTo NO_OBJ:
Set c2 = c1.item(NAME) ' This line works
Set c2 = c1.item("qqq") ' Code Breaks here; should go to NO_OBJ:
Exit Sub
NO_OBJ:
Debug.Print "No Object"
End Sub
This code snipet now fails when I try to run it.
I suspect someting along the lines of:
1) A VS .Net .dll containing Microsoft.VisualBasic.Collection is
interfering with the VBA.Collection
2) VS.Net overwrote a dll containing a dependency of VBA.Collection
But, I haven't had any luck with these approaches, yet.
Are there any other ideas on this topic?
I have a rather large Access application that used to work completely before
I installed Visual Studio .Net (maybe that means something)?
Prior to installing VS .Net my code would appropriately break when I tried
indexing into a Collection by key if there was no object in the Collection
with that key.
For example the following scenario previously would work fine:
Public Sub testcollection()
Dim c1 As New collection, c2 As New collection
Const NAME = "sss"
c1.Add c2, NAME
Set c2 = Nothing
On Error GoTo NO_OBJ:
Set c2 = c1.item(NAME) ' This line works
Set c2 = c1.item("qqq") ' Code Breaks here; should go to NO_OBJ:
Exit Sub
NO_OBJ:
Debug.Print "No Object"
End Sub
This code snipet now fails when I try to run it.
I suspect someting along the lines of:
1) A VS .Net .dll containing Microsoft.VisualBasic.Collection is
interfering with the VBA.Collection
2) VS.Net overwrote a dll containing a dependency of VBA.Collection
But, I haven't had any luck with these approaches, yet.
Are there any other ideas on this topic?