Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-28-2010, 12:40 PM
CGM3 CGM3 is offline Setting an Assignment Field from VBA Windows XP Setting an Assignment Field from VBA Office 2007
Advanced Beginner
Setting an Assignment Field from VBA
 
Join Date: Oct 2009
Posts: 38
CGM3 is on a distinguished road
Default Setting an Assignment Field from VBA

I'm an MS Project tyro who just got thrown into working with a Project file (created by someone not currently available) that doesn't seem to be working as it should.



The setup is this: a Cost1 column has been added to the Task view, the value of which is calculated by VBA code in the project's Calculate event and then assigned to the field:

Code:
Private Sub Project_Calculate(ByValpj As Project)
 
     Dim tskT As Task
     Dim asnA As Assignment
 
100  For Each tskT In ActiveProject.Tasks
110    If Not (tskT Is Nothing) Then
120      For Each asnA In tskT.Assignments
130        asnA.Cost1 = (asnA.Work / 60) * OtherRate

The Cost1 column is set so:

Custom attributes is None;

Calculations for task and group summary rows is Rollup (sum);

Calculations for assignment rows is None;

Values to display is None.

The problem is, the Cost1 cell for every assignment row shows zero, even when it shouldn't. The Cost1 cells for the task and group summary rows arenon-zero, and when I use a break to look into the code it shows the current Cost1 cell has having a non-zero value (using the handy ? asnA.Cost1 command in the Immediate pane); moreover, the value is what is expected from the calculation using the current values for Work and OtherRate.

How do I get the assignment Cost1 fields to display the value assigned to them? Is there a setting I have to change?

Addendum: it's MS Office Project 2007, if that matters (like I said, I'm a veritable sugarfoot where Project is concerned)

Last edited by CGM3; 09-28-2010 at 12:43 PM. Reason: Add what I forgot
Reply With Quote
  #2  
Old 10-05-2010, 05:51 AM
CGM3 CGM3 is offline Setting an Assignment Field from VBA Windows XP Setting an Assignment Field from VBA Office 2007
Advanced Beginner
Setting an Assignment Field from VBA
 
Join Date: Oct 2009
Posts: 38
CGM3 is on a distinguished road
Default

For some reason, this problem has vanished, and the fields are showing the data set into them.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to refer a field in another field DaveSmith Word 0 08-24-2010 06:44 PM
Help needed with assignment ccmystery Outlook 0 04-09-2010 05:59 AM
tafe assignment alharris Word 0 11-16-2009 12:00 AM
Can I get some help setting this up please? Moiraes Fate Office 0 05-18-2007 12:22 PM
setting rules isapaine Misc 0 01-11-2006 07:51 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft