Solved

Comparing objects in if statement

Posted on 2002-03-26
2
149 Views
Last Modified: 2010-05-02
Hi

I have this problem
ActiveProject.Tasks(i).Name when I reach this poing the object is not initialized. But what every I try with I get an exception

if ActiveProject.Tasks(i).Name > ""
if ActiveProject.Tasks(i).Name is nothing = false

etc.etc. all fails

But I guess this is easy :)
/Joachim
0
Comment
Question by:joachimc
2 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
Comment Utility
Use:

If Not (ActiveProject.Tasks(i) Is Nothing) Then

You need to refer to the object, not a property thereof.
0
 
LVL 4

Author Comment

by:joachimc
Comment Utility
aha I missed the perentecis.
/Joachim
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
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…

762 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

10 Experts available now in Live!

Get 1:1 Help Now