VBA Run time Error 2448, you cant assign a value to this object

Neilster

Registered User.
Local time
Today, 15:19
Joined
Jan 19, 2014
Messages
218
Hi guys

Anyone shed any light on this as it's only just started randomly doing this, would the code need to be simplified?

If (IsNull(txtAccountOverView.Value)) Then
txtAccountOverView.Value = txtNewComment.Value & " ~ " & _
VBA.DateTime.Date & " ~ " & VBA.DateTime.Time
Else
txtAccountOverView.Value = (txtAccountOverView.Value) & _
vbNewLine & vbNewLine & _
txtNewComment.Value & " ~ " & _
VBA.DateTime.Date & " ~ " & VBA.DateTime.Time
End If

txtNewComment.Value = ""

:banghead::banghead::banghead:

Cheers for any help..
 
You seem to be missing a lot of Me.YourControl name syntax.
Have you done some sort of global Find and Replace recently.
Also you can lose the .Value as its the default property for form controls
 
I've put the Me. in as I should have, however it doesn't like this part of the code..

Else
Me.txtAccountOverView.Value = (Me.txtAccountOverView.Value) & _
vbNewLine & vbNewLine & _
Me.txtNewComment.Value & " ~ " & _
VBA.DateTime.Date & " ~ " & VBA.DateTime.Time
 
What's happening is when you update a field on the main form and click on the button to open the account history form to add notes I get the error if I haven't refreshed the mail form. If I refresh the main form then click account history then add notes it works fine....
 
Okay I would simplify this, just add a refresh.
Code:
Else
Refresh
Me.txtAccountOverView = Me.txtAccountOverView & vbCrLf & vbCrLf & Me.txtNewComment & " ~ " & Now()
 
Thanks guys, however I have used this right at the start of the code and works fine for now I think. No errors so far.

Forms!FrmCustomerDetails.Refresh
 
Glad you got it working, but a word of warning: I'd change that special character ~ you're using to something else! The internal names of all Access System Objects (Tables, Forms, Queries, etc) begin with this character, and it's apt to confuse the Access Gnomes, sooner or later, and create problems for you...problems that will be almost impossible to track down.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom