sorting question 
Author Message
 sorting question

I have a dbgrid and a data object which are connected to a db and of course
I use them to show a certain table
now the problem is that my table is nicely sorted by a certain row in access
and I save it that way but in my app its unsorted

please help



Mon, 06 Oct 2003 00:53:22 GMT  
 sorting question

Quote:

> I have a dbgrid and a data object which are connected to a db and of course
> I use them to show a certain table
> now the problem is that my table is nicely sorted by a certain row in access
> and I save it that way but in my app its unsorted

Is the grid bound to a Data control? How is it set up? You'll get the
rows in an arbitrary order unless you use a query instead of just a
table name, perhaps like so:

data1.sql = "select mytable.* from mytable where " _
  & iif(isdate(text1.text), " mytable.hiredate >= cdate('" _
    & text1.text & "') and ", vbnullstring) _
  & iif(isnumeric(text2.text), " mytable.salary >= ccur('" _
    & text2.text & "') and ", vbnullstring) _
  & iif(isnumeric(text3.text), " mytable.salary <= ccur('" _
    & text3.text & "') and ", vbnullstring) _
  & " keepsecret = false order by mytable.field1, mytable.field2 desc"
data1.refresh

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Tue, 07 Oct 2003 13:51:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Sort question on two fields

2. Excel sort question.

3. Outlook Group/Sort Question.

4. Collection sorting question

5. Sorting Question

6. sql sort question

7. Index and sorting question, help! :)

8. ACCESS Sorting question...

9. sorting question

10. List View Sort Question

11. Bubble sort question

12. MSFlexGrid Control - Sorting Question

 

 
Powered by phpBB® Forum Software