473,473 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Picture changes when record changes

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
6 8753
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: khan | last post by:
I want QTY on hand to be updated when record in detail sale is deleted. can any one help
13
by: Jim M | last post by:
I've been playing with Allen Browne's audit code and found it very useful. I need to track record insertions, deletions, and edits for several tables. I am planning to replace Access with Microsoft...
2
by: Luis Esteban Valencia | last post by:
Hello I have a datagrid with a dropdownlist that has the products, another column has the price of the product and when the user changes the product it also must change the price how can I achieve...
1
by: mike | last post by:
Hi, I'd like advice from a .NETer. I have a loadcombo routine which sets the selectedindex to -1 if it's an "add record", but then it goes to a security routine which, based on permissions...
7
by: ljlevend | last post by:
Is there any way (either .NET or API) to detect when Windows.Forms.Form.ActiveForm changes? Thanks, Lance
30
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and...
1
by: zadkiel | last post by:
Hi all! Recently i need to urgently perform an audit trail for my newly built system. I have gone thru many threads about using trackchanges() function at beforeupdate to record the changes made in...
2
by: mvmashraf | last post by:
How can I make an IFRAME resize itself when someone changes their resolution? I have a table in that i am loading that iframe, I did give the width of Iframe and the width of table as 100%, What...
2
by: angi35 | last post by:
I hope this is an easy question for someone out there. In Access 2000…I have a MainForm with a tab control (MAIN TABS) with 7 tabs. Within each tab is a SubForm. Within each SubForm is a tab...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.