Connecting Tech Pros Worldwide Help | Site Map

Images on forms

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 01:54 AM
Darren Allen
Guest
 
Posts: n/a
Default Images on forms

Here's some fresh meat for the newsgroup hyenas.

I'm pretty new to setting up Access db's, so please be gentle.

How do I get my user forms to display a linked image file for each record.
(Eg. person's mugshot on a form with their personal details). This sounds
simple, and I'm surprised that I haven't worked it out yet.

I've tried the most obvious ways, but only seem to get the file icon not the
image itself.

Thanks, and sorry for wasting your valuable time.

DA



  #2  
Old November 13th, 2005, 01:54 AM
Deano
Guest
 
Posts: n/a
Default Re: Images on forms

Darren Allen wrote:[color=blue]
> Here's some fresh meat for the newsgroup hyenas.
>
> I'm pretty new to setting up Access db's, so please be gentle.
>
> How do I get my user forms to display a linked image file for each
> record. (Eg. person's mugshot on a form with their personal details).
> This sounds simple, and I'm surprised that I haven't worked it out
> yet.
>
> I've tried the most obvious ways, but only seem to get the file icon
> not the image itself.
>
> Thanks, and sorry for wasting your valuable time.
>
> DA[/color]

Not done it myself but make sure you're working with bitmaps first and
foremost. I don't think Access likes anything else.


  #3  
Old November 13th, 2005, 01:54 AM
fredg
Guest
 
Posts: n/a
Default Re: Images on forms

On Sat, 21 Aug 2004 02:28:23 +1000, Darren Allen wrote:
[color=blue]
> Here's some fresh meat for the newsgroup hyenas.
>
> I'm pretty new to setting up Access db's, so please be gentle.
>
> How do I get my user forms to display a linked image file for each record.
> (Eg. person's mugshot on a form with their personal details). This sounds
> simple, and I'm surprised that I haven't worked it out yet.
>
> I've tried the most obvious ways, but only seem to get the file icon not the
> image itself.
>
> Thanks, and sorry for wasting your valuable time.
>
> DA[/color]

Add a field to your table, [Picname], that stores the name of the
picture associated with the person, i.e. "JohnSmith.jpg"
Store all the pictures in the same folder, but not as part of the
database.

Add an Image control to the form using any image to start with.
Set it's PictureType property to Linked.
After you save the control, delete it's Picture property.

Then code the Form's Current Event:

On Error Resume Next
Me!ImageName.Picture = "c:\Folder Path\" & Me![PicName]

You can use, among others, .bmp, and .jpg picture types.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
  #4  
Old November 13th, 2005, 01:57 AM
Larry Linson
Guest
 
Posts: n/a
Default Re: Images on forms

"Darren Allen" wrote
[color=blue]
> Here's some fresh meat for the
> newsgroup hyenas.[/color]

Eh? Would you care to clarify whether that was intended to be "cute" or
insulting?
[color=blue]
> How do I get my user forms to display
> a linked image file for each record.
> (Eg. person's mugshot on a form with
> their personal details). This sounds
> simple, and I'm surprised that I haven't
> worked it out yet.[/color]

. . .
[color=blue]
> Thanks, and sorry for wasting your valuable time.[/color]

If we thought answering questions in newsgroups was a waste, chances are
high that we wouldn't do it. Most of us have been helped many, many times
and the only repayment ever asked was that, when able, we help someone else.

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.zip 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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.