[AccessD] Trick Needed

Mark A Matte markamatte at hotmail.com
Tue Jun 10 11:03:00 CDT 2008


Gustav,

I see the errors of my ways.  

I was getting errors when I tried your approach...but it was because I had a set the control source of Text2...so when your example would fire...it would fail...but My Fault.

To Clarify...the example Susan asked if it worked(bottom of email).....that was my example...and the answer would NO...it did NOT work....as Gustav pointed out...if you left TEXT1...TEXT2 would error.

Gustav's example, however, did work...

Private Sub Text1_Change()
Me!Text2.Value = Len(Me!Text1.Text)
End Sub

Sorry for the confusion.

Thanks,

Mark A. Matte

----------------------------------------
> Date: Tue, 10 Jun 2008 16:56:51 +0200
> From: Gustav at cactus.dk
> 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

_________________________________________________________________
Instantly invite friends from Facebook and other social networks to join you on Windows Live™ Messenger.
https://www.invite2messenger.net/im/?source=TXT_EML_WLH_InviteFriends



More information about the AccessD mailing list