|  | 
| Sorting on checkbox columns | 
| Post Reply   | 
| Author | |
| atarba   Newbie   Joined: 12 February 2007 Location: Romania Status: Offline Points: 2 |  Post Options  Thanks(0)  Quote  Reply  Topic: Sorting on checkbox columns Posted: 12 February 2007 at 8:19am | 
| 
   Hi, I'm setting up a report control column to just show checkboxes (for a logical field) but I do not set the value of the item to yes or no because I just want the checkbox in the column. Is there any way to have sorting on this column without setting the value? Thanks, Andrei | |
| 
     Andrei
     | |
|  | |
| jcollier   Senior Member   Joined: 15 February 2006 Status: Offline Points: 250 |  Post Options  Thanks(0)  Quote  Reply  Posted: 12 February 2007 at 3:03pm | 
| 
   Funny this just got asked today.  I also would like to know how to sort on checkbox columns.  The following code checks the box properly but trying to click the column name and sort does not do anything. Set Item = Record.AddItem("") Item.HasCheckbox = True Item.Checked = CBool(!Doc) | |
|  | |
| jcollier   Senior Member   Joined: 15 February 2006 Status: Offline Points: 250 |  Post Options  Thanks(0)  Quote  Reply  Posted: 12 February 2007 at 3:19pm | 
| 
   Ok, I figured it out.  Just add the following line to the code I listed above. Item.SortPriority = IIf(CBool(!Doc), 0, 1) | |
|  | |
| sserge   Moderator Group   Joined: 01 December 2004 Status: Offline Points: 1297 |  Post Options  Thanks(0)  Quote  Reply  Posted: 12 February 2007 at 3:25pm | 
| 
   Yes, you can. However, you'll have to use another property .SortPriority    Like: 
 -- WBR, Serge | |
|  | |
| Post Reply   | |
| Tweet | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |