Author |
Message |
Paulo de Arruda Borell #1 / 10
|
 Very strange error message
I'm using the following code to clear a text box (on a form): txtTextBox = vbNullString But, *sometimes*, the execution of this line generates the error number 3071. Its message tells that the expression is too complex to be evaluated or it was typed in a wrong way. The message aks me to simplify the expression. Anyway, the command is executed (because I can see the text box was cleared, regardless of the message). I tried using the command: txtTextBox = null and it was ok (no error messages). But, so, why doesn't the previous code work? The text box is an unbound one, and so is the form too. Any ideas? Thanks in advance, Paulo Borelli.
|
Tue, 01 Jan 2002 03:00:00 GMT |
|
 |
Dirk Goldga #2 / 10
|
 Very strange error message
Quote: > I'm using the following code to clear a text box (on a form): > txtTextBox = vbNullString > But, *sometimes*, the execution of this line generates the error number > 3071. Its message tells that the expression is too complex to be evaluated > or it was typed in a wrong way. The message aks me to simplify the > expression. > Anyway, the command is executed (because I can see the text box was cleared, > regardless of the message). > I tried using the command: > txtTextBox = null > and it was ok (no error messages). But, so, why doesn't the previous code > work? > The text box is an unbound one, and so is the form too. Any ideas? > Thanks in advance, > Paulo Borelli.
Well, I don't really know why you're getting the message, but I can tell you that vbNullString is not the same as Null, so there's no reason you should expect them to behave similarly. -- Dirk Goldgar (please direct email replies to
Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
|
Tue, 01 Jan 2002 03:00:00 GMT |
|
 |
Andr #3 / 10
|
 Very strange error message
Quote: >I'm using the following code to clear a text box (on a form): >txtTextBox = vbNullString
Paulo o que v. pode usar e: txtextbox=""
|
Tue, 01 Jan 2002 03:00:00 GMT |
|
 |
Paulo de Arruda Borell #4 / 10
|
 Very strange error message
Yes, Andre, I tried it (txtTextBox = ""). It gave me the same problem. Actually, the "vbNullString" is just a pointer to the very "" string. Anyway, thanks for your interest!
Quote:
> >I'm using the following code to clear a text box (on a form): > >txtTextBox = vbNullString > Paulo o que v. pode usar e: > txtextbox=""
|
Tue, 01 Jan 2002 03:00:00 GMT |
|
 |
Andr #5 / 10
|
 Very strange error message
You are welcome, I don't know what could be happening. I have this on a search box on the "on got focus" event and it works fine. Andre
|
Tue, 01 Jan 2002 03:00:00 GMT |
|
 |
Paulo de Arruda Borell #6 / 10
|
 Very strange error message
Yes, so do I! I have, in other forms, the very same code, assigning "vbNullString" to text boxes. But these other text boxes are unbound. The one that poses the problem is a bound one. What about yours?
Quote: > You are welcome, > I don't know what could be happening. > I have this on a search box on the "on got focus" event and it works fine. > Andre
|
Tue, 01 Jan 2002 03:00:00 GMT |
|
 |
Andr #7 / 10
|
 Very strange error message
Quote: >Yes, so do I! I have, in other forms, the very same code, assigning >"vbNullString" to text boxes. But these other text boxes are unbound. The >one that poses the problem is a bound one. What about yours?
They are unbound, but I have just tried with an bound control and it worked fine. I guess The problem is on the field bound to the control
|
Tue, 01 Jan 2002 03:00:00 GMT |
|
 |
Paulo de Arruda Borell #8 / 10
|
 Very strange error message
Sorry, I made a mistake. The text box posing the problem is an unbound one also. And I can use the same type of code in any other part of my DB, but not on this one. I'll keep using Null instead of vbNullString in this text box, until I figure out what is happening. Thanks for your interest!
Quote:
> >Yes, so do I! I have, in other forms, the very same code, assigning > >"vbNullString" to text boxes. But these other text boxes are unbound. The > >one that poses the problem is a bound one. What about yours? > They are unbound, but I have just tried with an bound control and it worked > fine. > I guess The problem is on the field bound to the control
|
Wed, 02 Jan 2002 03:00:00 GMT |
|
 |
April Marano-For #9 / 10
|
 Very strange error message
Is it possible that the field in the table/query bound to your text box won't allow itself to be filled with Null? Also, remember that Null is NOT equal to "" (zero-length string). April
Quote: > Yes, so do I! I have, in other forms, the very same code, assigning > "vbNullString" to text boxes. But these other text boxes are unbound. The > one that poses the problem is a bound one. What about yours?
> > You are welcome, > > I don't know what could be happening. > > I have this on a search box on the "on got focus" event and it works fine. > > Andre
|
Wed, 02 Jan 2002 03:00:00 GMT |
|
 |
Paulo de Arruda Borell #10 / 10
|
 Very strange error message
Hi, April, thanks for your interest. But I made a mistake. The text box giving the problem is *not* a bound one, neither the form. Thanks!
Quote: > Is it possible that the field in the table/query bound to your text box > won't allow itself to be filled with Null? Also, remember that Null is NOT > equal to "" (zero-length string). > April
> > Yes, so do I! I have, in other forms, the very same code, assigning > > "vbNullString" to text boxes. But these other text boxes are unbound. The > > one that poses the problem is a bound one. What about yours?
> > > You are welcome, > > > I don't know what could be happening. > > > I have this on a search box on the "on got focus" event and it works > fine. > > > Andre
|
Thu, 03 Jan 2002 03:00:00 GMT |
|
|