Home » Developer & Programmer » Forms » check boxes
check boxes [message #133104] Wed, 17 August 2005 13:42 Go to next message
dmack
Messages: 42
Registered: March 2005
Location: TNT
Member

Hi again,

I want to be able to change the values of check boxes by clicking a button. I am not too sure of the code to effect this. basically I want if the checkbox is checked (Y), when the button is clicked the check box should be unchecked (N). i have been playing around but nothing seems to work.
Re: check boxes [message #133115 is a reply to message #133104] Wed, 17 August 2005 14:29 Go to previous messageGo to next message
ram kumar
Messages: 113
Registered: August 2002
Senior Member
Hi
Go to the properties of check box and see what you have Set for
Property Value when checked and Value when unchecked
set them 'Y' and 'N' accordingly.After This under button code
if :block.item ='Y' then
:block.item:='N';
else
:block.item:='Y';
end if


Ram
Re: check boxes [message #133132 is a reply to message #133104] Wed, 17 August 2005 15:42 Go to previous messageGo to next message
dmack
Messages: 42
Registered: March 2005
Location: TNT
Member
hi thank u this worked but i forgot to mention that the checkboxes are part of a multi record block. The solution provided unchecks one record (which was the last one checked).
Re: check boxes [message #133154 is a reply to message #133132] Wed, 17 August 2005 19:50 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Then you will have to loop through all the records.

Store the value for :system.cursor_record or get_record_property(block,current_record) so you know which record you are currently processing (saved_record_number). Then get_block_property(block,top_record) to know which record is at the top of the screen (saved_top_record).

Use 'first_record' to go to the top of the list, set your check-box, then 'while :system.last_record <> true', go 'down' and repeat you check-box activities.

Once finished
if saved_record_number < get_block_property(block,records_displayed)
  -- (we started on first page)
  first_record;
  go_record(saved_record_number)
else 
  last_record;
  go_record(saved_top_number);
  go_record(saved_record_number);
end if;

Try it and see how you go.

David
Previous Topic: Highlighted Text
Next Topic: How to Send Mail in D2k 6i
Goto Forum:
  


Current Time: Fri Sep 20 07:19:35 CDT 2024