Question : Object required error on if statement

Hey Guys,

     I have a form with a list of names pulled from a table.  One of the fielids on the table is a checkbox and I am trying to set up the listbox on the form so when a name is double clicked it will change the value of the checkbox.  In the code below I am receiving Object Require on the first line of code.  Im sure this is a simple fix, but thats what I get for trying to self teach.

Any help is appreciated
Brandon
Code Snippet:
1:
2:
3:
4:
5:
6:
If Table![tbl_EliteRotation]![Opt out].Value = Yes Then
DoCmd.RunSQL ("UPDATE tbl_EliteRotation SET tbl_EliteRotation.[Opt out] = No WHERE Forms![frm_EliteData]![List0].value=[tbl_EliteRotation]![EMP_ID")
ElseIf Table![tbl_EliteRotation]![Opt out].Value = No Then
DoCmd.RunSQL ("UPDATE tbl_EliteRotation SET tbl_EliteRotation.[Opt out] = Yes WHERE Forms![frm_EliteData]![List0].value=[tbl_EliteRotation]![EMP_ID]")
End If
Me.refresh

Answer : Object required error on if statement

or this


DoCmd.RunSQL ("UPDATE tbl_EliteRotation SET [Opt out] = Not [Opt out] WHERE [EMP_ID] ='"& me.List0 &"'")
Random Solutions  
 
programming4us programming4us