Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Search # (pound Sign) problem

Status
Not open for further replies.

mesafloyd

Technical User
Aug 19, 2006
31
US
I have a combo box(Combo78) lookup on a continous Form(frmUpdates)
The lookup places the lookup in text field (PROPERTYADDRESS)

We search addresses.. The problem is the apartment No's. using the # immediatly before the number i.e. #3 for instance
If search for #3, I get all addresses with the no 3 embedded, but I get no #3, it just excludes them.
Further, if I search for 3, it does bring up the #3 but there are too many 3's in the lookup and defeats the purpose of the search

We use the #3 method extensively so it would be difficult haveing our people not use that method... Is there a way for my search to find #3 or #4 not just 3 or 4

Hope Im clear.
Here is my code which otherwise works well.

Private Sub Combo82_AfterUpdate()
Me.Filter = "PROPERTYADDRESS like '*" & Me.Combo82 & "*'"
Me.FilterOn = True
' this filter finds any matching chars in the lookup for PROPERTYADDRESS
' meaning wo will find both wolfe and xyzwoabc
End Sub

 
mesafloyd,
[tt]Me.Filter = "PROPERTYADDRESS like '*" & Replace(Me.Combo82, "#", "[#]") & "*'"[/tt]

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Hi CautionMP.

That did the trick!!

Thanks a ba-zillion....
Really appreciate it..

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top