Solved

Comparing objects in if statement

Posted on 2002-03-26
2
155 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
[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 43

Accepted Solution

by:
TimCottee earned 50 total points
ID: 6896066
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
ID: 6896088
aha I missed the perentecis.
/Joachim
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
Suggested Courses
Course of the Month9 days, 12 hours left to enroll

624 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