I've been trying to set up a vanilla Function for navigating between cross-referenced records - fired on a TextBox Click Event (error handling excluded):<pre>Public Function GoToXRef(strSourceTable As String, strDataField As String)
Dim cnn As ADODB.Connection
Dim rstSnap As New ADODB.Recordset
Dim lngPosition As Long
Set cnn = CurrentProject.Connection
rstSnap.Open strSourceTable, cnn, adOpenStatic
rstSnap.Find strDataField & "=" & Screen.ActiveControl.Value
lngPosition = rstSnap.AbsolutePosition
DoCmd.GoToRecord , , acGoTo, lngPosition
Set cnn = Nothing
End Function</pre>
The record navigation appears to work OK, but... Using <code>Application.Run GoToXRef("tblSomething", "FieldID")</code> produces Error Code 2517: ...Database can't find the procedure'.'. Wrapping it Event Procedure in <code>Dim appAccess as Access.Application</code> produces (eventually) Error Code 7952: You made an illegal function call. Would it be sensible to sweep away these Errors with Error Handling - or is there a better way?



