Report Error#2448: You Can't Assign a Value to This Object

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ahd2008
    New Member
    • Nov 2008
    • 68

    Report Error#2448: You Can't Assign a Value to This Object

    Good day all,

    I know that this error has been discussed before, but all the discussions were forms-based discussions. Thus, I am sorry if you found this question repeated.

    I have a report that lists the tasks' score by employee. Along with each task's score there is a Grade Report bound control. The default value of this control is set to 0%. In some cases, you find that the task's score is null, which means the employee has not yet worked on this task. However, you still see the value of the Grade Report shown up which is 0% (Deafult value).

    Now, I don’t want to this value to show up if the task wasn't started. So, I tried the below code to set the Grade Report control to Null, but I got this error "2448: You Can't Assign a Value to This Object".

    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    
    If IsNull(ProgressCtrl) = True Then
                [Grade Report] = Null
            End If
    
    End Sub
    Appreciate any idea to get around this error?

    Thanks
  • PGAC
    New Member
    • Jun 2012
    • 7

    #2
    Hi ahd2008,


    Why have a default value of 0%? Why not use a Null value to indicate an unstarted task? Try taking away the default value of 0% and see how that works, that way you would not need some code to "sort out" the data. You would have to remove all those 0%s that correspond to unstarted tasks from the relevant tables though.

    Comment

    • ahd2008
      New Member
      • Nov 2008
      • 68

      #3
      Hi PGAC

      Thanks for your response; that's the first thing came across my mind, but I was wondering if there is an easier way to get around this error rather than updating all the unstated tasks and remove the zero value from the Grade Report. Anyhow, thanks for your suggestion and I guess it is best approach to tackle the problem at its roots

      Comment

      • PGAC
        New Member
        • Jun 2012
        • 7

        #4
        I suppose you could try using an IIF in the report's underlying query:

        Code:
        [Grade Report Calc]: IIF([Grade Report]=0,"",[Grade Report])
        This returns a zero-length string if the grade report is zero.

        Comment

        • ahd2008
          New Member
          • Nov 2008
          • 68

          #5
          Thanks PGAC; I have decided to go with your first suggestion.

          Comment

          Working...