Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms-CheckBox

Status
Not open for further replies.

robdunfey

Technical User
Apr 26, 2002
110
GB
Hi,

I have am using FromsV6 with an Oracle9i database. I have a check box that when clicked inserts a date into a date field. But I am having a few problems. When I load the form if the date field is null I want the check box to be unchecked. If a date exists in the field I want the check box to be checked? In Access you would set the value property, but the check box does not appear to have a value property? It has a value when checked and a value when unchecked, which I have set to Y and N respectively. Also I want this to run when the form loads, so I have chosen to put the code in a triger at the datablock level called when_new_form_instance? Is this the best approach, and does this trigger do what I expect it to do?

Kind Regards - Rob

 
To set your checkbox to checked you only have to assign the right value to it.

[tt]:block.checkbox := 'Y';[/tt]

You can easily do this in a WHEN-NEW-FORM-INSTANCE trigger, as long as the date item to whcih it relates is populated by whatever method you have chosen before the code in WNFI trigger is executed.

If your date field is populated as a result of a query on a block, your WNFI trigger code might look something like

[tt]Go_Block('your_block');
Execute_Query;
--
IF :your_block.date_item IS NOT NULL
THEN
:block.checkbox := 'Y';
ELSE
:block.checkbox := 'N';
END IF;[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top