[Gambas-user] DataSource Sort Problem

T Lee Davidson t.lee.davidson at gmail.com
Fri Jul 20 17:28:20 CEST 2018


Try setting the DataSource1.Sort field *after* the DataCheckBox1.Field is set (at line 45) instead of at line 30.


-- 
Lee


On 07/20/2018 09:04 AM, Ernest Wilson wrote:
> I have attached a sample project that demonstrates the problem.
> 
> The project I am developing has some additional fields in the table,
> including a boolean field that indicates the tax status of the process
> record (True is taxable, False in not taxable). The boolean field is
> represented on the Form by a DataCheckbox.
> 
> As I was building the test project, I realized that the code in my
> previous email works correctly if the DataCheckbox is removed from the Form.
> 
> Regards,
> Ernest Wilson
> 
> On 07/19/2018 09:39 AM, Benoît Minisini wrote:
>> Le 19/07/2018 à 16:00, Ernest Wilson a écrit :
>>> Hello,
>>>
>>> I'm using Gambas 3.11.2 and have an error with the Sort property of the DataSource.
>>>
>>> The DataSource on my Form connects to an SQLite Table consisting of fields "ProcessID" and "ProcessTitle". The records are
>>> displayed in a DataBrowser which functions properly.
>>>
>>> I would like to have records displayed in order by the "ProcessTitle" field, so I have used the following code to initialize
>>> the DataSource when opening the Form:
>>>
>>>    With DataSource1
>>>      .Connection = Connection5
>>>      .Table = "Processes"
>>>      .Sort = "ProcessTitle"
>>>    End With
>>>
>>> The sort works properly when records are displayed, however, an error dialog displaying the message "Invalid value" is
>>> presented before the form opens. Clicking the OK response to the error dialog allows the window to open and everything
>>> functions normally.
>>>
>>> If I comment out the line with .Sort = "ProcessTitle", the error does not occur, but of course, there is no sort.
>>>
>>> Any ideas about how to fix this, will be much appreciated.
>>>
>>
>> If you can provide a little project (with a little database) that reproduces the bug, it would be great.
>>
> 
> 
> 
> 
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 


More information about the User mailing list