By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,234 Members | 1,832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,234 IT Pros & Developers. It's quick & easy.

Linked Pictures

P: n/a
How do I make Access display pictures within a form view as linked objects,
so that the pictures which I am linking to are displayed within the
database? I have a seperate folder for pictures to be placed in, and I have
two pictures per record.

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
There are a few ways to do this in Access. One way is to create a table
which contains an OLEobject field. Here you can link you pictures or
embed them, one picture per row. The you create a form which is based
on this table. In the field list you just add the field(s) to your
form. When you navigate through the recordset, each picture you link to
a record will be displayed in a bound Object frame (which will be
created automatically when you add the field list to your form from the
field list tab on the toolbar of the form in design view).

Another way is to create a form and plant an image control (which is
located on the toolbox toolbar in the form's design view). With this
option you don't need a table. You could list your pictures in an array
and cycle through them in a command button. Code something like this:

Private Sub Command1_Click()
Dim arrPics As Variant
Static i As Integer
arrPics("c:\picdir\pic1.jpg","c:\picdir\pic2.jpg", ...)
If i < Ubound(arrPics) Then
Image1.Picture = arrPics(i)
i = i + 1
Else
i = 0
End If
End Sub

This second example will cycle through the array arrPics until the end
of the array (Ubound(arrPics)). The image control here is called
Image1. Use the Picture property of Image1. Image1.Picture = "Path of
picture to display". When i exceeds Ubound(arrPics) it gets reset to 0
and you start all over again. This routine is a little bit more
flexible than the table routine.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #2

P: n/a
You really don't want to embed images in Access as a field. They are always
converted to BMP files, and therefore the database gets large fast. I've
done it this way. Create a text field in the table where you want to store
the picture, and put the path to the picture there. Then on your form,
create an Image object, and in Form_Current() place something like:
Me![ImageFrame].Picture = Me![fImagePath]

Hope this helps.

cheers,
Matt.

"Charles Robinson III" <ro******@saiyanprincefox.cjb.net> wrote in message
news:8n**************@newsread1.news.atl.earthlink .net...
How do I make Access display pictures within a form view as linked objects, so that the pictures which I am linking to are displayed within the
database? I have a seperate folder for pictures to be placed in, and I have two pictures per record.

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.