Where clause

Lyncroft

QPR for ever
Local time
Today, 14:29
Joined
May 18, 2002
Messages
168
I'm running a report from a form and have a text box which the user types in a word. At the moment I've the following code:

DoCmd.OpenReport "Staff Details", acViewPreview, , "[Last name] = '" & [Text4] & "'"

This works fine but instead of entering a full word in Text4 I want to insert a Like clause, eg, they enter W and it picks up all words beginning with W.

I've tried various permutations but can't come up with it. I know I could do this by another route by referencing the text box on a query but I'm trying to get the hang of this pesky SQL stuff!!

Any help gratefully received.
 
Lyncroft,

Code:
DoCmd.OpenReport "Staff Details", acViewPreview, , "[Last name] Like *'" & [Text4] & "*'"

Wayne
 
Cheers for that Wayne. Haven't got the patience to try it out tonite. I'll do it tomorrow after a few beers.
 

Users who are viewing this thread

Back
Top Bottom