code for Next button [message #81033] |
Mon, 30 December 2002 01:28 |
Aydah
Messages: 11 Registered: November 2002
|
Junior Member |
|
|
i have a next button and it has the following code:
next_record;
i want to check if is the last rercord in the databse then the next button will stop
help me!
|
|
|
Re: code for Next button [message #81034 is a reply to message #81033] |
Mon, 30 December 2002 02:37 |
Solve
Messages: 38 Registered: December 2002
|
Member |
|
|
hi,
can you see the informative message on the bottom? I think that you know automaticaly if it is the last record and you just have to handle this message.
|
|
|
|
|
Re: code for Next button [message #81040 is a reply to message #81033] |
Mon, 30 December 2002 06:13 |
Archana
Messages: 18 Registered: January 2001
|
Junior Member |
|
|
you can write a trigger as follows:
if :system.last_record='TRUE' then
set_item_property('next_button,enabled,property_off);
else
set_item_property('next_button,enabled,property_on);
end if;
|
|
|
Re: code for Next button [message #81047 is a reply to message #81038] |
Tue, 31 December 2002 01:51 |
Solve
Messages: 38 Registered: December 2002
|
Member |
|
|
I am not sure, but you could write on-error or on-message trigger, mabe it is what you need? :
DECLARE
errnum NUMBER := ERROR_CODE;
errtxt VARCHAR2(80) := ERROR_TEXT;
errtyp VARCHAR2(3) := ERROR_TYPE;
n NUMBER;
BEGIN
IF (errtyp = 'FRM' and errnum = 40352)
THEN
Message(' Last record of query retrieved!! ');
ELSE
Message(errtyp||'-'||TO_CHAR(errnum)||': '||errtxt);
END IF;
RAISE Form_Trigger_Failure;
END;
|
|
|
|