472,333 Members | 1,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,333 software developers and data experts.

Help please! Linking, showing, but not embedding images

Hello all.

I hope someone can help me here. I need to make a db on many pictures,
however, if I OLE them, the access database grows hugely. If I only
hyperlink them, I can't view them. is there a way how I can hyperlink
the pictures and have something like thumbnails to view them in a form?
any comment apprecciated. thanks

Nov 13 '05 #1
6 1863
Use an Image control to view the picture and store a Text item in the table
called E.G "PhotoPath" which is the path to the picture
something like "C:\My Documents\MyPhotos\Photo1.jpg"

You then need a bit of code on the OnCurrent event of the form like
Me!Photo.Picture = Me!PhotoPath

You will need to do check whether the photo exists
If Dir(PhotoPath) = "" Then ' not found
....
End if

You may also get annoyed with a message box temporarily appearing saying
something about JPEG Image loading

Have a look at the registry (Windows XP) and find
HKEY_LOCAL_MACHINE\Software\Microsoft\ Shared Tools\Graphics
Filters\Import\JPEG\Options Yes
Change the Yes to a No to stop this.

There are routines to do this automatically on opening the form

HTH

Phil

<th***********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello all.

I hope someone can help me here. I need to make a db on many pictures,
however, if I OLE them, the access database grows hugely. If I only
hyperlink them, I can't view them. is there a way how I can hyperlink
the pictures and have something like thumbnails to view them in a form?
any comment apprecciated. thanks

Nov 13 '05 #2
Use an ImageFrame on the form, store images in a folder, and use the
following code:

Private Sub Form_Current()

' Display the picture for the current employee record if the image
' exists. If the file name no longer exists or the file name was blank
' for the current employee, set the errormsg label caption to the
' appropriate message.

Dim res As Boolean
Dim fName As String

Path = CurrentProject.Path & "\Employee Photos"
On Error Resume Next
errormsg.Visible = False
If Not IsNull(Me!Photo) Then
res = IsRelative(Me!Photo)
fName = Me![ImagePath]
If (res = True) Then
fName = Path & "\" & fName
End If

Me![ImageFrame].Picture = fName
showImageFrame
Me.PaintPalette = Me![ImageFrame].ObjectPalette
If (Me![ImageFrame].Picture <> fName) Then
hideImageFrame
errormsg.Caption = "Picture not found"
errormsg.Visible = True
End If
Else
hideImageFrame
errormsg.Caption = "Click Add/Change to" & vbCrLf & " insert
Employee's photo"
errormsg.Visible = True
End If

Me.lblDisplayLastName.Caption = Me.LastName
Me.lblDisplayFirstName.Caption = Me.FirstName
End Sub
--

Tony D'Ambra
Web Site: aadconsulting.com
Web Blog: accessextra.net

<th***********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello all.

I hope someone can help me here. I need to make a db on many pictures,
however, if I OLE them, the access database grows hugely. If I only
hyperlink them, I can't view them. is there a way how I can hyperlink
the pictures and have something like thumbnails to view them in a form?
any comment apprecciated. thanks

Nov 13 '05 #3
hey, thanks

I tried it. unfortunately, I get the message that the OnCurrent
procedure produced an 'invalid outside procedure' - what am I doing
wrong? my VB isn't very good, sorry. also I'm using access 97.

Theo

Nov 13 '05 #4
hello,
thanks for the code. however, access complains about

"CurrentProject" highlighted - 'variable not defined'

any ideas? I am sorry, I am not very good with VB, also my version of
access is '97.
thanks a lot.
Theo

Nov 13 '05 #5
Try this

Function FindOldPhoto(frm As Form, PhotoPath As String, ID As Long)

'HKEY_LOCAL_MACHINE\Software\Microsoft\ Shared Tools\Graphics
Filters\Import\JPEG\Options ShowProgressDialog No

Dim Msg As String, FilterName As String

If Nz(ID) = 0 Or Nz(PhotoPath) = "" Then
frm!Photo.Picture = ""
Exit Function
End If

If Dir(PhotoPath) = "" Then ' not found
Msg = "Photo: " & PhotoPath & vbCrLf
Msg = Msg & "is not found at the above location (or is misspelled)"
MsgBox Msg, vbInformation, "Missing Photo"
frm.Photo.Picture = ""
Exit Function
End If

frm!Photo.Picture = frm!PhotoPath

End Function

Private Sub Form_Current()

Call FindOldPhoto(Me, Nz(PhotoPath), ID) ' Load Photo

End Sub

When you say your VB is not too good, does that mean you have some or no
experience with Events.

Phil

<th***********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
hello,
thanks for the code. however, access complains about

"CurrentProject" highlighted - 'variable not defined'

any ideas? I am sorry, I am not very good with VB, also my version of
access is '97.
thanks a lot.
Theo

Nov 13 '05 #6
hello-
sorry, been away. I've had some experience with VB, a little with
events, but that was years ago at school. however, I've found another
solution which I should've looked into before anyway, and downloaded a
program called picasa, which I found is quite sufficient (and which I
can highly recommend!). sorry to have bothered you all.
happy new year and a belated merry xmas!
Theo

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: duikboot | last post by:
Hi all, I'm trying to export a view tables from a Oracle database to a Mysql database. I create insert statements (they look alright), but it...
14
by: TrvlOrm | last post by:
OK. After much playing around, I managed to get my frame page this far.. see code below. BUT...there are still errors with it, and what I would...
9
by: Daz | last post by:
Hello hello! I'm trying to finish off putting my design into HTML and I've come across a problem that I can't get my head around. I've got...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I...
8
by: Roger Chapman | last post by:
I have a problem I can't seem to find any help on, I really hope someone else has come across this and kno9ws the answer. When outputing to a list...
28
by: Tim_Mac | last post by:
hi, i'm new to .net 2.0, and am just starting to get to grips with the gridview. my page has autoEventWireUp set to true, which i gather is...
6
by: Edward | last post by:
I have been doing some research about embedding images in HTML using the data URL src method of the format: <img...
0
nomad
by: nomad | last post by:
I made a simple GUI program in which I want to place a .gif into a button. I did this but the .gif does not show up. The load.gif is in the same...
1
by: zombie212 | last post by:
I have devoloped a page in asp.net with datagrid with code behind in VB, to show the result of SP_ who2 ( SQL Server System stored proc). Now I have...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.