Showing a picture on a form from a table

L

Lila

I have two tables. One is a list of furniture, the other a list of fabrics.
The fabric list has pictures of the fabric embedded. When you're in the
furniture list table, I created a drop down that looks to the fabric table
for it's
values.

So now I have this form that is based on a query that looks at the furniture
list (and does some basic mathmatical equasions). The query does some cost
calculations as well. Everything is working fine and showing up on the form,
except I'd like the picture of the fabric swatch to show up and change based
on what fabric is selected.

I'm not sure if I should try (or even if it's possible) to create some sort
of lookup field in the original table or if this is something a query would
do... or maybe even something on the form.

Any suggestions?
 
K

Klatuu

First suggestion. Don't embed images. You will soon blow the 2Gig size
limit. Keep your images is a seperate folder for that purpose and link to
them.
Create a field in your table that is a hyperlink data type and store the
path to the image.
 
S

Steve

There is a form in the Northwind sample database included with Access that
displays employee pictures. You might check that out to see how it is done.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
L

Lila

That is a good suggestion. I created a Hyperlink field, so how do I show the
actual picture on the form?
 
L

Lila

This is a great idea, and I like the way it's handled. I have imported the
employee form, but when I try to use the "Add" button I get an error message:

Compile Error
Variable not defined

Then the VB editor comes up with (msoFileDialogFilePicker) highlighted

The entire line is:
with application.filedialog (msoFileDialogFilePicker)

I don't know enough VB to know where to define the variable. What now?

Lila
 
L

Lila

I ended up just copying the northwind database to a new name and importing my
tables, forms and queries into it so the error message does not show up.

Thing is, my initial question still remains. I have two tables, one
furniture and one fabric. I have a fabric form where you define different
properties of the fabric (including a link to a picture file as the northwind
example shows). I have another form (item number) which draws it's
information from a query (item data) that basically draws from the furniture
table and does some simple math equations.

Each peice of furniture can have up to 3 different fabrics defined within
it. I have created three fields in the furniture table that use a lookup to
get the information from the fabric table. I would like to show a picture of
the fabric on the "item number" form that changes based on the fabric
selection.

I have a feeling I have to create an event proceedure to accomplish this,
but I don't know enough about VB to write the code. Can someone help?
 
S

Steve

To start, you have two problems with your database. The design of your
tables is not correct and you are using lookups. Consider using tables that
look like:
TblFurniture
FurnitureID
FurnitureDescription
<<Other fields that describe a piece of furniture>>

TblFabric
FabricID
FabricName
FabricPicturePath
<<Other fields for properties of the fabric>>

TblFurnitureFabric
FurnitureFabricID
FurnitureID
FabricID
<<Fields describing where a certain fabric is used on the piece of
furniture>>

I haven't included your concept of Item because there is not enough
information to tell what it is.

Re: Lookups - It is frequently advised in the newsgroups to not use
Lookups. You will find a list of reasons at www.mvps.org/access.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 

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