Execute Query [message #382480] |
Thu, 22 January 2009 09:55 |
Kevin58
Messages: 79 Registered: January 2009
|
Member |
|
|
Hi All,
I am trying to find the number of records returned from the
execute_query built in function.
I tried using count_query. However, that cancels the query and
shows the number of records available in the table unfiltered.
Any ideas much appreciated.
Thanks,
Kevin
|
|
|
|
Re: Execute Query [message #382642 is a reply to message #382480] |
Fri, 23 January 2009 06:17 |
Kevin58
Messages: 79 Registered: January 2009
|
Member |
|
|
Hi, I'm using count_query after the execute_query.
It is used via a button's when-button-pressed trigger.
Here is my code:
do_key('execute_query');
count_query;
set_item_property('cancel_query', enabled, property_false);
set_item_property('enter_query', enabled, property_true);
last_record;
first_record;
The last and first records are to show the user how many records are available.
My intention with the count_query is to tell whether or not the query found any records. Then based on that result I would like to enable or disable the buttons.
Trying to imitate the default toolbar functionality using my own buttons.
When I execute the code above I get the response:
FRM-40355: Query will retrieve 91 records.
The form becomes blank like I didn't even put in the search criteria.
Should I not use the do_key() function?
Thanks,
Kevin
|
|
|
|
|
Re: Execute Query [message #382648 is a reply to message #382480] |
Fri, 23 January 2009 07:11 |
Kevin58
Messages: 79 Registered: January 2009
|
Member |
|
|
I am attempting to imitate the functionality of the default toolbar buttons.
The reason I would like to do this programmatically is to enable or disable the query buttons I have on the form.
Thanks,
Kevin
|
|
|
|
Re: Execute Query [message #383006 is a reply to message #382707] |
Mon, 26 January 2009 23:44 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Search this forum for 'count_query'. Use the command in the 'pre-query' trigger as is recommended by the reference manual.
David
|
|
|