I need to be able to change references to task fields that are being used on the fly (as a result of user input) and I don't want to have to hard code every possible option.

For example, How do I make the reference to ".Duration1" etc in the following code via VBA assuming that I have the field name in a string variable called strFieldName.

For Each oTask In ActiveSelection.Tasks
If Not oTask.Summary Then
oTask.Duration1 = oTask.Duration3 * oMinPercent
oTask.Duration2 = oTask.Duration3 * oMaxPercent
End If
Next oTask

Thanks in advance.

Warren James

PS I have cross-posted to the VBA forum as I wasn't sure which was the best/right place to put this.