[AccessD] Blanks in text box

Mark A Matte markamatte at hotmail.com
Tue Nov 13 11:25:02 CST 2007


Ok...I feel kinda silly now...after reading my last response...why not ignore all the funky loop thing I did and just:
(Again on the BeforeUpdate)
Dim FinalString
FinalString = Me!Text0.Text
MsgBox FinalString & "test"

I think we try to make this complicated.

Good Luck,

Mark

> From: rockysmolin at bchacc.com
> To: accessd at databaseadvisors.com
> Date: Tue, 13 Nov 2007 09:05:56 -0800
> Subject: Re: [AccessD] Blanks in text box
>
> 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
>>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

_________________________________________________________________
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews



More information about the AccessD mailing list