Solved

Change picture based on the recordsource

Posted on 2011-02-27
4
210 Views
Last Modified: 2012-06-21
I am trying to change the image shown on a continuous form based on the return value of the records field.

Using a subfrom that has a continuous form type
An image control (imgAsset)

RecordSource= "SELECT imgType From...."

imgType currently:   1 = img1, 2 = img2
(I can switch this in the sql to bring back the picture name if needed)

so basically on each row for the imgAsset I want this:

with imgAsset
select case imgType
 case 1: .picture = "img1"
 case 2: .picture = "img2"
end with

do I do this in the control source...what is the best way.

tnx experts


0
Comment
Question by:skillilea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 14

Expert Comment

by:Bill Ross
ID: 34991764
Hi skillilea,

As you've probably found by now, in a continuous form imgAsset will always have the same picture unless it is a bound object.  You cannot assigne a separate picture to each row unless it's bound to the picture in the recordsource.  That's because an unbound object is just a single object repeated for each row in a continuous form.

Regards,

Bill
0
 
LVL 14

Accepted Solution

by:
Bill Ross earned 500 total points
ID: 34991780
Hi,

To make this work correctly you need to use a bound object frame that is bound to the image that is stored in the recordsource.  You're on thre right track by having the SQL return the picture.  Bind this field to the imgAsset and it should work.

Bill
0
 

Author Comment

by:skillilea
ID: 34991878
I ended up with this in the controlsource of the imgControl.

=Switch([AssetType]=1,"p_tool",[AssetType]=2,"p_part",[AssetType]=3,"p_book",[AssetType]=4,"p_innogear",[AssetType]=5,"p_who")


good until I have img changes and additions I think.

Other way would be to store the image file but...I'm not excited about that.

Thanks tons for the help.

sk
0
 
LVL 14

Expert Comment

by:Bill Ross
ID: 34992034
Glad to be of help.

Bill
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question