[AccessD] Trick Needed

Charlotte Foust cfoust at infostatsystems.com
Tue Jun 10 10:25:10 CDT 2008


What's wrong with:

If Me.TextBox1.Text.Length > intMax Then ....

In the OnChange event of TextBox1?

Alternatively, use the OnChange event to pass the control as an argument
to a function.  The function can make use of the Text property of the
passed textbox, check its Text.Length and pass back a result.

Charlotte Foust  

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, June 10, 2008 7:57 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Trick Needed

Hi Mark

I wouldn't, but I guess the form would have more than this single
TextBox which could get focus. 
As soon as you leave TextBox1, TextBox2 displays #Error ...

Also, if you stay in TextBox1, the event will not fire if you paste in
some text with the mouse. That's why I suggest using the OnChange event
and push the result to TextBox2.

/gustav

>>> markamatte at hotmail.com 10-06-2008 16:34 >>>

Gustav,

How would you type in TextBox1, have the KEY_UP event fire, and it NOT
have focus?

Thanks,

Mark A. Matte


> Date: Tue, 10 Jun 2008 08:00:36 +0200
> From: Gustav at cactus.dk
> To: accessd at databaseadvisors.com
> Subject: Re: [AccessD] Trick Needed
>
> Hi Susan
>
> It only works when TextBox1 has focus as this is the only situation
where Property Text is available. If not, you will receive an error in
TextBox2.
>
> /gustav
>
>>>> ssharkins at gmail.com 10-06-2008 01:13>>>
> ooooooooooo... Rocky, did it work? That is indeed clever.
>
> Susan H.
>
>
>> 2 text boxes. TEXT1 and TEXT2
>>
>> Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer) 
>> Me!Text2.Requery End Sub
>>
>> in "CONTROL SOURCE" of TEXT2 =Len([Text1].[Text])
>>
>> This shouold get what you need.



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list