• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

How do I use a Picture stored in a database on an unbound object in a form

I have a created a form that has room for a relatively small jpeg picture ont the form header.
I have therefore created a local parameters table with a single record and one of the fields is an OLE field where I have saved the JPEG.
I have inserted an unbound image object on my form and I would like the object image source to be =DLookUp("MainPageImage","tblLocalParams").
Is there any way of doing that?
I don't know where/how to load the code.
0
Rob4077
Asked:
Rob4077
  • 2
  • 2
2 Solutions
 
Rob4077Author Commented:
BTW, I am developing this in MS Access 2007, in case that makes any difference.
0
 
Aaron TomoskySD-WAN SimplifiedCommented:
Sidenote:
If you have more than a few of these it's a bad idea. If you store a few images in access for background or tab purposes that's fine, ideally they should be .bmp so access doesn't waste a bunch of memory converting them.
If this is a picture tied to a record don't do it this way. Store the filename in the db and just have a folder with the files.
0
 
GRayLCommented:
I think it's a bad idea to store images in tables directly.  If you have the jpg named FormPic.jpg in the folder in which your mdb resides, insert this code in the Load event of the form on which you placed an unbound Image control named imgPic

Private Sub Form_Load()
  Me!imgPic.Picture = .\FormPic.jpg
End Sub
0
 
Rob4077Author Commented:
Thanks for your comments. My intention was to store only one small picutre in the database but given your comments I won't even store that. I will do it as GRayL suggested and get the users to save their preferred picture in the same folder as the application with a common name. Thanks.
0
 
GRayLCommented:
Thanks, glad to help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now