View Full Version : Using " " to clear the field


aqif
07-27-2001, 06:24 PM
Hi All http://www.access-programmers.co.uk/ubb/smile.gif

I've got this unique problem now. Most of the people use " " to clear the text box or field. I've got a text box. I also have a button which clears the box. Problem is that when i use " " for clearing the box. It clears OK but when i try to enter data it leaves one space in the start and I have to press backspace in order to avaoid that.

I also have a date field and when I clear that using " " the eror comes showing voilation of Input Mask as its input mask is set to 99/99/9999.

I also tried using "" but error of "Zero level string not allowed" shows up. Is there any athentic way to clear the text box no matter its of number,date or text type?

Cheers!
Aqif

DALeffler
07-27-2001, 07:39 PM
Rather than clearing the txtbox, can you execute a DoCmd.GoToControl "txtYourControlName" statement when the value in the txtbx isn't something your code will swallow?

Let the control clear itself?

HTH,

Doug.