Binding Y/N (Yes/No) database field to a Checkbox control

H

Hersh

I've bound a Y/N field coming from an Oracle database (via a Web Service) to
a Checkbox control. I'd like the Checkbox to be checked when the value of
this field is "Y" -- and not checked when its value is"N". How can I achieve
this behavior?

Thanks.
 
S

S.Y.M. Wong-A-Ton

Double-click on the checkbox to open its Properties dialog box. Change its
"Data type" to "Text (string)", type in "N" for "Value when cleared", and "Y"
for "Value when checked". If you cannot change the data type because it has
been locked by InfoPath and set on "True/False (boolean)", then you'll have
to let your web service return TRUE/FALSE or 1/0 instead of Y/N for the
checkbox to work.
 
H

Hersh

Thanks S.Y.M.!

Simply setting the "Value when cleared" and "Value when checked" properties
according to your instructions did the trick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top