Link to home
Start Free TrialLog in
Avatar of wasabi3689
wasabi3689Flag for United States of America

asked on

How to pop up frm-40301 when the form is empty

I am using Oracle 8i and application version is 11.0.300.

I have a form, when I query the form from menu (query->enter) and input a ID, if the ID return nothing,  I want the following message popped up on the tool bar

frm-40301:query caused no record to be retrieved. Re-enter

but, now if empty form, it still have the following in the tool bar

Enter a query; please Ctrl+F11 to execute, F4 to Cancel

How to fix it?
Avatar of Helena Marková
Helena Marková
Flag of Slovakia image

The message indicates, that your form is in an Enter-Query mode. This mode can be ended by using
exit_form;
built-in.

If you want to suppress that message then you can use On-Message trigger (on form level) and write there something like this:
if message_code = 40301 then
  null;
end if;
Avatar of wasabi3689

ASKER

I created on-message trigger and put it in either form level or block level or both, still doesn't work. When I query  an ID with empty form, still show
"Enter a query; please Ctrl+F11 to execute, F4 to Cancel"

My on-message trigger, just one line

exit_form;
On-Message trigger ought to be like this:
if message_code = 40301 then
  null; -- this suppress the message: "frm-40301:query caused no record to be retrieved. Re-enter"
end if;

But this message:
"Enter a query; please Ctrl+F11 to execute, F4 to Cancel"
seems to be your message when invoking enter-query mode.
I tried it, still doesn't work
I add on-message to either form level or block level (for the form) or both, when I enter query mode (query->enter, then query->run), it still have the same message "Enter a query; please Ctrl+F11 to execute, F4 to Cancel", never change to "frm-40301:query caused no record to be retrieved. Re-enter" when queried an empty form.

In my on-message trigger, I have following

if message_code = 40301 then
  null;
end if;
ASKER CERTIFIED SOLUTION
Avatar of wasabi3689
wasabi3689
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial