F
Fincastle
The form "Open Names" is unbound
It contains a listbox I want to populate with all lastnames starting with A
The letter A is sent to the function below.
When the Listbox is popluated is the filtering taking place on the SQL
server and it is only sending the "A"s to the client OR
is the entire table coming to the client to be filtered?
If it is happening on the client then if I write a spNamesA, spNameB,
spNamesC etc. how to feed it to the listbox.
Thanks
Private Function OpenSearch(Letter As String)
On Error GoTo Err_Command397_Click
Dim SQLSource As String
SQLSource = "SELECT TblNames.LastName, TblNames.FirstName, TblNames.SSN FROM
TblNames WHERE TblNames.LastName LIKE N'" & Letter & "%' ORDER BY
TblNames.LastName, TblNames.FirstName;"
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Open "
DoCmd.OpenForm stDocName, , , stLinkCriteria
[Form_Open ].List5.RowSource = SQLSource
Exit_Command397_Click:
Exit Function
Err_Command397_Click:
MsgBox Err.Description
Resume Exit_Command397_Click
End Function
It contains a listbox I want to populate with all lastnames starting with A
The letter A is sent to the function below.
When the Listbox is popluated is the filtering taking place on the SQL
server and it is only sending the "A"s to the client OR
is the entire table coming to the client to be filtered?
If it is happening on the client then if I write a spNamesA, spNameB,
spNamesC etc. how to feed it to the listbox.
Thanks
Private Function OpenSearch(Letter As String)
On Error GoTo Err_Command397_Click
Dim SQLSource As String
SQLSource = "SELECT TblNames.LastName, TblNames.FirstName, TblNames.SSN FROM
TblNames WHERE TblNames.LastName LIKE N'" & Letter & "%' ORDER BY
TblNames.LastName, TblNames.FirstName;"
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Open "
DoCmd.OpenForm stDocName, , , stLinkCriteria
[Form_Open ].List5.RowSource = SQLSource
Exit_Command397_Click:
Exit Function
Err_Command397_Click:
MsgBox Err.Description
Resume Exit_Command397_Click
End Function