Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.CheckField Method (Project)

office 365 dev account|Last Updated: 10/19/2017
|
2 Contributors

True if the selected tasks or resources meet the specified criteria.

Syntax

expression. CheckField (Field, Value, Test, Op, Field2, Value2, Test2)

expression A variable that represents an Application object.

Parameters

NameRequired/OptionalData TypeDescription
FieldRequiredStringThe name of the field to search.
ValueRequiredStringThe value to compare with the value of the field specified with Field.
TestOptionalStringThe type of comparison made between Field and Value. The default value is "equals". Can be one of the following comparison strings.
OpOptionalStringHow the criteria established with Field, Test, and Value relate to the second criteria. The Op argument can be set to "And" or "Or".
Field2OptionalStringThe name of a second field to search.
Value2OptionalStringThe value to compare with the value of the field specified with Field2.
Test2OptionalStringThe type of comparison made between Field2 and Value2. Can be one of the same comparison strings as Test.


Comparison strings

Comparison stringDescription
"equals"The value of Field equals Value.
"does not equal"The value of Field does not equal Value.
"is greater than"The value of Field is greater than Value.
"is greater than or equal to"The value of Field is greater than or equal to Value.
"is less than"The value of Field is less than Value.
"is less than or equal to"The value of Field is less than or equal to Value.
"is within"The value of Field is within Value.
"is not within"The value of Field is not within Value.
"contains"Field contains Value.
"does not contain"Field does not contain Value.
"contains exactly"Field exactly contains Value.


Return value

Variant

Example

The following example determines whether value of Duration is equal to 1 and displays an appropriate message.

Sub Check_Field() 

 Dim T As Task 
 Dim Result As Boolean 

 Set T = ActiveProject.Tasks(3) 
 Result = CheckField("Duration", "1", "equals") 

 If Result Then 
 Result = MsgBox(T.GetField(pjTaskName) + " task Duration is equal to value specified.", vbOKOnly, "CheckField Method") 
 Else 
 Result = MsgBox(T.GetField(pjTaskName) + " task Duration is not equal to value specified.", vbOKOnly, "CheckField Method") 
 End If 
End Sub
© 2018 Microsoft