I'm trying to delete a record from a List Box. When I run the code below, I get this error:
"undefined function '[Forms]![frmFiscalYear]![lstMembers].Column' in expression"
tblFYMembers, where the List Box items are stored, get its values from the FY field on the Form, and the ID field in cboMember. So I have two criteria in my SQL statement. Perhaps my syntax is clumsy?
Thanks in advance,
oneleaf
************
Private Sub lblDeleteMember_Click()
DoCmd.RunSQL "DELETE * FROM tblFYMembers WHERE ((tblFYMembers.FY)=[Forms]![frmFiscalYear]![FY] AND (tblFYMembers.Member)=[Forms]![frmFiscalYear]![lstMembers].Column(0));"
lstMembers.Requery
End Sub
*************
"undefined function '[Forms]![frmFiscalYear]![lstMembers].Column' in expression"
tblFYMembers, where the List Box items are stored, get its values from the FY field on the Form, and the ID field in cboMember. So I have two criteria in my SQL statement. Perhaps my syntax is clumsy?
Thanks in advance,
oneleaf
************
Private Sub lblDeleteMember_Click()
DoCmd.RunSQL "DELETE * FROM tblFYMembers WHERE ((tblFYMembers.FY)=[Forms]![frmFiscalYear]![FY] AND (tblFYMembers.Member)=[Forms]![frmFiscalYear]![lstMembers].Column(0));"
lstMembers.Requery
End Sub
*************