Home » Developer & Programmer » Forms » checking to see if a text item is empty (form builder ,10g, xp)
icon4.gif  checking to see if a text item is empty [message #470101] Sun, 08 August 2010 08:18 Go to next message
ShinTec
Messages: 8
Registered: May 2010
Junior Member
Hello Forum

I was wondering can i check if a text item in another block is empty when a user try to create a record using a button in another block. Sorry if this doesnt make any sense im really bad at explaining stuff
Thank you in advance for the help
Heres my code

/*creating a program that will check to see if the customer id in thecustomer block is null it will then display the the stop alert and tell the user that he/she cant create a new order without having a selected a customer*/

--this is the block_item im checking to see if it null
IF (:customer.c_id) = NULL THEN
 DISPLAY_ORD_STOP_ALERT;
 GO_ITEM('CUSTOMER.C_ID');

ELSE
 SELECT o_id_sequence.nextval
 INTO :orders.o_id
 FROM dual;
 :orders.order_date := SYSDATE;
		 
END IF;--end of if statement





CM: fixed [code] tags - you had the slash the wrong way round.

[Updated on: Sun, 08 August 2010 13:34] by Moderator

Report message to a moderator

Re: checking to see if a text item is empty [message #470104 is a reply to message #470101] Sun, 08 August 2010 08:58 Go to previous messageGo to next message
ranamirfan
Messages: 535
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Try this trigger at Form Level.

WHEN-VALIDATE-ITEM

Re: checking to see if a text item is empty [message #470118 is a reply to message #470104] Sun, 08 August 2010 13:36 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why not just have that code in the WHEN-BUTTON-PRESSED trigger?
What exactly is the problem here?
Re: checking to see if a text item is empty [message #470128 is a reply to message #470118] Sun, 08 August 2010 14:43 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Shouldn't
IF (:customer.c_id) = NULL THEN
be
IF (:customer.c_id) IS NULL THEN
Re: checking to see if a text item is empty [message #470865 is a reply to message #470128] Wed, 11 August 2010 04:08 Go to previous messageGo to next message
ShinTec
Messages: 8
Registered: May 2010
Junior Member
Da Bomb little foot cheers for the help peace
Re: checking to see if a text item is empty [message #470866 is a reply to message #470865] Wed, 11 August 2010 04:09 Go to previous message
ShinTec
Messages: 8
Registered: May 2010
Junior Member
oh and everyone else yo that made suggestion really appreciate it
Previous Topic: Treeview with images and checkboxes in forms with OLE-Container
Next Topic: How to us ALTER TABLE in forms
Goto Forum:
  


Current Time: Thu Sep 19 11:37:09 CDT 2024