Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2006

Tip: Looking for answers? Try searching our database.

search with wild cards

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil - 05 Feb 2006 00:13 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.