View Single Post
Old 07-04-2019, 06:51 PM   #1
Newly Registered User
Join Date: Oct 2008
Posts: 677
Thanks: 23
Thanked 5 Times in 5 Posts
kirkm is on a distinguished road
Can't assign Value to this object

I was having trouble with a locked ldb file and in trying to solve it made a new Form to update a memo field in my table. I also need to convert carriage returns.

Private Sub Form_Close()
Me.Text0 = Replace(Me.Text2, vbCrLf, vbLf)
End Sub

Private Sub Form_Load()
Me.Caption = Nz(Me.OpenArgs)
If Nz(Me.OpenArgs) > "" Then
Me.RecordSource = "Select * from MyTable Where Test = '" & Me.OpenArgs & "'"
    Me.Text2 = Replace(Me.Text0, vbLf, vbCrLf)
End If
End Sub

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

And if I change Me.Text0 = Replace(Me.Text2, vbCrLf, vbLf) to
Me.Text0.text = Replace(Me.Text2, vbCrLf, vbLf)
I get
Run time error 2176
The Setting For this property is too Long.

What might be the problem ?


kirkm is offline   Reply With Quote