[AccessD] A2K: ezSmartSearch

Steven W. Erbach serbach at new.rr.com
Wed Aug 27 18:47:47 CDT 2003


Dear Group,

I just found out something esoterically interesting about Access 2000 while
working with the generic Search capability offered by the Database Creations
EZSmartSearch form.

The RowSource property of the main Combo Box that appears on the
EZSmartSearch form is set in the code behind the form. The SQL statement
that is used for the RowSource property refers to the contents of a Text Box
on form in the WHERE clause; like this:

WHERE ((([Position Data Table].Position) Like "*" &
[forms]![ezs_SmartSearch]![TextSearch] & "*"))

Notice the asterisks surrounding the [TextSearch] field.

The RowSource property is set first. All well and good. The ListCount
property of the Combo Box will show the proper number of records. But if the
[TextSearch] field is changed in code afterwards (as it is in the
EZSmartSearch form) then the RowSource changes! That is, the query is "run"
again once the Text Box contents have been changed in the code.

The [TextSearch] Text Box was set to " " after the RowSource property had
been set. Then the RowSource changed automagically without having to
issue another command to reset it. In my particular case the combo box then
showed only those records where there was a space in the contents of the
Position field. That turned out to be most of the records...but it was very
annoying to track down.

Regards,

Steve Erbach
Scientific Marketing
Neenah, WI

If architects built buildings the way programmers built applications, the
first woodpecker to come along would cause the end of civilization.




More information about the AccessD mailing list