Detect empty recordset returned by filter

C

Curmudgeon

I have a vba procedure in Access 2010 that applies a series of filters
to an mpp (MSProj 07).

To determine if no tasks are returned I customarily use:

Dim T As MSProject.Task
..SelectBeginning
If T Is Nothing Then
[do something]
End If

This has always worked for me in the past, but now I'm getting "T Is
Nothing" for all filters, regardless of whether or not tasks are being
returned. Does anybody have any suggestions?
 
C

Curmudgeon

I have a vba procedure in Access 2010 that applies a series of filters
to an mpp (MSProj 07).

To determine if no tasks are returned I customarily use:

Dim T As MSProject.Task
.SelectBeginning
If T Is Nothing Then
[do something]
End If

This has always worked for me in the past, but now I'm getting "T Is
Nothing" for all filters, regardless of whether or not tasks are being
returned. Does anybody have any suggestions?

OK - by experimentation I found that this works:

..SelectTaskCell Row:=1, Column:="UniqueID"
If .ActiveSelection = "" Then
Do Something
End If


This does not throw the untrappable 424 "Object required" error, which
causes the procedure to halt.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top