Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Seeking for a EVEN BETTER Solution about picture linking in Forms

Status
Not open for further replies.

chenwenjun

Technical User
Nov 9, 2002
58
RW
Last time, at this forum, I asked If I could view my pictures stored in certain folders in FORM without inserting or linking because of the problem of file size.
And Gusbrunston helped me greatly by introducing me the function as followed. But I am still seeking EVEN BETTER solution.
This one serves my needs perfectly in SINGLE FORM,however, when I view my pictures in a continuous form, all pictures are the same one (the one belongs to the actived record!).[/red]
Is that possible that I can have a continuous form which shows records with their own picture?



Function setImagePath()
Dim strImagePath As String
Dim strMDBPath As String
Dim intSlashLoc As String

On Error Goto PictureNotAvailable
'Obtain the full path of the current database or Access Project
strMDBPath = CurrentProject.FullName

'Find the location of the last backslash
intSlashLoc = InStrRev(strMDBPath, "\", Len(strMDBPath))

'Trim off the database name, leaving the path
'and append the name of the image file
strImagePath = Left(strMDBPath, intSlashLoc) & _
Me.txtImageName

'Set ImageFrame to the path of the image file
Me.ImageFrame.Picture = strImagePath
Exit Function
PictureNotAvailable:
strImagePath = "NoPicture.BMP"
Me.ImageFrame.Picture = strImagePath

End Function

"Learn till the last breath."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top