Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2008

Tip: Looking for answers? Try searching our database.

Display photo/picture

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SF - 24 May 2008 04:23 GMT
Hi,

I have a main form with the following controls:

 1.. a combobox for selecting Commune Name/Code and
 2.. a subform that display a list of Name, position and photo_path when
commune in the combobox is selected. I have put
 3.. an image control/place holder that take the source photo path from
subform

I have completes step 1 and 2 but I cannot make the image control to work
cause I need to tell image control to go and look for photo source path in
the subform.

Could someone shading some light here?

SF
Damon Heron - 24 May 2008 21:39 GMT
From your description, it sounds like the subform has more than one record
when the combobox is selected.  Then you want to display an image on the
main form when the individual record is clicked, correct?

Put an image control on main form.
Open the subform in design view and select the Click property.
enter this code, substituting your names for the imagecontrol and field that
holds the path to the picture.

Private Sub Form_Click()
Me.Parent!Image1.Picture = Me.Field1
End Sub

Damon

> Hi,
>
[quoted text clipped - 13 lines]
>
> SF
SF - 26 May 2008 04:24 GMT
Thank you very much for your tip. It works very well. I still have small
problem to reset the image control when there is no record in subform (the
image control still retain last photo).

SF

> From your description, it sounds like the subform has more than one record
> when the combobox is selected.  Then you want to display an image on the
[quoted text clipped - 28 lines]
>>
>> SF
Damon Heron - 26 May 2008 18:48 GMT
Well, if you are sure the field that has the source path is blank, then use:

If Not IsNull(Me.Field1) Then
   Me.Parent!Image1.Picture = Me.Field1
Else
   Me.Parent!Image1.Picture = ""
End If

Otherwise, you will have to have some error handling routines to catch
problems with the address paths.

Damon

> Thank you very much for your tip. It works very well. I still have small
> problem to reset the image control when there is no record in subform (the
[quoted text clipped - 34 lines]
>>>
>>> SF
Jan Baird - 27 May 2008 20:51 GMT
Jan Baird is out of the country until September 20.   Every effort will be
made to respond to messages, but please be patient.
Jan Baird - 27 May 2008 20:51 GMT
Jan Baird is out of the country until September 20.   Every effort will be
made to respond to messages, but please be patient.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.