Copy Date Value

From: Doermann, Jochen <_x_jochen.doermann_at_doit.wisc.edu>
Date: 1997/07/03
Message-ID: <33BBEDC9.7F03667E_at_doit.wisc.edu>#1/1


[Quoted] I'm using Forms [32 Bit] Version 4.5.7.1.6 (Production). I have two date items (eff_date and end_date) on the form (they are base table items). I also have a series of check boxes (option_a, option_b, ...) and associated dates (eff_date_a, end_date_a, eff_date_b, end_date_b, ...). When the user clicks on the check boxes, the date should be cleared if the check is removed and defaulted to the overall eff_date and end_date when the box is checked.

I've put a when_checkbox_changed trigger at the block level. It's supposed to either clear or default the appropriate date fields based on the checkbox clicked. It goes something like this

declare   

  checked_item 		varchar2(30);
  option_id 		varchar2(2);
  item_name 		varchar2(30);

begin

  checked_item := :system.current_item; /* get the item name */   option_id := substr(checked_item,8,1); /* strip off the last character */

/* clear or default the eff date */

  item_name := 'eff_date_' || option_id; /* build a new item name */   if name_in(checked_item) = 'Y' then
    copy(:block.eff_date, item_name); /* copy the overall eff date */   else
    copy(null, item_name); /* clear the item */   end_if;

/* clear or default the end date */

  item_name := 'end_date_' || option_id;   if name_in(checked_item) = 'Y' then
    copy(:block.end_date, item_name);
  else
    copy(null, item_name);
  end_if;

end;

The copy(null, xxx) works fine, but the other copy gives me a compile error.

  copy(:block.eff_date, item_name) --> wrong number or types of arguments in call to 'COPY'

  copy(block.eff_date, item_name) --> table reference 'BLOCK' not allowed in this context (table name and block name are the same)

What am I doing wrong? Is there a better way?

TIA -- Jochen


 

Please remove the _x_ from my address if you reply by e-mail. Trying to avoid some of the spam. It's jochen.doermann_at_... Received on Thu Jul 03 1997 - 00:00:00 CEST

Original text of this message