By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

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

syedshaffee
P: 91
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
Expand|Select|Wrap|Line Numbers
  1.     If RVCalcCheck Then
  2.      Me.ContractRemainingRV.Value = mdblOriginalRV - (Access.Nz(Me.txtRVTransfer.Value, 0#) + Access.Nz(Me.txtRVRecovery.Value, 0#))
  3.         'Me.ContractRemainingRV.Value = mdblOriginalRV - Access.Nz(Me.txtRVTransfer.Value, 0#)
  4.         'Me.ContractRemainingRV.Value = mdblOriginalRV - (Access.Nz(Me.txtRVRecovery.Value, 0#))
  5.         Me.txtContractRemainingRV.Requery
  6.         'DoCmd.RunCommand acCmdSaveRecord
  7.     Else
  8.         MsgBox "Remaining RV cannot be less than zero", vbExclamation, "RIMS"
  9.         'Me.txtRVTransfer.Value = Me.txtRVTransfer.OldValue
  10.     End If
  11.  
  12.  
  13.  
  14.  If Me.[ContractRemainingRV] - (Me.txtRVTransfer - Me.txtRVTransfer.OldValue) - Me.txtRVRecovery < 0 Then
  15.        MsgBox "Remaining Rv cannot be less than zero!", vbCritical, "RIMS"
  16.        Me.txtRVTransfer = Me.txtRVTransfer.OldValue
  17.    Else
  18.        Me.ContractRemainingRV = Me.ContractRemainingRV - (Me.txtRVTransfer - Me.txtRVTransfer.OldValue)
  19.    End If
  20.  
  21.    Me.txtContractRemainingRV.Requery
  22.     'DoCmd.RunCommand acCmdSaveRecord
  23.     Forms!frmContractRewrite!txtRemainingRV.Value = val(Me.txtRVTransfer.Value) + Forms!frmContractRewrite!txtOldPVofRV.Value
  24.     Forms!frmContractRewrite!txtRemainingRV.Requery
  25.     strRewriteContractNOValue = ""
  26.  
Apr 13 '12 #1

✓ answered by TheSmileyCoder

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).

Share this Question
Share on Google+
4 Replies


TheSmileyCoder
Expert Mod 100+
P: 2,321
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.
Apr 13 '12 #2

syedshaffee
P: 91
The Line is
Forms!frmContractRewrite!txtRemainingRV.Value = val(Me.txtRVTransfer.Value) + Forms!frmContractRewrite!txtOldPVofRV.Value

the ControlSource is containing calculation for a specific field
Apr 13 '12 #3

TheSmileyCoder
Expert Mod 100+
P: 2,321
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).
Apr 13 '12 #4

syedshaffee
P: 91
thank a lot "the Smilety coder"
Apr 15 '12 #5

Post your reply

Sign in to post your reply or Sign up for a free account.