Image Control Help

561
4
08-19-2010 06:01 AM
JayKappy
Occasional Contributor
I placed an image control on my form and am trying to populate it by a simple click of a button.  I will modify the launch and image change later, for now I just want to see the image.

ERROR:
Object does not support this object or method

I tried it 4 ways (seen below) :
Sub Image
     Dim Image1
     Set Image1= Applet.Forms("Supports").Pages("Page2").Controls("Image1")
     Image1.Value = "C:\Temp\Streetsign_Database_LatLong\Images\R1-3.jpg"
End Sub

Sub Image
     Dim Image1
     Set Image1= Application.Applets("Custom Settings").Forms("Supports").Pages("Page2").Controls("Image1")
     Image1.Value = "C:\Temp\Streetsign_Database_LatLong\Images\R1-3.jpg"
End Sub

Sub Image
     Dim Image1
     Set Image1= ThisEvent.Object.Pages("Page2").Controls("Image1")
     Image1.Value = "C:\Temp\Streetsign_Database_LatLong\Images\R1-3.jpg"
End Sub

Sub Image
     Image1.Value = "C:\Temp\Streetsign_Database_LatLong\Images\R1-3.jpg"
End Sub


Any thoughts?  Just want to show an image on the form determined by a field value...as I said for now just want to place any image in there....

THanks
Tags (3)
0 Kudos
4 Replies
JayKappy
Occasional Contributor
I also tried: But no luck

Dim pTheImageBox
Set pTheImageBox = Application.Forms("Supports").Pages("Page2").Controls("Image1")
pTheImageBox.Value = "c:\Temp\Streetsign_Database_LatLong\Images\R1-3.jpg"
0 Kudos
JayKappy
Occasional Contributor
Anyone ever use a image control?

Anyone out there offer some advise here....I can figure this out for some reason....
0 Kudos
JayKappy
Occasional Contributor
I can get the image controls name with this....but it errors out when I try and set the image value...

Any thoughts

Dim objRS, objSelLayer, objEFPageOneControls4, objEditForm4, objEFPageOneControls2, objEditForm2
Set objSelLayer = Map.SelectionLayer
Set objRS = objSelLayer.Records

objRS.Bookmark = Map.SelectionBookmark
Set objEditForm4 = application.map.layers("Supports").forms("EDITFORM")
Set objEFPageOneControls4 = objEditForm4.Pages("page2").Controls

Dim varobjectid
varobjectid = objEFPageOneControls4("objectid").Value
msgbox "varobjectid: " & varobjectid

Dim imagename
imagename = objEFPageOneControls4("Image1").Name
msgbox "Image name : " & imagename

Set objEFPageOneControls4.("Image1").Value = "c:\Temp\Streetsign_Database_LatLong\Images\R1-3.jpg"
0 Kudos
JayKappy
Occasional Contributor
GOT IT:
Dim objRS, objSelLayer, objEFPageOneControls4, objEditForm4, objEFPageOneControls2, objEditForm2
Set objSelLayer = Map.SelectionLayer
Set objRS = objSelLayer.Records

objRS.Bookmark = Map.SelectionBookmark
Set objEditForm4 = application.map.layers("Supports").forms("EDITFORM")
Set objEFPageOneControls4 = objEditForm4.Pages("page2").Controls

Dim varfilepath
varfilepath = "C:\Temp\StreetSign_Collection_ArcPAD\Images\"

Dim varimagename
varimagename = "R1-3.jpg"

objEFPageOneControls4("Image1").Visible = True
objEFPageOneControls4("Image1").Enabled = True
objEFPageOneControls4("Image1").Value = varfilepath & varimagename
0 Kudos