Hello,
I'm trying to do "Search as you type" continuous form:
Code:
Private Sub txtCitySearch_Change()
Me.Refresh
Me.RecordSource = "SELECT CountryName, RegionName, CityName, ZIPCode " & _
"FROM dbo_vw_AddressDatabase " & _
"WHERE CountryName LIKE ""%" & txtCountrySearch & "%"" AND " & _
"RegionName LIKE ""%" & txtRegionSearch & "%"" AND " & _
"CityName LIKE ""%" & txtCitySearch & "%"" AND " & _
"ZIPCode LIKE ""%" & txtZIPSearch & "%"";"
txtCitySearch.SetFocus
txtCitySearch.SelStart = Nz(Len(txtCitySearch), 0)
End Sub
This works fine as long as it actually returns some rows. But once I type some non-existent search which doesn't return data, I get Runtime 2185 error.
Would you by any chance have any ideas how I could fix it?
Thanks a lot!
Tomas