Solved

Object Title is a Long

Posted on 2003-10-27
5
139 Views
Last Modified: 2010-08-05
I have a Long variable called ImageName that can go anywhere from 0 to infinity. It works with the following code that is designated to make a new image:

Set myImage = FormName.Controls.Add("VB.image", ImageName)

There is one problem though; ImageName must be a string, therefore an error is present if it is a Long. So basically, my question is, how can I do it so ImageName is a long?
0
Comment
Question by:blizzdek
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:fantasy1001
Comment Utility
Have you try str(ImageName)?
0
 

Author Comment

by:blizzdek
Comment Utility
yes I have, but when I write str(imagename) it returns the number but with a space at the beginning, which then makes it an invalid image control name. How can I fix that little space?
0
 
LVL 3

Accepted Solution

by:
pg_india earned 50 total points
Comment Utility
do trim(str(imagename))
0
 
LVL 3

Expert Comment

by:pg_india
Comment Utility
or u can use trim(cstr(imagename))
0
 
LVL 5

Expert Comment

by:fantasy1001
Comment Utility
if there is only leading space at the beginning, then

ltrim(str(imagename))

Cheers
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 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

8 Experts available now in Live!

Get 1:1 Help Now