Filter syntax in Microsoft Access 2010 form macro
I am new to access programming, so please cut me a little slack on the
newbie question.
I have a form that I created with Create --> More Forms --> Multiple
Items. The form is based on a query that returns values from three fields,
two of which are hidden. The three fields are FullName, ID, and LastName.
FullName is visible, while ID and LastName are not visible.
I added a text box above the form called txtFilter, and I added a macro to
the After Update event of txtFilter, with the intent of filtering out
results so that only the FullNames of records whose LastName value is like
the value entered in txtFilter.
In the "WHERE=" section of the macro builder, I added the following:
='LastName Like '' & [txtFilter] & '*''
Note the double ==. When I type a value into txtFilter and press return, I
get a dialog box that says "Type mismatch."
Can anyone show me how to fix this syntax so that it does what it is
supposed to? Also, explanation of the syntax would be much appreciated.
No comments:
Post a Comment