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
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