Hello there,

i've a set of code to search through table containing column values like $2000 - $3000, $5000 - $6000 and so on.

If i were to enter something like $2000 - $5500, both results would be displayed.

unfortunately, the set of code works only when the values are without the $ sign.

Similarly, i have other values for [Age Group] which has values like 30 - 50 and etc. (without the $ sign) and... it works perfectly.

How can i alter the codes to accomodate the $ sign?

VB Code:
  1. sMHouse = Me.TextMHouse
  2. sMH = Split(sMHouse, " ")
  3.  
  4. sMHouse = "  and ( "
  5.        
  6.         Do While sMH(0) <= sMH(1)
  7.            
  8.             sMHouse = sMHouse & " ( [Monthly Household] like '%" & sMH(0) & "%' ) or "
  9.             sMH(0) = sMH(0) + 1
  10.         Loop
  11.        
  12.          sMHouse = Mid(sMHouse, 1, Len(sMHouse) - 5)
  13.          
  14.          sMHouse = sMHouse & " or [Monthly Household] not like '%" & sMH(0) & "%' or [Monthly Household] not like '%" & sMH(1) + 1 & "%') and [Monthly Household] is not null ) "


Thank You

Astro