I am attempting to delete records from a table based on a listbox selection in my form. The table is DailyLog & UserLoggedOn where username is a variable based on user. The listbox is Me.lstRespLBPers. The field is the table is RespLBPerson. I keep getting "Expected end of Statement" error message with the word WHERE highlighted. What am I doing wrong. Code is listed below:
sql = "DELETE * FROM DailyLog_" & UserLoggedOn WHERE [RespLBPerson] <> Me.LstRespLBPers
I tried the code and expected the records to be deleted from the table but got the error message.