View Single Post
  #20  
Old April 8th, 2009, 05:40 PM posted to microsoft.public.access,microsoft.public.access.forms,microsoft.public.access.formscoding
John S. Ford, MD
external usenet poster
 
Posts: 215
Default Form doesn't sort records per the underlying query

Dear Dirk,

I'm almost certain it's the strFinalWHERE that's doing it (and not anything
sitting in the OpenArgs argument) of the DoCmd.OpenForm statement from the
calling form.

DoCmd.OpenForm "frmAdmissionEntryForm", , , strFinalWHERE
gives me unsorted records (though filtered).

DoCmd.OpenForm "frmAdmissionEntryForm"
gives me SORTED records (though unfiltered).

Somewhere the WHERE argument is sabotaging my underlying query's ORDER BY
clause. In both of these statements, the OpenArgs argument is left out.

John

"Dirk Goldgar" wrote in message
...
"John S. Ford, MD" wrote in message
...

I changed the DoCmd.OpenForm to simply open it without the strFinalWHERE
and the OpenArgs argument:

DoCmd.OpenForm "frmAdmissionEntryForm"

and commented out the code using the OpenArgs argument in
frmAdmissionEntryForm.

When I do this, the form's records ARE sorted correctly (but obviously
not filtered). So it appears to be something related to the
DoCmd.OpenForm code I'm using.



I suspect that it's something in the code you commented out, that is
processing the OpenArgs argument. Please post that code.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)