473,724 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to display multiple pictures per record in an Access database?

I want to store and display (on a form or a report) multiple pictures
per
record in an access database. The pictures are not stored within the
database. They are stored as files and the database contains the paths
to the
pictures.
The database consists of two tables:

TABLE DATA
ID Name LastName

TABLE PICTURES
ID Path

I want to create a form displaying data for each record of TABLE DATA
and
all the pictures (let's say aligned horizontally) for the particular
record
from TABLE PICTURES (ID <-> ID). MS Access allows subforms to be added
to a
form, but this doesn't solve the case, since subforms can be only
displayed
in data sheet view.

Nov 13 '05 #1
12 20926
"Wadim Grasza" wrote
I want to store and display (on a form
or a report) multiple pictures per record
in an access database. The pictures are
not stored within the database. They are
stored as files and the database contains
the paths to the pictures.
The database consists of . . .
I want to create a form displaying data for
each record of TABLE DATA and
all the pictures (let's say aligned horizontally)
for the particular record from TABLE
PICTURES (ID <-> ID). MS Access allows subforms to be
added to a form, but this doesn't solve
the case, since subforms can be only
displayed in data sheet view.


Where in the world did you get the idea that they can ONLY be displayed in
datasheet view? The wizard creates that, by default, but you can certainly
set the Source Object of the Subform Control to a Form and display the data
in that Form within the Subform Control.

Unless you have a strict limit on the number of pictures, trying to align
them side by side could be problematical -- what happens when you have one
too many to fit on the line?

For reports, use a Query for Record Source, joining Table DATA and Table
PICTURES, use the Sorting and Grouping properties to create a Group on ID in
Table Data and each picture as a "detail line" in the Detail Section.

A Form/Subform with single record view of a Form in the Subform control
might work will for the Form where you enter / edit data.

Here's some additional information: The sample imaging databases at
http://accdevel.tripod.com illustrate three approaches to handling images in
Access, and the download includes an article discussing considerations in
choosing an approach. Two of the approaches do not use OLE Objects and,
thus, avoid the database bloat, and some other problems, associated with
images in OLE Objects.

If you are printing the images in reports, to avoid memory leakage, you
should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm.
PrintFailure.zi p is an Access97 MDB containing a report that fails during
the Access formatting process prior to being spooled to the Printer Driver.
This MDB also contains code showing how to convert the contents of the Image
control to a Bitmap file prior to printing. This helps alleviate the "Out of
Memory" error that can popup when printing image intensive reports.

Larry Linson
Microsoft Access MVP

Nov 13 '05 #2
Amazing, asking exactly the same question again with exactly the same
misinformation. It is NOT true that "subforms can only be displayed in
datasheet view". I'm not sure if it was here or in another newsgroup where I
answered your question. I suggest you visit http://groups.google.com, search
for the original posting, and review the answer there.

Larry Linson
Microsoft Access MVP

"Wadim Grasza" <Wa**********@g mail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I want to store and display (on a form or a report) multiple pictures
per
record in an access database. The pictures are not stored within the
database. They are stored as files and the database contains the paths
to the
pictures.
The database consists of two tables:

TABLE DATA
ID Name LastName

TABLE PICTURES
ID Path

I want to create a form displaying data for each record of TABLE DATA
and
all the pictures (let's say aligned horizontally) for the particular
record
from TABLE PICTURES (ID <-> ID). MS Access allows subforms to be added
to a
form, but this doesn't solve the case, since subforms can be only
displayed
in data sheet view.

Nov 13 '05 #3
I am absolutely sure that your amazement will be deemed after you learn
that this question was asked in multiple groups simultaneously.
Nevetheless, no-one seems to competent enough to solve another problem
that I have posted in the newsgroups, which is: how to display multiple
(the number may vary) images per record on an Access form or report
HORIZONTALLY.

If anyone knows the solution, please respond.

Nov 13 '05 #4
"Wadim Grasza" <Wa**********@g mail.com> wrote
I am absolutely sure that your amazement will be deemed after you learn
that this question was asked in multiple groups simultaneously.
Were you this rude in all of them?
Nevetheless, no-one seems to competent enough to solve another problem
that I have posted in the newsgroups, which is:
Either that or nobody was impressed by your approach
how to display multiple
(the number may vary) images per record on an Access form or report
HORIZONTALLY.

If anyone knows the solution, please respond.


I'm sure several people do.

Here's one way:

1. Create a form with the maximum hard coded image controls in the layout
you want.

2. Iterate through your fields in code and set the image's photo property
to the filed text (which I assume contains only a photo name)

While the following is not exactly as you want, the principle is the same -
24 image controls are laid out (actually on a 6-page tab control), and named
img1 through img24, and filled and made visible if a photo record exists.
In my case, I've already controlled for the max limit of 24 photos when I
created the records.

Dim c As Integer
Dim i As Integer
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset

DoCmd.Echo False, "Fetching Photos"
c = 0
With rs
.Source = "SELECT photo_name FROM photo WHERE photo_off_id=" & id
.Open , CurrentProject. Connection, adOpenKeyset, adLockOptimisti c,
adCmdText
Do While Not .EOF
If FileExists("C:\ photos\" & .Fields(0)) Then
c = c + 1
Me("img" & c).Picture = "C:\photos\ " & .Fields(0)
Me("img" & c).Visible = True
End If
.MoveNext
Loop
.Close
End With
DoCmd.Echo True

--
Darryl Kerkeslager

Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927
Nov 13 '05 #5

"Wadim Grasza" <Wa**********@g mail.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
I am absolutely sure that your amazement will be deemed after you learn
that this question was asked in multiple groups simultaneously.


I am amazed that someone so incredibly self-assured would not have known
that multi-posting is incredibly irritating to people who provide answers,
and that cross-posting (that is, listing all the newsgroups in the same
post) will result in followups (answers and additional dialog) will appear
in all the newsgroups, so that the threads will not diverge. For other good
suggestions on effective use of newsgroups, see the FAQ for this newsgroup
at http://www.mvps.org/access/netiquette.htm.

Frankly, at this point, I am not sufficiently motivated to give you an
additional answer to go and google to see all the exchanges in those
multiposted newsgroups. If you'd care to carefully review your question, the
answers, and clarifications you have made and start a new thread, perhaps
someone will have an answer for you.

You significantly decrease your chances of getting the answer you need when
you make it difficult for the potential responders and when you respond
defensively to irritate them.

Larry Linson
Nov 13 '05 #6
Thanks for your help.

I'm still looking for a solution because this one creates a limited
number of image controls. My objective is to have the number of image
controls not limited.

Thanks again.

Nov 13 '05 #7
To respond to your message: I appreciate your advice. This message has
been sent to one group only so there will be no 'exchanges'.

After reviewing my question, the answers, and clarifications the
following should clarify my problem lastly: How to horizontally display
multiple (number not limited) images per record on a form or a report?

Nov 13 '05 #8
"Wadim Grasza" <Wa**********@g mail.com> wrote
I'm still looking for a solution because this one creates a limited
number of image controls. My objective is to have the number of image
controls not limited.


I suppose you could count the images to be created, open the form in design
view, dynamically create the image controls, then proceed ... but what a
pain in the butt for users to use a form that would scroll horizontally
forever.

--
Darryl Kerkeslager

Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927
Nov 13 '05 #9
This might be a good solution. But please notice that the image
controls have to be created on the OnCurrent event, because the number
of images and the images themself differs depending on a record. I
don't know if it's possible to switch to Design mode, while on the
current record, create some controls, and then go back to Form View
mode. And event if it's possible, is it optimal? I wish controls could
be created in Form View mode.

Anyway, thanks for the suggestion.

Nov 13 '05 #10

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

Similar topics

3
2226
by: Chumley the Walrus | last post by:
IN my code behind .vb page for a delete records script (this also does a deletion confirmation with a javascript popup, this gets called on my front .aspx page with the datagrid), I'm not sure if he row.delete() in my Delete_Row sub is correct because when deleting a record from the dbase, it doesnot get deleted from the actual database, even tho on the datagrid it does show that the record is deleted: '''''''''''''
9
1966
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual Basic .Net application. I have researched MSDN for help and found the example article 321900 (see below) and set up a test and everything works fine when I use SQL Server 2000 but when I modify the code and use data from Access 2000 using an...
3
2675
by: Pedro Maria Ferro da Cunha | last post by:
I spend a lot of time making 2 thousand pictures and saving them as an article name. jpg. I have a table with the article name and name of the file in jpg (format). How can I make an instant attach to the database instead of adding picture
3
10656
by: RAllsopp | last post by:
I have a client who would like to have several pictures associated with one system. I have read about storing only the pathname to save OLE overhead and have set-up a form for my client to browse/add one picture at a time to a system. Now he would like to 'view' all of the thumbnails associated with any system on a single form. I can setup a main/subform scenario, but how do I show all of the pictures as thumbnails. I was using the...
0
1311
by: Ian | last post by:
I have an Access 2000 database in which I display many pictures on reports, the pictures are not embedded, the database just stores the path to where the pictures are stored. When I select Gifs, Tifs, BMP etc the pictures appear on the forms and reports. However when I select .JPG format they don’t appear, no error message simply a white square where the picture should be. I have used this database for several years on a different PC...
1
3065
by: Ian | last post by:
I have an Access 2000 database in which I display many pictures on reports, the pictures are not embedded, the database just stores the path to where the pictures are stored. When I select Gifs, Tifs, BMP etc the pictures appear on the forms and reports. However when I select .JPG format they don’t appear, no error message simply a white square where the picture should be. I have used this database for several years on a different PC...
2
16675
by: smorrison64 | last post by:
I have a form that is coded to open a File Dialog boc to pick a picture to display on that particular item on a subform. My form is not based on query, but rather two separate tables (one primary, one sub). That code is working properly. How do I get that to translate to my report? I use VBA code because I use formats other than BMP for the pictures. Would basing the form on the qury that the report is based on solve the issue without...
3
5941
by: Ian | last post by:
I have a form with a sub form, on the continues sub for I want to display some data along with a picture, on the On Current event I have the code: .Picture = Nz() is the name of the picture control, is the name of the text field that holds the path to the jpg. What I want is each record in the sub form to show the associated
46
10084
by: OldBirdman | last post by:
What a mess this question is. I have spent 2 weeks trying to make it concise and clear, and I can't. I do not have the vocabulary for the question. I cannot even TITLE it correctly. Here is my best effort. Conditions: 80,000+ pictures (These are pictures of birds, ID by Species, Sex, Age, etc. (If known)) Hierarchy of folders: Continent->Country->State(if India, Mexico, USA, Canada, & Australia) (No state for other countries) I am...
0
8868
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8741
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9388
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9090
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8062
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5996
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4764
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3209
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2149
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.