Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Combo List Sorting?

Combo List Sorting?

Combo List Sorting?

Hey all,
  I'm working in VFP 3.0, and haveing an issue with sorting

I have a combo box on a form, and trying to sort the list.
I've tried setting the sort properite to 'true' but FoxPro will not let me. (always goes back to False) and I've tried
adding code (thisForm.Combo2.Sort = .T.) but that doesn't seem to work either...

does anyone have any ideas? =)

---===///The PogoWolf\\\===---
Darkness..Bleakness..Plastic forks..?


RE: Combo List Sorting?

Sort only works if the row source type is set to value or you are manually adding the rows.  If you are binding to a cursor, array or sql statement they must be sorted in the order you want rather than using the sort property.

RE: Combo List Sorting?

Well, that explains why it's not working.... =)
  I think the data is bound via the cursor (I just created the combobox, clicked the 'builder' and made the connection that way)

Could you please, explain how I might be able to sort this?

Thank you!

---===///The PogoWolf\\\===---
Darkness..Bleakness..Plastic forks..?


RE: Combo List Sorting?

if you are using the foxpro tables the easiest way IMHO is to set the rowsourcetype to sql statement, and in the rowsource put a sql statement like the following

select code from mytable order by code into cursor curcodes

you need the into cursor part to prevent the select statement from opening a browse window (the default)  

if you are using views I usually select the rowsourcetype of alias and then create a view the selects the fields I need in the correct order.

RE: Combo List Sorting?

You most likely have the combo box rowsource property set to an array, table or other source.(rowsourcetype is related too). If this is the case, you can't set the sorted property.. Hope this was of help

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close