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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Picture in my report 34

Status
Not open for further replies.

strantheman

Programmer
Mar 12, 2001
333
0
0
US
Ive searched all of the Access forums, and I haven't found a solution that works. This seems like a very common procedure so im sure someone out there can help.

My ITEM table looks like this:

name | imagepath
-----------------------------------------------
Linksys Cable/DSL Router | d:\lsBEFSR41.jpg
Netgear Switch | d:\ngFS105.jpg

Name is the name of the product, and imagepath is where the photo is stored on my drive. My report pulls NAME, IMAGEPATH from ITEM table for the specified ID. I want to show the name of the product, and its corresponding picture on my report.

For this discussion, lets say the two objects on my report are named itemName and itemImage. I would assume this is as simple as setting some property of itemImage to the IMAGEPATH field, but ive been unable to figure this out. Please provide any help that you can. Id be willing to receive an email with a sample MDB file if thats what I have to do.

thanks in advance, im really hurtin here.
 
Yes, the basic need is scrolling through pictures. I already have a single form that handles item by item viewing.

However, thank you for that suggestion. It might be a compromise given the ability to view all items, and then see if the picture matches. I will try it out to see how it functions.

I really appreciate all this forum information. Working in Managua, I don't have much access to resources, at least in English.

Gracias de Managua, Nic.
 
Follow this link as there may be some additional information that may help you here:


With a large database and a linked image to each record a continuous form would have to load completely and this would carry some serious overhead. It would have to decode literally thousands of images before the continuous forms is displayed. Is there a way to par down the category that someone would be looking at in your databse. Let's say by creating a query on the fly from drop downs you would reload your subform with only the records that are related to their needs. Then a single form that they could walk through individually record at a time with the navigation keys would allow you to display an image for each record. Just another thought.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Its times like this I can't wait for MS or JET or whomever to implement the LIMIT keyword. Its so handy to handle records in chunks rather than all at once.

Yes, I am thinking a search form to limit the # of records, create a query and then let the user choose from the record subset. In theory.

Thank you. I will take a look at the link.

 
For the record, I 'found' a solution to the problem I was refering to . I looked at DbPics, and though I have not used the library yet, their code was close to what i needed.

The trick is to not bind any data in the form, and use ADO paging to create forms with multiple images without using continuos forms, but allowing the user to have a picklist of images and data. I would be happy to share more details.

Having said that, I still am having new troubles with how to take this recordset of data, and apply search functionality to the picklist. I don't know how , if its even possible, to change the source of the ADO recordset and requery.

I have a fairly complex search form that applies a SQL query to a subform source, and works well, but how to take the picklist functionality and combine it with a form that generates a SQL query has eluded me.
 
Don't know if anyone still is answering questions here but I thought I'd post anyways.
2 Questions:
So far so good. I have the button that inserts the file name in the ImageLink text box. The picture then shows on the FormImage spot.
1 problem is that I get a type mismatch when I click on New Record. I do have the default of that field set to the NoImageAvailable.jpg file. Any Ideas?

The 2nd question is how exactly does that relative path code work above...not sure if I'm using it correctly.

Thanks,
Jeff
 
I think I just may have figured it out.
For the type mismatch I put this for my code in the OnCurrent Event:
Code:
Private Sub Form_Current()

Dim strImagePath

strImagePath = Me![ImagePath]

If IsNull(strImagePath) Then
Me![FormImage].Picture = "..\Images\NoImageAvailable.jpg"
Else
Me![FormImage].Picture = Me![ImagePath]
End If
End Sub

I don't get any error with that. Works like a charm.
And you don't have to have a default present!

As far as my other question went. Am I correct on assuming that with Danvlas's code pasted in a module that it already works with my forms and what not?

Thanks again!
 
I have another question.

I want to be able to view pcx images on an access form. I have a form with two subforms in it. One subform (lets call it sbfrm1) has a list of the images and their file paths (plus extra information about the images). The other subform (sbfrm2)is linked to the 1st subform. I am able to display one image on sbfrm2 based on the current record selected in sbfrm1. I believe the only problem is that I cannot use a pcx image. We use pcx images for production and I do not want to create another set of images for viewing in Access.

I have also tried to make a textbox that is a hyperlink. The textbox contains the link to the image I want. Access is telling me that it cannot open the hyperlink. Any suggestions?
 
Dear friends,

I join the people who value this most informative thread.

