Home » Developer & Programmer » Forms » How to execute query on insert mode
How to execute query on insert mode [message #224638] Wed, 14 March 2007 20:40 Go to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

When I press F6 and insert new data, I validate the it and if I found that it already exist I have to display the details on my details block. So I have to get out of insert mode and go to query mode instead. how shoul I do?

I put these codes but it's just work as query all, not by the two fields I have specified values.

	clear_form(no_validate);
        :clm_usr.user_no := :parameter.user_no;
	:clm_usr.username := :parameter.username;
	execute_query(no_validate);


[Mod-edit: corrected closing /code-tag]

[Updated on: Thu, 15 March 2007 03:18] by Moderator

Report message to a moderator

Re: How to execute query on insert mode [message #224676 is a reply to message #224638] Thu, 15 March 2007 02:12 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
In order to query records by some criteria, you have to enter it while in ENTER-QUERY mode. But, it can not be coded. Once you issue ENTER-QUERY, form waits until you press EXECUTE-QUERY.

Therefore, you'll have to put those 'parameter.user_no' and 'parameter.username' into the DEFAULT_WHERE clause (using the SET-BLOCK-PROPERTY built-in (see how to use it in Forms Online Help System) procedure) and EXECUTE-QUERY.
Re: How to execute query on insert mode [message #224724 is a reply to message #224638] Thu, 15 March 2007 04:29 Go to previous message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

got it littlefoot! I forgot to add extra single for my criteria in default_where then I give up on it. I get back to it as you advised and is now runnig fine.
thanks!
Previous Topic: replacing characters with *
Next Topic: POST-CHANGE trigger
Goto Forum:
  


Current Time: Thu Dec 08 08:15:55 CST 2016

Total time taken to generate the page: 0.16241 seconds