Home » Developer & Programmer » Forms » how to display alert button when user inserted wrong IC number?
how to display alert button when user inserted wrong IC number? [message #86017] Sun, 22 August 2004 19:23 Go to next message
Dhalan
Messages: 15
Registered: August 2004
Junior Member
HAI,

i used this statement on when-validate-item

SELECT nama INTO :DATANG.NAME FROM PEKERJA WHERE ICNO = :DATANG.ICNO;

my question is, how to display alert button with a message such as ('sorry pls try again") if the user inserted with wrong IC NUMBER or no records available with that ic number.

CAN you give an example on how to display the alert button.

thank you for helping me. may god bless you

regards

eboy

 
Re: how to display alert button when user inserted wrong IC number? [message #86018 is a reply to message #86017] Sun, 22 August 2004 20:14 Go to previous messageGo to next message
Narendra K.
Messages: 18
Registered: June 2003
Junior Member
Try the following code:
Put your SQL in a BEGIN---END block as below.

Begin
SELECT nama INTO :DATANG.NAME FROM PEKERJA WHERE ICNO = :DATANG.ICNO;

Exception
when no_data_found then
----- show Alert Here ---------
raise form_trigger_failure;
End;

Hope it will solve your query.
have a nice day,

-Narendra
Re: how to display alert button when user inserted wrong IC number? [message #86019 is a reply to message #86018] Sun, 22 August 2004 20:51 Go to previous messageGo to next message
Dhalan
Messages: 15
Registered: August 2004
Junior Member
thank narendra for your kindness

can you give more details on how to show the alert button. my senior want to display it on a box such as if u want to quit the program a message box appear either you choose yes o no. can u help me on how to display the message button. thanks once again

the 1 i did is

begin
SELECT nama INTO :DATANG.NAME FROM PEKERJA WHERE ICNO = :DATANG.ICNO;

exception
when no_data_found then
message('No Such IC No in My Database!! PLS TRY AGAIN',No_acknowledge);
RAISE Form_Trigger_Failure;
end;
Re: how to display alert button when user inserted wrong IC number? [message #86020 is a reply to message #86019] Sun, 22 August 2004 22:46 Go to previous messageGo to next message
ASKSHUBH
Messages: 3
Registered: August 2004
Junior Member
well narendra if i am able to understand ur problem , it seems that you want to showan alert button when exception happens right?
you can make an alert button and name it like alert1
now when u want to show it just write ,
show_alert('ALERT1');(like when exception happenned i this case),
begin
SELECT nama INTO :DATANG.NAME FROM PEKERJA WHERE ICNO = :DATANG.ICNO;

exception
when no_data_found then
--message('No Such IC No in My Database!! PLS TRY AGAIN',No_acknowledge);
show_alert('ALERT1');
--RAISE Form_Trigger_Failure;
end;
for ur problem u can set p[[roperty of alert style to stop,
button 1 label OK
button 2 label NO
Hope it solves ,
Plz let me know if u hav any questions
thankx
shub
Re: how to display alert button when user inserted wrong IC number? [message #86027 is a reply to message #86020] Mon, 23 August 2004 03:15 Go to previous messageGo to next message
eboy
Messages: 17
Registered: August 2004
Junior Member
thanks askshubh n narendra
Re: how to display alert button when user inserted wrong IC number? [message #86042 is a reply to message #86019] Tue, 24 August 2004 20:22 Go to previous message
Narendra K.
Messages: 18
Registered: June 2003
Junior Member
Please copy and paste the text below & it will
do the needful.

Begin
SELECT nama INTO :DATANG.NAME FROM PEKERJA WHERE ICNO = :DATANG.ICNO;

Exception
when no_data_found then
message('No Such IC No in My Database!! PLS TRY AGAIN');
message(' ', no_acknowledge);
RAISE Form_Trigger_Failure;
End;

Please note that there is a blank space between
the quotes in the second "message" statement.
Previous Topic: how to search the record?
Next Topic: Error: end-of-file on communication channel
Goto Forum:
  


Current Time: Sun May 19 10:32:24 CDT 2024