Dynaically Assign a picture to a picture control based on a rule

O

oghebrial

Hello,

The picture control allows to specify a default picture by clicking the
browse button and selecting an image file. I would like to find out if there
is a way to specify the image filename and path based on a value of a field
in the form. For example dispaly a specific picture if a drop down list
value is "Yes" and display a different picture if that same drop down list
value is "No".

Any thoughts would be greatly appreciated.

Thanks.
 
A

Alex [MSFT]

Experiment with the picture control: while inserting one, say "insert as a
link"; then bind a text box to the same field (say field1) as the picture
control. You will notice that field1 simply stores the path to the picture,
and not the picture itself. Therefore, you can apply Rules to that field:
for example, create a rule on a check box that sets the value of field1 to
"http:\\mysite.com\1.jpg" if the checkbox is checked, and to
"http:\\mysite.com\2.jpg" if it is unchecked.

This should get you started; let me know if have more questions.

Good luck,
Alex @ Microsoft
 
P

Patrick Halstead [InfoPath MVP]

Hi Ossama,
You can use filtering or conditional formatting to display a specific piture
based on a drop down list value. To experiment with this, bind the image to
both an image control as well as a text control and type URLs to images in
the text control. If it's a linked image it should show the image. You can
use a secondary data source to hold links to images you want to display and
do cross-filtering between a drop-down list and the secondary data source. I
hope these ideas help.
Good luck!
Patrick
http://www.autonomysystems.com/
 
O

oghebrial

Alex and Patrick,

Thanks a million for replying to my post; I am now able to make the control
work using the picture link.
 

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