I need to do a query on a multi-record block form. The block(employee) has the following fields
emp_no emp_name emp_address start_date finish_date (in employee block)
The query is to find employees whose start_date is between DATE1 and DATE2
So I create 2 control items DATE1 and DATE2
My plan is after user enter DATE1 and DATE2 and click execute query button then in
Set_Block_Property('EMPLOYEE',DEFAULT_WHERE,'start_date between :control.date1 and :control.date2');
When I click enter query icon and I always get FRM-41003: "This function cannot be performed here"
Could you tell me what cause this error and how to fix it.
Also I need do the validate to make sure DATE2>DATE1. I put this validate in execute-query trigger and does the job.
Is this the right place to put this validation?
It sounds like you have a trigger that is firing (like a When-Validate-Item) when you are not expecting it to fire. If you are able to run your form from the Forms Builder, I recommend you run your form with Debug Messages turned on to see what is firing when you click the "Execute Query" button. If you can't run from the Forms Builder, then I recommend you enable "Tracing" and run your form. Then review the trace log to see what is actually causing your error. Once you know the actual source of your error you will be able to resolve it.
Hope this helps,
If someone's response is helpful or correct, please mark it accordingly.