Consulting

Results 1 to 6 of 6

Thread: ms project vba get data from Field

  1. #1

    ms project vba get data from Field

    Hi
    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 in Project VBA like that?


    Thanks

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I am not an MS Project man (yet) but have you tried

    ActiveProject.Tasks.UniqueID(1).Text1 = ActiveProject.Tasks.UniqueID(F).text1
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    I found the answer from another site

    I've just wondered in 75 views no one answered me.

    by the way Thanx for your care my friend

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Every question gets many views from our friendly lurkers... uhh, I meant learners

    I am glad you found the answer. Would you share it with us?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  5. #5
    See the answer here.

    stackoverflow.com/questions/32697187/ms-project-vba-get-data-from-fields

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Thanks
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •