I have an Access 2007 database. It uses SharePoint 2010 linked lists as the tables. I have multiple forms that keep getting an error number "0". I get this error in these scenarios:
click in a comboBox, that uses a SharePoint list as its source, then type text that is not on the list. (the "limit to list" property must be true). If this property is false, then I don't get the error and everything works fine, but this must be set to true for this specific database.
lose connection to SharePoint, then click on an object (comboBox etc) that uses a SharePoint list as its source. There is code in an "Got_Focus" sub that pulls data from the list.
If I catch error number 0 and take care of that, immediately after, the real description displays. For instance, in the first scenario after catching 0 the error "item not on list" box will show, which is a real error (2237) and the second a "can't find record source" box will show, error 2580. However, I can't catch those errors, and if I put in a message box to display the error number after catching error 0, it never displays/or activates.
It seems I get the error 0 consistently when the "Limit to list" property is set to true. I've tried to do "On_Load" sub set Limit to List to true, and "On_close" set to false, however this causes an error can't find object on the "On_Close()" sub. Here is a sample:
Private Sub Got_Focus()
On Error GoTo catchError
Me.Requery \\This could be any code that "pings" the SharePoint List
exit_catchError:
Exit Sub
catchError:
If Err.Number = 0 Then Resume Next \\i'v tried with and without this. Gives error 20 with
\\ Also tried If Then with Err.Number = 0
If Err.Number = 2580 Then \\Doesn't catch
MsgBox "Reconnect to SharePoint"
ElseIf Err.Number = 2237 Then \\Doesn't catch
MsgBox "Text not on List"
Else
MsgBox Err.Number & " " & Err.Description
End If
End Sub