Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding a report from a substring

Status
Not open for further replies.

Cineno

Programmer
Jul 24, 2006
142
0
0
US
I have a database where I would like to enter a job title in a text box and see it's report.

Currently this works if I enter the job title exactly as it is in the database. But I'd like to enter just a section of text like "director" and the reports for the job containing that term.

Here is the code I'm using now that works:

DoCmd.OpenReport "Job Summary", acViewPreview, , "Title = '" & [Forms]![JobGroups]![txtJobTitle] & "' "

How would I alter this, or what other statements can I use to open the report where a substring of Title = txtJobTitle?

Thanks for any help!
 
Code:
DoCmd.OpenReport "Job Summary", acViewPreview, , "Title Like '*" & [Forms]![JobGroups]![txtJobTitle] & "*'"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That's exactly what I needed! Thanks a lot you saved me a lot of frustration.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top