Hi All,
So I have a textbox in the header of one of my forms. For it's On Change event I have it filtering the form based on whatever is entered in the textbox. This works great. However, after the filter is re-applied after each "change", I have SelStart code to place the cursor back in the textbox. Problem is that SelStart does not seem to be accounting for any spaces in the textbox, and continues to place the cursor after the last character - not space - in the textbox. Here's the code:
Code:
strLastName = Nz(Me.txtLastName.Text, "")
Me.Filter = "CONTACT_LASTNAME like '%" & strLastName & "%'"
Me.FilterOn = True
Me.txtLastName.SelStart = Len(strLastName) + 1
For example, if I entered "An ", the Len() will return a 3, but when it goes to place the cursor back in the textbox, it basically seems to remove that trailing space. Therefore, the user is not allowed to insert spaces.
Any ideas??
Thanks!