I'm getting an error 'You can't assign a value to this object.'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • syedshaffee
    New Member
    • Jan 2012
    • 91

    I'm getting an error 'You can't assign a value to this object.'

    Hey People,
    I am getting an Error 'You can't assign a value to this object.' when i am trying to update a text box value that has Control Source that is placed on a other form
    Please guide me on the same
    Code:
        If RVCalcCheck Then
         Me.ContractRemainingRV.Value = mdblOriginalRV - (Access.Nz(Me.txtRVTransfer.Value, 0#) + Access.Nz(Me.txtRVRecovery.Value, 0#))
            'Me.ContractRemainingRV.Value = mdblOriginalRV - Access.Nz(Me.txtRVTransfer.Value, 0#)
            'Me.ContractRemainingRV.Value = mdblOriginalRV - (Access.Nz(Me.txtRVRecovery.Value, 0#))
            Me.txtContractRemainingRV.Requery
            'DoCmd.RunCommand acCmdSaveRecord
        Else
            MsgBox "Remaining RV cannot be less than zero", vbExclamation, "RIMS"
            'Me.txtRVTransfer.Value = Me.txtRVTransfer.OldValue
        End If
      
     
     
     If Me.[ContractRemainingRV] - (Me.txtRVTransfer - Me.txtRVTransfer.OldValue) - Me.txtRVRecovery < 0 Then
           MsgBox "Remaining Rv cannot be less than zero!", vbCritical, "RIMS"
           Me.txtRVTransfer = Me.txtRVTransfer.OldValue
       Else
           Me.ContractRemainingRV = Me.ContractRemainingRV - (Me.txtRVTransfer - Me.txtRVTransfer.OldValue)
       End If
    
       Me.txtContractRemainingRV.Requery
        'DoCmd.RunCommand acCmdSaveRecord
        Forms!frmContractRewrite!txtRemainingRV.Value = val(Me.txtRVTransfer.Value) + Forms!frmContractRewrite!txtOldPVofRV.Value
        Forms!frmContractRewrite!txtRemainingRV.Requery
        strRewriteContractNOValue = ""
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    You dont specify which line is giving you an error, and you don't specify what the controlsource is. Please revise your question with the needed details.

    Comment

    • syedshaffee
      New Member
      • Jan 2012
      • 91

      #3
      The Line is
      Forms!frmContra ctRewrite!txtRe mainingRV.Value = val(Me.txtRVTra nsfer.Value) + Forms!frmContra ctRewrite!txtOl dPVofRV.Value

      the ControlSource is containing calculation for a specific field

      Comment

      • TheSmileyCoder
        Recognized Expert Moderator Top Contributor
        • Dec 2009
        • 2322

        #4
        Only if the controlsource is directly bound to a field in a recordset can you update it (provided the recordset itself is updateably off course).

        Comment

        • syedshaffee
          New Member
          • Jan 2012
          • 91

          #5
          thank a lot "the Smilety coder"

          Comment

          Working...