(Newbie) Hi,
I'm trying to delete a record from a table based on the item selected in its List Box. The error I'm getting is "Argument Not Optional" (see bold below)
Private Sub btnDelete_Project_Click()
Dim varSelectedItem As AcRecord
Dim strSQL As String
varSelectedItem = Me.List1.ItemsSelected.Item
strSQL = "DELETE varSelectedItem FROM Project_List_Table;"
DoCmd.RunSQL strSQL
End Sub
Any help would be greatly appreciated, thanks,
Jason.
I'm trying to delete a record from a table based on the item selected in its List Box. The error I'm getting is "Argument Not Optional" (see bold below)
Private Sub btnDelete_Project_Click()
Dim varSelectedItem As AcRecord
Dim strSQL As String
varSelectedItem = Me.List1.ItemsSelected.Item
strSQL = "DELETE varSelectedItem FROM Project_List_Table;"
DoCmd.RunSQL strSQL
End Sub
Any help would be greatly appreciated, thanks,
Jason.