Problem sorting form

O

Optimo

I linked a form with a recordset in this way:
Dim strSQL As String
Dim rstAddresses As ADODB.Recordset
Set rstAddresses = New ADODB.Recordset
rstAddresses .CursorLocation = adUseClient
strSQL = "SELECT ... FROM ..."
rstAddresses .Open Source:=strSQL,CurrentProject.Connection, adOpenStatic,
adLockOptimistic
Set Forms("frmAddresses").Recordset = rstAddresses

This works perfectly until I choose to sort the form on one of the fields
(Form View/Sort Ascending or Descending):
The form is sorted alright, but the original link between the form and the
recordset is lost: I can't browse trough the records anymore via the form (it
looks like they are browsed in the background but it is not shown in the
form).

How to resolve this problem?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top