|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can't assign value
I have form with several text boxes that are populated by a procedure called from a combo box from which the user makes a selection.
I want to create a Cancel button to undo any unsaved changes to the text boxes so I have copied the following code from the Access Help file but get 'error 2448. Can't assign value to this object.' Sub btnUndo_Click() Dim ctlC As Control ' For each control. For Each ctlC In Me.Controls If ctlC.ControlType = acTextBox Then ' Restore Old Value. ctlC.Value = ctlC.OldValue End If Next ctlC End Sub Any ideas? |
|
#2
|
|||
|
|||
|
You try to set "Value". Try to set .Text instead. Also do not try to set values in calculated fields. They will refuse that with a similar error message.
When you have calculated fields and others that store values in the database it may be better to use a particular name prefix in order to distinguish them (dbf = db field). acTextBox will not be sufficient as a criterion and you would then use: If Left(ctlC.name, 3) = "dbf" Then |
|
#3
|
|||
|
|||
|
Thanks
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Can't assign value |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|