[AccessD] Blanks in text box

Rocky Smolin at Beach Access Software rockysmolin at bchacc.com
Tue Nov 13 09:44:34 CST 2007


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:

    If Me.txtFirstNameFilter <> "" Then
        If InStr(1, lstGoTo.RowSource, "WHERE ") <> 0 Then
            Me.lstGoTo.RowSource = Me.lstGoTo.RowSource & " AND "
        Else
            Me.lstGoTo.RowSource = Me.lstGoTo.RowSource & " WHERE "
        End If
        
        Me.lstGoTo.RowSource = Me.lstGoTo.RowSource _
            & "tblPersonSearch.FirstName Like '" & Me.txtFirstNameFilter &
"*'"
    End If

Each of the four text boxes has a change event which calls the subroutine
SetSelectNameRowSource from which the above snip was taken.  

I put a message box in to see what was getting to the sub from the change
event:

MsgBox "*" & Nz(Me.txtLastNameFilter) & "*"

By the time the sub opens the trailing blank has been stripped.

Rocky
  




 	
	

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

 So what does the resulting filter look like?  Have you tried replacing a "
" with a Space(1)?

Charlotte Foust

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
Beach Access Software
Sent: Monday, November 12, 2007 5:47 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Blanks in text box

It the text box where I want to have the trailing blanks retained. I'm
setting the filter for the text box in a subroutine that's called from the
Change event of the text box.

Rocky





 	
	

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
Sent: Monday, November 12, 2007 4:59 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Blanks in text box

What is the "it" that won't accept and retain trailing blanks, Rocky, the
list box, the textbox, the filter, or what?  If you're trapping keystrokes,
make sure you aren't including a Trim in there somewhere.

Charlotte Foust


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

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.15.30/1127 - Release Date: 11/12/2007
9:19 PM
 




More information about the AccessD mailing list