Application.SetMatchingField Method
Project Developer Reference |
Sets the value in the field of selected tasks or resources that meet the specified criteria.
Syntax
expression.SetMatchingField(Field, Value, CheckField, CheckValue, CheckTest, CheckOperation, CheckField2, CheckValue2, CheckTest2)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Field | Required | String | The name of the field to set. |
Value | Required | String | The value to which the field is set. |
CheckField | Required | String | The name of the field to check. |
CheckValue | Required | String | The value to compare with the value of the field specified with CheckField. |
CheckTest | Optional | String | The type of comparison made between CheckField and CheckValue. The default value is "equals". Can be one of the following comparison strings:
Comparison StringDescription
"equals"The value of CheckField equals CheckValue.
"does not equal"The value of CheckField does not equal CheckValue.
"is greater than"The value of CheckField is greater than CheckValue.
"is greater than or equal to"The value of CheckField is greater than or equal to CheckValue.
"is less than"The value of CheckField is less than CheckValue.
"is less than or equal to"The value of CheckField is less than or equal to CheckValue.
"is within"The value of CheckField is within CheckValue.
"is not within"The value of CheckField is not within CheckValue.
"contains"CheckField contains CheckValue.
"does not contain"CheckField does not contain CheckValue.
"contains exactly"CheckField exactly contains CheckValue.
|
Comparison String | Description | ||
"equals" | The value of CheckField equals CheckValue. | ||
"does not equal" | The value of CheckField does not equal CheckValue. | ||
"is greater than" | The value of CheckField is greater than CheckValue. | ||
"is greater than or equal to" | The value of CheckField is greater than or equal to CheckValue. | ||
"is less than" | The value of CheckField is less than CheckValue. | ||
"is less than or equal to" | The value of CheckField is less than or equal to CheckValue. | ||
"is within" | The value of CheckField is within CheckValue. | ||
"is not within" | The value of CheckField is not within CheckValue. | ||
"contains" | CheckField contains CheckValue. | ||
"does not contain" | CheckField does not contain CheckValue. | ||
"contains exactly" | CheckField exactly contains CheckValue. | ||
CheckOperation | Optional | String | How the criteria established with CheckField, CheckTest, and CheckValue relate to the second criteria, if specified. The CheckOperation argument can be set to "And" or "Or". The default value is "And". |
CheckField2 | Required | String | The name of the second field to check. |
CheckValue2 | Required | String | The value to which the second field is set. |
CheckTest2 | Optional | Variant | The type of comparison made between CheckField2 and CheckValue2. Can be one of the same comparison strings as CheckTest. |
Return Value
Boolean
Example
The following example first checks for equality of task field "Name" and changes the value of task field "Name" to "New Task's Name", and then changes it back to the original name.
Visual Basic for Applications |
---|
|
See Also