How to perform Seek on Linked Tables<br>
(Q) Can I perform Seek and Index on linked tables?<br>
(A) Directly, No. But you can use the following function which will allow you to do this.<br>
(watch out for line wraps. It's just a single line of code.)<br>
'************ Code Start ***************<br>
'This code was originally written by Michel Walsh.<br>
'It is not to be altered or distributed,<br>
'except as part of an application.<br>
'You are free to use it in any application,<br>
'provided the copyright notice is left unchanged.<br>
'<br>
'Code Courtesy of<br>
'Michel Walsh<br>
<br>
Public Function OpenForSeek(TableName As String) As Recordset<br>
' Assume MS-ACCESS table<br>
Set OpenForSeek = DBEngine.Workspaces(0).OpenDatabase _<br>
(Mid(CurrentDb().TableDefs(TableName).Connect, _<br>
11), False, False, ""
.OpenRecordset(TableName, _<br>
dbOpenTable)<br>
End Function<br>
'************ Code End ***************<br>
Just use:<br>
Dim rst as Recordset<br>
set rst=OpenFormSeek("TableName"
<br>
and you can use rst.Seek and rst.Index on linked table TableName<br>
<br>
<p>Bill Paton<br><a href=mailto:wpaton@neptune400.co.uk>wpaton@neptune400.co.uk</a><br><a href=
(Q) Can I perform Seek and Index on linked tables?<br>
(A) Directly, No. But you can use the following function which will allow you to do this.<br>
(watch out for line wraps. It's just a single line of code.)<br>
'************ Code Start ***************<br>
'This code was originally written by Michel Walsh.<br>
'It is not to be altered or distributed,<br>
'except as part of an application.<br>
'You are free to use it in any application,<br>
'provided the copyright notice is left unchanged.<br>
'<br>
'Code Courtesy of<br>
'Michel Walsh<br>
<br>
Public Function OpenForSeek(TableName As String) As Recordset<br>
' Assume MS-ACCESS table<br>
Set OpenForSeek = DBEngine.Workspaces(0).OpenDatabase _<br>
(Mid(CurrentDb().TableDefs(TableName).Connect, _<br>
11), False, False, ""
dbOpenTable)<br>
End Function<br>
'************ Code End ***************<br>
Just use:<br>
Dim rst as Recordset<br>
set rst=OpenFormSeek("TableName"
and you can use rst.Seek and rst.Index on linked table TableName<br>
<br>
<p>Bill Paton<br><a href=mailto:wpaton@neptune400.co.uk>wpaton@neptune400.co.uk</a><br><a href=