Solved

Type mismatch loading image from file

Posted on 2002-07-03
2
198 Views
Last Modified: 2012-06-27
Whenever I run the following command:

Image1.Picture = App.Path & "\" & ListView1.SelectedItem.ListSubItems(3).Text

I get a type mismatch error on the "&" symbol.

Can someone help me figure out how to load an Image.picture with a file on my hard drive?
0
Comment
Question by:perkster
[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
2 Comments
 
LVL 45

Accepted Solution

by:
aikimark earned 50 total points
ID: 7128277
try
Image1.Picture = LOADPICTURE(App.Path & "\" & ListView1.SelectedItem.ListSubItems(3).Text)
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7128493
Yup...points to aikimark

The picture property is a picture object, not a string...the file path is a string, so you get a type mismatch.

To get a picture object, you need to "convert" the string, which is what LoadPicture does.
0

Featured Post

Technology Partners: 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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

691 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