Text Box with Input Mask Error (1 Viewer)

jeffreyccs

New member
Local time
Today, 08:28
Joined
Nov 10, 2012
Messages
29
Hi

I have a form that requires users to enter a starting time for an event in a textbox which is written to a table using code attached to a command button. The textbox has an input mask for hours and minutes and after the write has been completed I want to clear the value from the text box. However I get an error message saying that "You can't assign a value to this object". I suspect that as the textbox is unbound this relates to the use of an input mask, but cannot find any references on search engines.

I would be interested to know if anyone has come across this behaviour and if there is a workaround for it.

Regards

Jeff
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:28
Joined
May 7, 2009
Messages
19,169
maybe you are entering a value greater than 23:59
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:28
Joined
Sep 21, 2011
Messages
14,044
No.
I have just created a unbound textbox with an input mask of short time and used a button to clear the control?
Me.txtTime = ""
 

Micron

AWF VIP
Local time
Today, 11:28
Joined
Oct 20, 2018
Messages
3,476
Is the textbox control source based on an expression?
 

jeffreyccs

New member
Local time
Today, 08:28
Joined
Nov 10, 2012
Messages
29
Hi Everyone

Thanks for your time, I have just gone through everything and found out that I made a typo in the fairly lengthy textbox name and that caused it to create an error when referring to what was an incorrect name.

I am sorry to have wasted your time and apologize

Thanks again

Jeff
 

Micron

AWF VIP
Local time
Today, 11:28
Joined
Oct 20, 2018
Messages
3,476
t I made a typo in the fairly lengthy textbox name
That implies one or more of the following:
a) you don't use Option Explicit (but absolutely should)
b) you use Me! and not Me.
c) some combination of the above and you do not compile your code after making changes.

Post back if you have questions on any of those points, or better yet, do some research to further your knowledge.
Nice to know you found the issue though.
EDIT - forget the 'combination' inference. If you use Option Explicit a typo like that should raise a compile error regardless of whether or not you manually compile your code because that would get caught automatically.
 

Users who are viewing this thread

Top Bottom