By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,949 Members | 2,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,949 IT Pros & Developers. It's quick & easy.

Picture changes when record changes

P: n/a
Hi fellas,

Im setting up a form in my Access project and I need to implement this
rather special fucntion.

This function is basically simple to understand but I really dont know
how to create it. I need to implement a function that each time their
is a record navigation a picture changes.

Meaning = lets say I have a field with the word "football" in it - and
their is a picture of a football next to it. Then I change record =
changed into "rugby" and then their is a picture of a rugby ball next
to it.

How can I do that function?

Cheers..
nickybon

May 2 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On 2 May 2006 09:24:39 -0700, ni******@msn.com wrote:
Hi fellas,

Im setting up a form in my Access project and I need to implement this
rather special fucntion.

This function is basically simple to understand but I really dont know
how to create it. I need to implement a function that each time their
is a record navigation a picture changes.

Meaning = lets say I have a field with the word "football" in it - and
their is a picture of a football next to it. Then I change record =
changed into "rugby" and then their is a picture of a rugby ball next
to it.

How can I do that function?

Cheers..
nickybon


Code the Form's Current event:

If Me![FieldName]= "Football" Then
Me!ImageName.Picture = "C:\PathToPicture\Football.jpg"
Elseif Me![FieldName]="Rugby" Then
Me![ImageName].Picture = "C:\PathToPicture\Rugby.jpg"
Else
Me![ImageName].Picture = "C:\PathToPicture\Cricket.jpg"
End If

Place the same code in the [FieldName] AfterUpdate event.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
May 2 '06 #2

P: n/a
Hi.. Thankx alot for your help.. but there seems to be a problem with
the format..

Can you please explain it to me step by step.. Thankx once again

Nick

May 2 '06 #3

P: n/a
Hi.. Thankx alot for your help.. but there seems to be a problem with
the format..

Can you please explain it to me step by step.. Thankx once again

Nick

May 2 '06 #4

P: n/a
On 2 May 2006 10:32:17 -0700, ni******@msn.com wrote:
Hi.. Thankx alot for your help.. but there seems to be a problem with
the format..

Can you please explain it to me step by step.. Thankx once again

Nick


I don't understand what you mean by "Problem with the format".
Did you add an Image control to the form?
Do you have a Field that contains just the one word 'Football' or
'Rugby', etc?
Did you enter the correct Path to the picture, as well as it's name?

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
May 2 '06 #5

P: n/a
Hi Fred,

I couldnt understand the codes you gave me. Can you tell me what I have
to do? Go to design view? what?

Nick

May 2 '06 #6

P: n/a
On 2 May 2006 14:11:55 -0700, nickybon wrote:
Hi Fred,

I couldnt understand the codes you gave me. Can you tell me what I have
to do? Go to design view? what?

Nick


In Form Design view, add an Image Control to the form.
Take note of the name of this control.

Then still in form Design View, display the Form's Property sheet.
Click on the Event tab
On the line that says On Current, write
[Event Procedure]
Then click on the little button with three dots that appears on that
line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Write:

If Me![FieldName]= "Football" Then
Me!ImageName.Picture = "C:\PathToPicture\Football.jpg"
Elseif Me![FieldName]="Rugby" Then
Me![ImageName].Picture = "C:\PathToPicture\Rugby.jpg"
Else
Me![ImageName].Picture = "C:\PathToPicture\Cricket.jpg"
End If

Between those 2 lines.

Change [FieldName] to whatever the actual name is of the field that
contains the word 'Football', or 'Rugby', etc.
Change [ImageName] to whatever the name is of the Image control you
added earlier.
Change
"C:\PathToPicture\"
to whatever the actual path is to your picture.
Change
Football.jpg
to whatever the actual name and extension is of your picture.

When done, save this code.

Then place the same code in the [FieldName] AfterUpdate event.
Click on the [FieldName] control.
Show it's property sheet. Click on the Event tab. Write
[Event Procedure]
on the AfterUpdate line. Click on the button with 3 dots and follow
the same instructions as you did for the Current event.

Save these changes as well.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
May 2 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.