473,473 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Displaying images in continuous forms

I have been researching for several hours on the best way to display
images in continous forms in Access 2003. For example, I want to
display employee name, email, phone, and picture for each record in
the recordset. I can have the pictures converted to any usable
format, use OLE or linking, whatever needs to be done.

So far, the 3 possible solutions I have found are:

1) OLE objects - if you don't have bitmaps associated just perfect, a
tiny thumbnail with the filename appears instead of the full image.
This may be something to do with the OLE type being stored as
"Package" rather than "Bitmap image". I couldn't figure out how to
store as "Bitmap Image", even if I did: Me.Picture1.Class =
"Paint.Picture".

2) ActiveX image control - so far, I have found a few ActiveX image
controls, however, ActiveX controls can't be used with continuous
forms.

3) ActiveX grid/list control - I couldn't find a simple datagrid or
datalist component that would simply display the picture and a few
columns. This seems like the most logical way.

Putting a command button with "click to view image" isn't really an
option because we need to be able to see multiple pictures at a time.

I know that Access 2007 is supposed to make this easier, however, it
isn't an option since no runtimes will be released until at least
June.

Has anyone successfully found a workaround to this problem?

Thanks

Apr 14 '07 #1
1 10867
bl*********@gmail.com wrote:
I have been researching for several hours on the best way to display
images in continous forms in Access 2003. For example, I want to
display employee name, email, phone, and picture for each record in
the recordset. I can have the pictures converted to any usable
format, use OLE or linking, whatever needs to be done.

So far, the 3 possible solutions I have found are:

1) OLE objects - if you don't have bitmaps associated just perfect, a
tiny thumbnail with the filename appears instead of the full image.
This may be something to do with the OLE type being stored as
"Package" rather than "Bitmap image". I couldn't figure out how to
store as "Bitmap Image", even if I did: Me.Picture1.Class =
"Paint.Picture".

2) ActiveX image control - so far, I have found a few ActiveX image
controls, however, ActiveX controls can't be used with continuous
forms.

3) ActiveX grid/list control - I couldn't find a simple datagrid or
datalist component that would simply display the picture and a few
columns. This seems like the most logical way.

Putting a command button with "click to view image" isn't really an
option because we need to be able to see multiple pictures at a time.

I know that Access 2007 is supposed to make this easier, however, it
isn't an option since no runtimes will be released until at least
June.

Has anyone successfully found a workaround to this problem?

I solved this issue but creating my own form to mimic a continuous form with unbound
controls and then I handle all the code to place the images in. The form does have some
bound controls for data but the unbound controls I used to mimic continuous forms are
populated in the OnCurrent event.

So as you navigate through the records code retrieves the appropriate image path and fills
the image control.

The drawback is that it requires code so you should be comfortable with working with VBA
code. This code is taken from an old *demo* project. The controls and fields names have
meaning in that context.

Perhaps this sparks an idea for a solution for you.

Const NUM_SUBPARTS_SUPPORTED As Integer = 4

Private Sub Form_Current()
Dim sPath As String

sPath = CurrentProject.Path & "\" ' use the same folder the database is in

' if file exists
If Not IsNull(Me.txtParentPicture) And Len(Dir(sPath & Me.txtParentPicture)) 0 Then
Me!imgParentPicture.Picture = sPath & Me!txtParentPicture
Else
Me!imgParentPicture.Picture = "(none)" ' otherwise display nothing
End If

' load the "sub-form" items here
Dim dbs As Database, rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SELECT * FROM SubParts" & _
" WHERE ParentPartNum = '" & Me!txtParentPartNum & "'")

If Not rst.EOF Then
rst.MoveLast
rst.MoveFirst ' set the recordcount property
End If

Dim x As Integer
For x = 1 To NUM_SUBPARTS_SUPPORTED
If x <= rst.RecordCount Then
' have a valid part
Me("txtPartNumber" & x) = rst!PartNumber
Me("txtPartNumber" & x).Visible = True
Me("txtQtyNeeded" & x) = rst!QtyNeeded
Me("txtQtyNeeded" & x).Visible = True
Me("txtPointOfUse" & x) = rst!PointOfUse
Me("txtPointOfUse" & x).Visible = True
Me("txtDWG" & x) = rst!DWG
Me("txtDWG" & x).Visible = True
Me("txtDescription" & x) = rst!Description
Me("txtDescription" & x).Visible = True

If Not IsNull(rst!PartTopPicture) And _
Len(Dir(sPath & rst!PartTopPicture)) 0 Then
Me("imgTop" & x).Picture = sPath & rst!PartTopPicture
Else
Me("imgTop" & x).Picture = "(none)"
End If
Me("imgTop" & x).Visible = True

If Not IsNull(rst!PartSidePicture) And _
Len(Dir(sPath & rst!PartSidePicture)) 0 Then
Me("imgSide" & x).Picture = sPath & rst!PartSidePicture
Else
Me("imgSide" & x).Picture = "(none)"
End If
Me("imgSide" & x).Visible = True

' do the lines and labels
Me("Line" & x).Visible = True
Me("LabelA" & x).Visible = True
Me("LabelB" & x).Visible = True
Me("LabelC" & x).Visible = True
Me("LabelD" & x).Visible = True
Me("LabelE" & x).Visible = True
Else
' exhausted all sub-records, just set subform controls invisible
Me("txtPartNumber" & x).Visible = False
Me("txtQtyNeeded" & x).Visible = False
Me("txtPointOfUse" & x).Visible = False
Me("txtDWG" & x).Visible = False
Me("txtDescription" & x).Visible = False
Me("imgTop" & x).Visible = False
Me("imgSide" & x).Visible = False
Me("Line" & x).Visible = False
Me("LabelA" & x).Visible = False
Me("LabelB" & x).Visible = False
Me("LabelC" & x).Visible = False
Me("LabelD" & x).Visible = False
Me("LabelE" & x).Visible = False
End If

' if more records, lets see 'em
If Not rst.EOF Then
rst.MoveNext
End If
Next x

rst.Close
Set rst = Nothing
Set dbs = Nothing

End Sub
--
---------------
John Mishefske, Microsoft Access MVP
Apr 15 '07 #2

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

Similar topics

3
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or...
5
by: Robert | last post by:
Hello Accessors I have some reports created in Access that are very good for what they do. However, it seems to me that when you are displaying information you don't need to print out that a...
5
by: Lauren Quantrell | last post by:
I am really stumped on coming up with a good solution for this problem... I have an Access2K continuous form that has an image field. In a SQL Server table of appointments is an integer field...
3
by: Lyn | last post by:
I need some guidance for a technique that will allow me to accomplish the following... I have a table in which each record contains a photograph. I would like to display in a form a thumbnail...
2
by: Lyn | last post by:
Hi, I am struggling to display photographs in a list format. Any help will be greatly appreciated. Originally I had attempted to store photographs as embedded OLE Objects, but had lots of...
5
by: Axel | last post by:
An Access 2000 question Hi is is possible to have (as a subform) a continous form with 0..n buttons which have different images in each row. (Personally I would have preferred a button...
13
by: Jose.M.Huerta | last post by:
I'm trying to display in a continuos form some *.jpg. I have a table with the file path, (a photo of a person). Display these photos in a single form is very easy, just using changing some...
2
by: Phil Stanton | last post by:
Is it possible to display different images on continuous forms. The path to the picture is held in a table, and the photos are held in another folder. I am trying to avoid using OLE Object due to...
5
by: kenethlevine | last post by:
Hello I am fairly new to Access and am having a problem for which I am trying everything without success. It is access 2003. I have a main form. When the user presses a button a modal popup...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.