Hi,
I have a table of book titles with an index back to an author table. I
would like to have a form with a search (find) button on it where I can type
in a title or part of a title using wild cards and get a display of all the
books and authors that match my search pattern. Is this possible? I know I
can do a report with a restricton based on the complete title, but I don't
know about using wild cards. An example of code would be greatly appreciated.
Thanks,
Phil
Duane Hookom - 05 Feb 2006 01:38 GMT
Apparently you want to "get a display" in "can do a report". Assuming you
have a text box on your form "txtFindTitle". Your code to open the report
might look like:
Dim strWhere as String
strWhere = "1=1 "
If not IsNull(Me.txtFindTitle) Then
strWhere = strWhere " AND [BookTitle] Like """*" & _
Me.txtFindTitle & """*"
End If
DoCmd.OpenReport "rptYourRpt", acPreview, , strWhere

Signature
Duane Hookom
MS Access MVP
--
> Hi,
> I have a table of book titles with an index back to an author table. I
[quoted text clipped - 10 lines]
> Thanks,
> Phil