Seeing the whole of the code would be more useful as in the snippet you show
it would appear that refCurr is a variable, we really need to know the code
around that line.
If you are doing something like this for example
Dim refCurr As Reference
For Each refCurr In References
If refCurr.IsBroken Then
References.Remove refCurr
End If
Next
Then this will fail (if you do have Missing references)
This on the other hand should succeed
Dim refCurr As Reference
Dim intX As Integer
For intX = References.Count To 1 Step -1
Set refCurr = References(intCount)
If refCurr.IsBroken Then
References.Remove refCurr
End If
Next
.... unless the Missing reference is an inbuilt one, but the code could be
changed to
Dim refCurr As Reference
Dim intCount As Integer
For intCount = References.Count To 1 Step -1
Set refCurr = References(intCount)
If Not refCurr.BuiltIn Then
If refCurr.IsBroken Then
References.Remove refCurr
End If
End If
Next
and then you really must disambiguate when checking references in case one
of them is broken so the code should really be.
Dim refCurr As Access.Reference
Dim intCount As Integer
For intCount = Access.References.Count To 1 Step -1
Set refCurr = Access.References(intCount)
If Not refCurr.BuiltIn Then
If refCurr.IsBroken Then
Access.References.Remove refCurr
End If
End If
Next
Now do you see why the surrounding code is important ?
--
Terry Kreft
MVP Microsoft Access
"S. van Beek" <S.******@HCCnet.nl> wrote in message
news:43*********************@reader1.nntp.hccnet.n l...
Dear reader,
For removing a reference in the VBA reference form I receive from Doug
Steele the following code:
..........
References.Remove refCurr
..........
By running this code the following error occur:
Error no. 17
Error description: Can't perform requested operation
The question is how can I unable the tick box (remove tick form tick box)
in the VBA references form for the missing (broken) references.
Thanks for any help.
Kind regards,
Simon van Beek