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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Being thick - set checkbox property

Status
Not open for further replies.

nickty

MIS
May 25, 2001
23
0
0
GB
Hi, I'm being a bit thick, but can't work out how to set a checkbox either checked or unchecked programatically.

I have 12 non-database items on my form. I have a cursor which is returning some data from d/b, and want to set 1(or more) checkboxes to checked depending on data returned.

I've looked in help and it says use set_item_property, but which property?

sorry if this is a silly question! , thanks.
 
If the checked value is Y and the unchecked is N, you set it to checked using an assignment:

[tt]:block.check_box_item := 'Y';[/tt]
 
thanks, but they are not y or n.
the data returned will be a number from 1 to 12,
so if the cursor returns, for example 4 and 5
I want to set checkbox 4 to 4
and checkbox 5 to 5, if you see what I mean!
 
Checkbox can be only in 2 states: checked and unchecked. How can you assign 5 to it? If you need only to switch it on, you may create a set of checkboxes named e.g. CHECKx where x is the order number of your checkbox with checked/unchecked values provided by lewip, and use COPY command to change the value.

for c in cursor loop
copy('Y', 'block.CHECK'||c.value);
end loop;

Regards, Dima
 
Dima, I agree a check box can only be checked or unchecked
but
When you specify you Value when checked and Value when Unchecked you specify what the value must be...

so nickty you would then be able to use the code (similar to what Dima said)

for c in cursor loop
copy(c.value, 'block.CHECK'||c.value);
end loop;

Cheers
Julie
 
thanks all

...MissJules, you are correct, i was trying to specify the 'value when checked' to either 4, 5 etc.

However, I have changed the form so checkboxes are either Y or N based on data returned from d/b.


thanks all for your help, it is now working great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top