Log in

View Full Version : Keep getting Run-time error -2147352567(80020009) msg, Need Help!



keek2a4
01-16-2008, 05:55 AM
Hello Everyone!

I have a table called tblStudent with fields studentID, studentName, studentAddress and dateUpdated.
I have a form that displays a record of the table tblStudent. In the BeforeUpdate event of the form, I have the following code:


Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.Text206 = Now()
End Sub

which says, any changed made to any fields in the form, Before updating the record, update the field "dateUpdated" with the current date.
The field "dateUpdated" is called Me.Text206 in the form.

However, whenever I edit or make changes to the form, I keep getting the following error message:



Run-time error '-2147352567(80020009)':
You can't assign a value to this object.

Its quite strange because, I have the same code for the subject form which is linked to the subject table and it works fine.

I can't figure out why I keep getting this error, any help plz

Thanks,

rconverse
01-16-2008, 01:12 PM
Is Me.Text206 set to a date format?

DarkSprout
01-18-2008, 03:22 AM
You can't change TextBox Values in a _BeforeUpdate Event.

Try the _AfterUpdate Event.

virtue
01-25-2008, 02:23 PM
i have a similiar problem with this error

Qubit
02-06-2008, 01:08 PM
I have found that "You can't assign a value to this object" usually means that I have a control with the 'Control Source' property set to something ( =Now() ) and then I also try to set it via code.
.Q

DarkSprout
02-07-2008, 01:16 PM
I have found that "You can't assign a value to this object" usually means that I have a control with the 'Control Source' property set to something ( =Now() ) and then I also try to set it via code.
.Q

Or...

The data source is a readonly table or query - open up the Control Source, and see if you can edit the table or query directly.
If it can't be edited - then that explains the error.