Solved You can't assign a value to this object?? (1 Viewer)

jdraw

Super Moderator
Staff member
Local time
Today, 07:48
Joined
Jan 23, 2006
Messages
15,379
Has anyone else had this issue recently? I am trying to set a textbox to "" empty string.
Code:
Me.txtCode = ""
I have copied my form from backup and it has worked as expected several times.
Now, I just encountered the error again.
Have not found a solution? It seems (based on google) to have happened to various people over the years, but no consistent answer/solution.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:48
Joined
Feb 19, 2013
Messages
16,613
I presume txtCode is not bound to a field which is not updateable or is populated with a calculation of some sort?
 

jdraw

Super Moderator
Staff member
Local time
Today, 07:48
Joined
Jan 23, 2006
Messages
15,379
Unbound, no expression/calculation
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:48
Joined
Feb 19, 2013
Messages
16,613
might have become corrupted for some reason so delete the control and create a new one?
compact/repair?
decompile?
 

Minty

AWF VIP
Local time
Today, 12:48
Joined
Jul 26, 2013
Messages
10,371
Corrupt Control?

Delete it, save and C & R.
Reload, then add another control with a different name and see if you get the same behaviour.
I've got a couple of DB's with weird crashing going on at the moment, and as they are clients' projects it's a bit disconcerting.

Trying to work out why it's happening is long-winded in a big app.

Edit - damn those faster CJ_Fingers...
 

jdraw

Super Moderator
Staff member
Local time
Today, 07:48
Joined
Jan 23, 2006
Messages
15,379
Thanks Guys,(y)(y)

I deleted the unbound textbox, created a new one, named it slightly differently than original; adjusted the few assignments to the new name. It compiles and all is well.

Yes CJ is fast, but you both had the answer for my issue.
Minty, not sure why this "corruption occurred", but it happened 3 or 4 times today???

Access 365 Version 2302 - Build 16.0.16130.20306 64-bit
Windows 10 Home Version 22H2 - Build 10.0.22621.1413 64-bit
Click to Run
 

jdraw

Super Moderator
Staff member
Local time
Today, 07:48
Joined
Jan 23, 2006
Messages
15,379
I'd say your up at the 95% level--- plenty good enough!
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:48
Joined
Feb 28, 2001
Messages
27,186
not sure why this "corruption occurred", but it happened 3 or 4 times today???

Which means you have found collateral damage to the real corruption. You probably will have to create a new DB and import everything from the old DB into the new one. If you have a lot of code, try the DECOMPILE trick first. But if you still have frequent recurrences, I think it is time to clean out everything and rebuild it into a new file.
 

jdraw

Super Moderator
Staff member
Local time
Today, 07:48
Joined
Jan 23, 2006
Messages
15,379
Doc,
It's a relatively new, small test database. I have been pulling pieces from older code and adjusting as I go. I compile the code to ensure there isn't something "out there". And I save the changes frequently as well as C&R. I haven't had the issue previously, at least not often enough to recognize "something like regular corruption". One thing I did notice was one of the procedures had almost all body code missing. I restored that code from backup and the control on the form where the issue arose.
Delete the control, recreate with a new name, re-establish any assignments to the newly named control, and C&R was advised, and it worked in this case.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:48
Joined
Feb 28, 2001
Messages
27,186
By restoring the code from backup, you may have fixed the corruption. The point is, we never know EXACTLY what is affected by corruption, nor do we know HOW our particular flavor of corruption has been created. But you got lucky, I think, by finding a reasonable alternative to wholesale transfer to a new file.
 

Users who are viewing this thread

Top Bottom