Hi,
I have a list box with no primary key. Fields in table are Branch and ReviewYear - both text. The table I want to delete records from could have 20 records matching Branch and ReviewYear selected in the list box. The code I have tried gives me an error "Invalid use of '.', '!' or ()in query expression.....
Here is the code:
DoCmd.RunSQL "DELETE * FROM [tbl PriorUndReview] WHERE [tbl PriorUndReview].Branch=" _
& [Forms]![frm PurgeReview]![lstNew].Column(0) _
& " AND [tbl PriorUndReview].ReviewYear=" _
& [Forms]![frm PurgeReview]![lstNew].Column(1)
I am not good with sql and not sure if its because I am trying to use the column() of list box or if I am missing quotes somewhere. Thanks Lisa
I have a list box with no primary key. Fields in table are Branch and ReviewYear - both text. The table I want to delete records from could have 20 records matching Branch and ReviewYear selected in the list box. The code I have tried gives me an error "Invalid use of '.', '!' or ()in query expression.....
Here is the code:
DoCmd.RunSQL "DELETE * FROM [tbl PriorUndReview] WHERE [tbl PriorUndReview].Branch=" _
& [Forms]![frm PurgeReview]![lstNew].Column(0) _
& " AND [tbl PriorUndReview].ReviewYear=" _
& [Forms]![frm PurgeReview]![lstNew].Column(1)
I am not good with sql and not sure if its because I am trying to use the column() of list box or if I am missing quotes somewhere. Thanks Lisa