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.IsBroke n Then
References.Remo ve 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.Coun t To 1 Step -1
Set refCurr = References(intC ount)
If refCurr.IsBroke n Then
References.Remo ve 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.Coun t To 1 Step -1
Set refCurr = References(intC ount)
If Not refCurr.BuiltIn Then
If refCurr.IsBroke n Then
References.Remo ve 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.Referenc e
Dim intCount As Integer
For intCount = Access.Referenc es.Count To 1 Step -1
Set refCurr = Access.Referenc es(intCount)
If Not refCurr.BuiltIn Then
If refCurr.IsBroke n Then
Access.Referenc es.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.******@HCCne t.nl> wrote in message
news:43******** *************@r eader1.nntp.hcc net.nl...
Dear reader,
For removing a reference in the VBA reference form I receive from Doug
Steele the following code:
..........
References.Remo ve 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