I am trying to let the user toggle a boolean field (Yes/No) by double-clicking on the record line in a datagrid. This is the sub that I have, and I am getting a 6160 Data Access Error on the ...Text = ... lines. I have the datagrid set to AllowUpdate, and Enabled and such. I am using an ADODB.Connection for the datagrid recordset.
Where am I going wrong?
Thanks,
Dan
Code:
Private Sub DataGrid_DblClick()
DataGrid.Columns("BO").Locked = False
If DataGrid.Columns("BO") = "Yes" Then
DataGrid.Columns("BO").Text = "No"
Else
DataGrid.Columns("BO").Text = "Yes"
End If
DataGrid.Columns("BO").Locked = True
End Sub
Where am I going wrong?
Thanks,
Dan