[AccessD] Blanks in text box

Rocky Smolin at Beach Access Software rockysmolin at bchacc.com
Tue Nov 13 11:05:56 CST 2007


Mark:

My debug statement shows that even in the Before Update event the blank is
already gone. So I still need a way to know if the user has pressed the
space bar.  I'm updating the row source after every keystroke.  Your code
seems to imply that at that point Text0 still has the trailing blanks.

Rocky





 	
	

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
Sent: Tuesday, November 13, 2007 8:54 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Blanks in text box


Rocky,

I can't see exactly what you are looking at...but in testing what is
below...I was losing the spaces when I left the text box...thats why I
placed the code on the before update...and in that case the spaces where
passed to the code.

Good luck,

Mark

> From: rockysmolin at bchacc.com
> To: accessd at databaseadvisors.com
> Date: Tue, 13 Nov 2007 08:48:38 -0800
> Subject: Re: [AccessD] Blanks in text box
>
> Mark:
>
> I'm not sure that will work because the space seems to be getting 
> trimmed from the string before I get hold of it. I may have to use key 
> trapping to see what key was pressed. And if blank add it manually to 
> the string during the row source update.
>
> Regards,
>
> Rocky
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A 
> Matte
> Sent: Tuesday, November 13, 2007 8:26 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Blanks in text box
>
>
> Rocky,
>
> It might be crude, but could you just force the string using something 
> like (code below) on the BeforeUpdate of the text box?
>
> Thanks,
>
> Mark A. Matte
>
> CODE START
> Dim SpaceCheck
> Dim Length
> Dim TrimLength
> Dim FinalString
> FinalString = Me!Text0
> Length = Len(Me!Text0.Text)
> TrimLength = Len(Trim(Me!Text0.Text))
> If Length = TrimLength Then GoTo SKIP
> SpaceCheck = 0
> Do Until SpaceCheck = Length
> FinalString = FinalString & Chr(32)
> SpaceCheck = Len(FinalString)
> Loop
> SKIP:
> MsgBox FinalString & "test"
> CODE END
>




More information about the AccessD mailing list