Form doesn't sort records per the underlying query

  • Thread starter John S. Ford, MD
  • Start date
D

Dirk Goldgar

John S. Ford said:
When I click "About Microsoft Access" I get: Microsoft Access 2000
(9.0.3821 SR-1)

I don't think you have applied all service packs, so you may want to visit
Office Update and do that. However, you have appplied the most important
one (SR1), and I don't have any reason to believe any later service packs
would affect the issue you're experiencing.
the WHERE statement is quite complex and uses aggregate functions. Could
the use of aggregate functions in a WHERE statement do "more" than just
filter the query its acting on?

I don't believe so. I would be very surprised if the complexity of the
where-condition had any effect on the form's sort sequence. On the other
hand, I don't yet understand what accounts for the behavior you report, so I
won't make an absolute statement.
 
D

Dirk Goldgar

John S. Ford said:
I did BOTH of those things (actually the property sheet shows my OrderBy
property is blank). I did put the line of code in my OnOpen event but
that didn't fix the problem.


That perplexes me, and I'll have to do some experimenting to see if I can
reproduce your problem. There's always the possibility that yuor form is
corrupted in some way, but I think that is much less llikely than that just
haven't yet hit on the cause of the behavior.
 
F

Fred

I'm not in the same expertise league as these other guys but here's something
to try that that only takes 30 seconds and is a good thing to do anyway.
Open the query in design view and in it's properties (not the SQL or grid)
make sure the "order by" property is empty.
 
M

Marshall Barton

When I click "About Microsoft Access" I get: Microsoft Access 2000
(9.0.3821 SR-1)
It seems like the WHERE argument disables the query's inherent sort routine.
I'm surprised that the WHERE argument can do this but let me ask you one
question.

the WHERE statement is quite complex and uses aggregate functions. Could
the use of aggregate functions in a WHERE statement do "more" than just
filter the query its acting on?


PMFJI, but I am concerned that you do not have a clear
picture of the query. You said,:
"the WHERE statement is quite complex
and uses aggregate functions",
BUT, AFAIK, a WHERE clause can not contain aggregate
functions. That is the province of the HAVING clause.
Getting mixed up on which is which can cause the query to
produce an unexpected result.

I don't see how any of this can affect the sorting though.
 
D

Dirk Goldgar

Fred said:
I'm not in the same expertise league as these other guys but here's
something
to try that that only takes 30 seconds and is a good thing to do anyway.
Open the query in design view and in it's properties (not the SQL or grid)
make sure the "order by" property is empty.


I would certainly recommend doing this, even though I can't (so far)
reproduce any effect on the form of the query's Order By property. Still,
I'm using Access 2003, not 2000, so there could be a difference between my
system and Dr. Ford's.
 
D

Dirk Goldgar

Marshall Barton said:
PMFJI, but I am concerned that you do not have a clear
picture of the query. You said,:
"the WHERE statement is quite complex
and uses aggregate functions",
BUT, AFAIK, a WHERE clause can not contain aggregate
functions. That is the province of the HAVING clause.
Getting mixed up on which is which can cause the query to
produce an unexpected result.


I assumed he meant *domain* aggregate functions, such as DLookup -- although
I could conceive of having an aggregate subquery.
 
J

John S. Ford, MD

Dear Fred,

I tried that. Both the filter and order by properties are blank.

John
 

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

Similar Threads


Top