Private Sub Command12_Click()
updateAll True
End Sub
Private Sub Command15_Click()
updateAll False
End Sub
Private Sub Form_Load()
refreshSubForm
End Sub
Private Sub Text10_AfterUpdate()
refreshSubForm
End Sub
Private Sub refreshSubForm()
Dim strXDCFM As String
Dim strSQL As String
Dim strtest As String
If IsNull(Me.Text10) Then
strSQL = "SELECT 选择, 药物, 剂量, 单位 FROM 协定处方药物;"
Else
strXDCFM = Me.Text10
strSQL = "SELECT 选择, 药物, 剂量, 单位 FROM 协定处方药物 WHERE [协定处方名]='" & strXDCFM & "';"
End If
Me.协定处方调出.Form.RecordSource = strSQL
End Sub
Private Sub updateAll(bChecked As Boolean)
Dim rs As Recordset
Set rs = Me.协定处方调出.Form.Recordset
rs.MoveFirst
Do While Not rs.EOF
rs.Edit
rs.Fields("选择").Value = bChecked
rs.Update