Topic: TableGrid filters on Boolean values

Hi there! I am attempting to create a project with two tables, one of which is named "Species" and has a boolean field "Legendary". I am trying to figure out what I need to put in as the filter in a tablegrid in order to display only records where this field has been ticked, so the tablegrid shows the value as "Yes".  However, any time I try to put in a filter for the boolean field, the tablegrid shows no records.

Any help anyone can offer would be appreciated! smile

2 (edited by derek 2017-12-16 00:19:24)

Re: TableGrid filters on Boolean values

Hi Nyzari,
If I understand your question correctly, the syntax you need is 'boolean field = 0 ' or boolean field = 1 to return filtered values of 'No' or 'Yes'.
Have a look at the attachment (part of an old project) and see how the grids are filtered on 2 boolean fields.
Hope this helps
Derek.

Post's attachments

Attachment icon nyzari.zip 337.15 kb, 337 downloads since 2017-12-16 

Re: TableGrid filters on Boolean values

Hey Derek,
That worked perfectly! Thanks so much big_smile

4 (edited by derek 2017-12-16 01:35:25)

Re: TableGrid filters on Boolean values

No problem.
The other main way of filtering records, rather than put a filter into the tablegrid itself, is to use a combobox.  If you need any help with that, just let me know.
Regards,
Derek.

Re: TableGrid filters on Boolean values

So I'm having another issue with filters. I have another form with a different table that I'm trying to apply a filter to, but when I run the program and try to access the form it gives me the following error:

near "AND": syntax error.

Any ideas what could be causing this and how to fix this?

Re: TableGrid filters on Boolean values

Hi Nyzari,
Any chance you can attach your project so that we can better understand the problem?
Derek.

7 (edited by nyzari 2017-12-18 21:42:07)

Re: TableGrid filters on Boolean values

Hmm. I tried to upload the zip folder, but it doesn't seem to let me put it in the post. Am i doing something wrong, or is there another way I can get it to you?

Re: TableGrid filters on Boolean values

Hi,
It might be if you've included the .exe in the zip folder.  Try deleting the .exe, zip it again and try uploading once more.
Derek.

9 (edited by nyzari 2017-12-18 23:09:18)

Re: TableGrid filters on Boolean values

Ok, here is the file.

To get the error, simply run the project, click one of the top 3 buttons on the window, then attempt to access one of the records shown.

Post's attachments

Attachment icon National Strategy Dex.zip 730.43 kb, 319 downloads since 2017-12-19 

10 (edited by derek 2017-12-18 23:37:20)

Re: TableGrid filters on Boolean values

Hi Nyzari,
I don't think the problem is due to your filters.
In form wndwspecies / tablegrid1, you are calling a field called individual.outdated that doesn't exist any more.  Looking at your tables, I wonder if you renamed it to individual.archived at some point?  If you make changes to field names, you need to remember to go through and update any old references.
Attached is the fixed project.
Regards,
Derek.

Post's attachments

Attachment icon National Strategy Dex.zip 724.53 kb, 345 downloads since 2017-12-19 

11 (edited by nyzari 2017-12-18 23:59:01)

Re: TableGrid filters on Boolean values

Whoo boy, seems I've been using an outdated version of the software - when I downloaded it, MVDB was at 1.42!

Had to download a newer version to be able to open the one you sent, that seems to have fixed the issue. Thanks for your help again!