Images on a Form [ms Access 2007]

B

Bob Matthews

I do volunteer work at a local Museum.

I have set up an Access DBase using ms Access 2007.
It has an image table - each record lists several details about a scanned
image the Museum holds and the last field holds the full Image Path.

The Image Form shows the details one record at a time and has an Image Frame
on it.

How do I code the form so that the Image changes as each record changes?

Bob
 
S

Stuart McCall

Bob Matthews said:
I do volunteer work at a local Museum.

I have set up an Access DBase using ms Access 2007.
It has an image table - each record lists several details about a scanned
image the Museum holds and the last field holds the full Image Path.

The Image Form shows the details one record at a time and has an Image
Frame on it.

How do I code the form so that the Image changes as each record changes?

Bob

Use the form's current event (which fires whenever the form moves to a
different record)
 
S

Stuart McCall

Bob Matthews said:
Hi Stuart

Could you explain a little more - I am very new to Access

Bob

Ok. Open your form in design view, open the properties window if it's
closed. Click on the event tab and locate the Current event. Beside this
entry, type [

Access will expand this to read [Event Procedure]. Click on the build button
(the one with three dots). That should open a code window and create a
'skeleton' procedure for you to type code into. Say your image control is
called Image1 and the 'last' field you mention is called LastField, type the
following:

Me.Image1.Picture = Me!LastField

Replace those two names with your actual ones.
Switch the form to form view and test by moving through the records.
 
M

Mark Andrews

Bob,

I have a very simple Access2007 application I wrote for a historical society
that might interest you.

I'll also help you out for free if you need a little code help to tweak your
existing application.

Learning about what you are doing for this museum might help me in the long
run if I decide to write some polished museum software. I'm toying with the
idea of creating something like "past perfect" if you have heard of that
one.

Send me an email if interested,
See my website for contact details,
Mark Andrews
RPT Software
http://www.rptsoftware.com
 
B

Bob Matthews

Thanks Stuart

First record OK but then ........

I get a run-time error 2220 - can't open file c:\...... where this is the
path for the second image ?

Bob M




Stuart McCall said:
Bob Matthews said:
Hi Stuart

Could you explain a little more - I am very new to Access

Bob

Ok. Open your form in design view, open the properties window if it's
closed. Click on the event tab and locate the Current event. Beside this
entry, type [

Access will expand this to read [Event Procedure]. Click on the build
button (the one with three dots). That should open a code window and
create a 'skeleton' procedure for you to type code into. Say your image
control is called Image1 and the 'last' field you mention is called
LastField, type the following:

Me.Image1.Picture = Me!LastField

Replace those two names with your actual ones.
Switch the form to form view and test by moving through the records.
 
S

Stuart McCall

Bob Matthews said:
Thanks Stuart

First record OK but then ........

I get a run-time error 2220 - can't open file c:\...... where this is the
path for the second image ?

Bob M
<snip>

Well if the path to the file is correct (I assume you double-checked), then
Access is telling you that the file is faulty, or that it can't load it for
some other reason, such as it being a non-recognised file type.
 

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