Here's another wrinkle. With the help of the suggestions here I have worked up a nice yearbook-style report of photos of members of a choir.

Now the director wants it available as a file (apparently he'll want to e-mail it to others). Convert to Word and I just get the members' names, with no image. I am thinking of writing code to build an Excel sheet, embedding the images in to appropriately-sized cells and the names into cells below.

I don't know that it would be that hard to do this, but I'd lose pagination and header/footer info that I get in the Access report. Is there any easier way that I just don't know about? Snapshot would not be appropriate, as not everyone has Access.

thanks,
p
 
The easiest & best way would be to print it to a PDF document. TO do this you'll need one of the multitude of PDR printer programs out there. You don't have to pay the massive price of Adobe, there are cheaper alternatives. Personally I have had good results from Zeon Docucom but there are loads out there, from as little as $9.95.

hth

Ben

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
Another idea for making a report file that I have used is to make a report that is essentially html code. Then create a button that executes the report, saves it with an .html extension and opens it with a browser. It's been a while since I did this, so I'm sure there are plenty of details I'm not explaining, but that's just the presentation of a general concept. If anyone wants actual code, I can provide that too.

On to what I came here for though... this has been a very informative thread that I have read completely. I think my question may have already been answered, but somehow I am missing it. I'm looking for a simple continuous form with a picture on each record. Like so:

----
Bob Pic of Bob
----
Fred Pic of Fred
----
Bill Pic of Bill

I have:

---
[Name] [Path](hidden) [Picture]
---

but of course using the infamous <Me![Picture].Properties("Picture") = Me![Path]> code, I get a picture of Bob on every record. If this has already been answered, could anyone point me to it, or maybe re-summarize.

thanx,

Jim
 
I believe that Access does not allow you to view the pictures how you want in a continuous form. A subform with the picture that is based on the current record the user selects works.
 
There is code on my site which does as iamjimbo suggests. It's the quiz file on the downloads page and, whilst it doesn't do exactly what you require, it's a start on the general concept and idea.

With regards to the continuous form, as mbcruella says, it's not possible the way you want, but you can embed a subform very easily.

hth

Ben

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
Ok, I must be dumb as a box of rocks or something because for some reason I just can not get the image to show up on my form when I use
me![PictureImage].picture = me![ImagePath]
I keep getting an error "Micorosoft Access can not find the Macro me!PictureImage"

Here is what I have done. I created a Field in my table called ImagePath and placed it into my query and then placed the query item onto the form. Now, on the form I created an Image frame and named it PictureImage and followed the instructions at the begining of this forum. I am placing the
me![PictureImage].picture = me![ImagePath]
in the OnCurrent event of the Form. When I open the form it runs the query but gives me the error that I put above. Is this not what every one was doing or am I just going about it all wrong?

Thanks
Chris
 
I haven't been on the site for some time but the format that I posted initially was the following:

Me![PictureImage].Properties("Picture") = Me![ImagePath]

I think you have modified this somewhat and that me be causing your problem. Use the format above and see how that works.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
And don't forget to set the OnCurrent property to [Event procedure] and then click the ellipsis (...) for typing the code.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Ok, I got it to work like a charm.. Now I am working on the button for the user to select the picture path. When I try to add the ActiveX control to the form it gives me some error that I do not have rights to use it or something like that. I am not at home right now so I can not give the exact message but I am going to try to register it and see if that fixes it..
Thanks for your help Scriverb and PHV =)
 
Ok, here is the error that I am getting:
"You don't have the license required to use this ActiveX Coltrol"

Any Ideas?
 
I know that I keep posting to this forum with questions and then I figure them out afterwards... Sorry
I got the ActiveX to work but am running in to a snag with the code

CommonDialog1.ShowOpen
MsgBox "Filename: " & _
CommonDialog1.FileTitle
MsgBox "Path: " & Left$(CommonDialog1.FileName, _
Len(CommonDialog1.FileName) - Len(CommonDialog1.FileTitle))
MsgBox "Path: " & CommonDialog1.FileName
Me![Photo] = CommonDialog1.FileName

For some reason it is having a problem with the last line
Me![Photo] = CommonDialog1.FileName
[Photo] being the text box that is going to store the file path. Once it hits this part it goes into Debug mode.
 
When you run the code what does the below code display?

Code:
MsgBox "Path: " & CommonDialog1.FileName


[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top