Question

I have a Database block contains 3 columns. in that all are character columns. I have created a multi record block in a form which contains 2 text item and one check box.

The values in the table are like below

col1 col2 col3

value1 value2 N

Value3 value4 N

Value5 value6 Y

In the form, I want to find only the records with Value 'N' in the col3.

I want to find the values using Enter - Query, Execute Query method, But here in my form, col3 is the checkbox. if ticked -Y, not ticked value will be 'N'.

I know, we cannot search 'N' values using Enter - Query, Execute Query method.

Is there Any other way we can search?

Was it helpful?

Solution

Your problem is that in enter-query standard functionality is that the checkbox contains an empty value (null) and is not unchecked. To search for an unchecked value just go in enter-query mode and click the checkbox to have the "Y" value in your case and click it again to have the "N" value. From now on you can check and uncheck the value. If you have made a mistake and want it to be empty again use the clear item key to set it back to null.

OTHER TIPS

If you want to allow querying the block based on the checkbox, you need to have the checkbox values stored somewhere, probably in a Y/N column on the table that the block is based on.

Before the block is queried, you'd just need to ensure the checkbox values are posted to the database.

If you can't save them to the table itself, an alternative would be to save them somewhere else, but it has to be something accessible to the query itself - e.g. a global temporary table.

Why not use the check box to enter the needed search criteria form col3? I can't see why that should not be possible and I even tested it quickly. Please try the following

Set properties of your checkbox for col3 as follows

  • Value when Checked = Y
  • Value when Unchecked = N
  • Check Box Mapping of Other Values = Not Allowed
  • Initial Value = N or Y whatever suites your business need
  • Database Item = Yes
  • Column Name = col3

If using this kind of settings you can in Enter Query mode select if you want the query for col3 = N by making sure that the check box is unchecked when executing the query.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top