1
votes

I wanna get data from a field of an exact task and put to another field.

but the problem is the field that I wanna get data from could be every visible field in table. in fact fieldname will choose in userform during the VB.

code is like this: (But It does not work)

UserForm1.Show

Dim F as String

F = UserForm1.ComboBox1.Value              ''''F will be a FieldName

ActiveProject.Tasks.UniqueID(1).Text1 = ActiveProject.Tasks.UniqueID(1).F

It can not find field F that is for example "Task Name" or anyfield. how can I address the field?

Thanks

1

1 Answers

1
votes

You'll need to use a combination of FieldNameToFieldConstant and GetField:

F = UserForm1.ComboBox1.Value
task = ActiveProject.Tasks.UniqueID(1)
task.Text1 = task.GetField(FieldNameToFieldConstant(F))