Hello
Set to add value to a field(dummy) in datasource when the button is clicked
Basing on this value and using conditional formatting you can Hide/show the
Picture control in the below of the form. so when the button is clicked , the
value is set into this field and the conditional formatting is fired. the
hidden pictural control will be shown. now you can browse and insert a
picture.
If the button is not clicked, value is not set and the Picture control will
be hidden.
I hope it is clear now.

Signature
Kalyan G Reddy - INFOPATH MVP 2007
http://www.ggktech.com
> I am sorry to be a nuisance but i am a beginer to infopath, could you be a
> little more specific.
[quoted text clipped - 19 lines]
> > > Many thanks
> > > Edward
K.Ramana Reddy(GGK Tech) - 23 Aug 2007 14:50 GMT
Hi,
kalyan explained about button Button click, there is a another way to do this.
Place some check box into form,
see properties of check box will have by default value when cleared ="false"
and value when checked "true", you can either way.
Based on checked and unchecked you can set the conditional formatting on the
picture control.

Signature
k.Ramana Reddy
http://www.GGKtech.com
> Hello
>
[quoted text clipped - 33 lines]
> > > > Many thanks
> > > > Edward
Edward VN - 23 Aug 2007 16:50 GMT
Ok, i now understand it, i have set the check box to apply a rule based on
the value but what is the 'function' called that will allow me to browse for
and insert a picture.
Kind Regards
Edward
> Hi,
>
[quoted text clipped - 43 lines]
> > > > > Many thanks
> > > > > Edward
Edward VN - 23 Aug 2007 16:28 GMT
Thank you, how do i set the button to add a value to a field(dummy) in
datasource when the button is clicked?,
> Hello
>
[quoted text clipped - 33 lines]
> > > > Many thanks
> > > > Edward
K.Ramana Reddy(GGK Tech) - 24 Aug 2007 04:54 GMT
Hi,
Add the Dummy field in dataSource and assign the some value to t he field,
based on this you can set the conditional formatting on the picture control.
This is VB script code.
------------------------------------------
Sub CTRL6_5_OnClick(eventObj)
' Write your code here
dim x
X = XDocument.DOM.selectSingleNode("/my:myFields/my:Dummy").text="somevalue"
End Sub
This is Javascirpt code
----------------------------------------------
function CTRL1_5::OnClick(eventObj)
{
var X
X = XDocument.DOM.selectSingleNode("/my:myFields/my:Dummy").text="somevalue";
}
I hope this will help for you.

Signature
k.Ramana Reddy
http://www.GGKtech.com
> Thank you, how do i set the button to add a value to a field(dummy) in
> datasource when the button is clicked?,
[quoted text clipped - 36 lines]
> > > > > Many thanks
> > > > > Edward