No Picture Found...

G

Guest

hi, i have a table which stores suppliers and info about them, including
their logo.
Using OLE Object
The logos are embedded into the table, I know big file size, but means true
portability...

Several of the records don't have an image...

Can i make the form show a "No Image Found" Image, when there isn't a image
found within the table?

Would something like the following work on loading the record

If Logo.Image = "" then
'Code to show "no Image found logo"
End if

What would the syntax be?

And could I embedd the image into the system, like I've done with the other
products?

Should I create a table with one row, and the embedded image via OLE object?

Thank you for any help
 
G

Guest

1. True portability? Yes and no. You will have serious bloating and you
will eventually have to address the issue. I say this to you because, I did
as you have done and it eventually came and nipped me in the butt, so I had
to do as all the nice people here had originally told me and not embed the
images. Nothing simpler simply have your db housed in a folder and all the
images saved to that folder. You still have your portability as you need
only copy/move the folder. And if you code things right, your db should be
capable of adjusting the paths to the images based on the current db path.
Think about it I urge you!

2. Now for your real question, I simply created a 'No Image Available'
image and using your code If Logo.Image = "" then... load it instead. Works
like a charm.
 
G

Guest

Hi Daniel P

Thank's for your help.

My Supplier's table is only going to have Maybe 10-20 Suppliers, and with
their logos at less than 50kb each, bloating shouldn't be too much of a
problem.

When Access Loads up, it only loads the forms that are needed now? Having a
huge DB fiel size slow loadup?

I have my image displaying as an OLE Object within a form.
The control name where the image is located is called "LOGO"
That's the control's um can't think of what it's called the bit after the
dot...
Logo.THISBIT what do I put there to see the contents?
ie,

IF textbox1.text = "" 'I can presume there is nothing in the field.

IF Logo.WHAT? = "" ' What's the bit I'm missing?

Thank's for your continued support,
 
G

Guest

Here a bit of code I Used in the past aapted to your needs,

if textbox1.text = "" then
Me.LOGO.Picture = "nopic.jpg"
esle
Me.LOGO.Picture = textbox1.text
End if

I used the on_current event of the form to change the displayed image as my
users moved through the records of the database.
--
Hope this helps,

Daniel P
 
G

Guest

Sorry, it's not a case of me needing to test the contents of the textbox, I
just gave that as an example.

I need to test the contents of the OLE object, names LOGO.

Can I test a blank value with the following:

IF Me.Logo.Picture = "" then
me.logo.picture = "Nopic.bmp"
end if
 
G

Guest

Sorry, o0ne other thing:

where do I need to place "nopic.bmp" in the file folder at the access db?

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top