Using Like with a parameter

Brian Martin

Registered User.
Local time
Today, 22:58
Joined
Jul 24, 2002
Messages
68
PARAMETERS [Forms]![frmChoose]![txtcode] Text ( 255 );
SELECT [Product List].[Part Number], [Product List].[Short Description], [Product List].[Full Description], [Forms]![frmChoose]![txtcode] AS Expr1
FROM [Product List]
WHERE ((([Product List].[Part Number]) Like "[Forms]![frmChoose]![txtcode]*"));

I want to find records that begin the same as the value of the text box txtcode. The code I have here works if I replace Like"[Forms]![frmChoose]![txtcode]*" with the actual value eg. HG-A so there must be some problem with how I'm referencing the parameter. Can anybody help??
 
Try this:

WHERE [Product List].[Part Number] Like [Forms]![frmChoose]![txtcode] & "*"
 

Users who are viewing this thread

Back
Top Bottom