Acc 2000 Like Operator Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MindBender77
    New Member
    • Jul 2007
    • 233

    Acc 2000 Like Operator Problem

    Hello All,
    I've always had problems with the "like" operator in a query especially using the wildcard "*". This is my latest issue. I have a query that produces 4 fields if the Line Tech field is like that entered in a textbox on a form. This is what I have so far.

    [code=sql]
    SELECT tbl_security.[Full Name], tbl_PunchCard_M ain.[LogIn Date], tbl_PunchCard_M ain.[LogIn Time], tbl_PunchCard_M ain.[LogOut Date], tbl_PunchCard_M ain.[LogOut Time]
    FROM tbl_PunchCard_M ain INNER JOIN tbl_security ON tbl_PunchCard_M ain.[Line Tech] = tbl_security.[User Name]
    WHERE (((tbl_PunchCar d_Main.[Line Tech]) Like "*[Forms]![frm_Search]![txt_tech]*"));
    [/code]

    I know (((tbl_PunchCar d_Main.[Line Tech]) Like "*[Forms]![frm_Search]![txt_tech]*")) is the problem but, I can't find the correct syntax.

    Thanks in Advance,
    Bender
  • MindBender77
    New Member
    • Jul 2007
    • 233

    #2
    Problem Solved:

    [code=sql]
    SELECT tbl_security.[Full Name], tbl_PunchCard_M ain.[LogIn Date], tbl_PunchCard_M ain.[LogIn Time], tbl_PunchCard_M ain.[LogOut Date], tbl_PunchCard_M ain.[LogOut Time]
    FROM tbl_PunchCard_M ain INNER JOIN tbl_security ON tbl_PunchCard_M ain.[Line Tech] = tbl_security.[User Name]
    WHERE (((tbl_PunchCar d_Main.[Line Tech]) Like "*" & [Forms]![frm_Search]![txt_tech] & "*"));
    [/code]

    Bender

    Comment

    Working...