如下图,实现如下功能有点问题:
表中符合条件的任一行的列(联系信息)(逻辑型)是true,点击新增按钮窗口中的checkbox1都不能用。
新增按钮的代码:
For Each r As Row In Tables("地址信息").Rows
If r("联系信息")=1 Then
e.Form.Controls("CheckBox1").Enabled=False
Else
e.Form.Controls("CheckBox1").Enabled=True
End If
Next
With Tables("地址信息")
.AllowEdit=True
If .Current Is Nothing OrElse .Current.DataRow.RowState = DataRowState.Unchanged Then '如果当前行未曾修改
Dim r As Row=Tables("地址信息").addnew
r("patientsID")=e.Form.controls("txt_patients").text
e.Form.Controls("Btn_edit").Enabled=False
e.Form.Controls("Btn_delete").Enabled=False
e.Form.Controls("Btn_first").enabled=False
e.Form.Controls("Btn_last").enabled=False
e.Form.Controls("Btn_next").enabled=False
e.Form.Controls("Btn_pre").enabled=False
e.Form.Controls("Btn_ok").enabled=True
e.Form.Controls("Btn_cancel").enabled=True
e.Form.Controls("Btn_exit").enabled=False
End If
End With

此主题相关图片如下:360软件小助手截图20140304164330.jpg
