Solved

Type mismatch loading image from file

Posted on 2002-07-03
2
193 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now