strange behavior (1 Viewer)

buratti

Registered User.
Local time
Today, 03:23
Joined
Jul 8, 2009
Messages
234
This is funny. I have a button on a form where one of many lines of code is a very simple "me.[Status ID] = 4" It always worked in the past, but I modified some code before it and now whenever it gets to that line I get the error: "You cant assign a value to this object" . None of the modified code before that have nothing to do with that [Status ID] field.

Now the weird thing is that if I click debug when I receive that error, then click continue (F5) or step into (F8) it runs that line perfectly fine and sets the [Status ID] to "4" like it is suppose to.

Technically I have a solution, but any suggestions on why it is happening?

My solution is, I changed it from what it was:
me.[Status ID] = 4
To:
On Error Resume Next
Me.[Status ID] = 4
Me.[Status ID] = 4

And that works.
 

evanscamman

Registered User.
Local time
Today, 00:23
Joined
Feb 25, 2007
Messages
274
I wonder if it could be having trouble with the space in your field name. Spaces are generally a no-no, although technically, they should work. If you renamed your field would the problem persist?
 

Users who are viewing this thread

Top Bottom