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.
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.