[AccessD] Blanks in text box

Mark A Matte markamatte at hotmail.com
Tue Nov 13 10:25:57 CST 2007


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

> Date: Tue, 13 Nov 2007 10:58:08 -0500
> From: fuller.artful at gmail.com
> To: accessd at databaseadvisors.com
> Subject: Re: [AccessD] Blanks in text box
>
> This does not strike me as surprising, since the same thing happens in the
> database itself. You can't store "aaaa " in a column. Access will trim it.
> So it's only natural that it would do the same for its form controls, isn't
> it?
>
> A.
>
> On 11/13/07, Rocky Smolin at Beach Access Software 
> wrote:
>>
>> if I key in r and then a space the resulting filter is just an r. There
>> are
>> actually four text boxes like that which can add criteria to the row
>> source
>> of the list box. I do this four times adding Where clauses to the row
>> source:
>>
>>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

_________________________________________________________________
Windows Live Hotmail and Microsoft Office Outlook – together at last.  Get it now.
http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033



More information about the AccessD mailing list