Private Sub Check1_Click()
If Check1.Value = 1 Then
DTP1.Enabled = True
Else
DTP1.Enabled = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
DTP2.Enabled = True
Else
DTP2.Enabled = False
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = 1 Then
DTP3.Enabled = True
Else
DTP3.Enabled = False
End If
End Sub
Private Sub Check4_Click()
If Check4.Value = 1 Then
DTP4.Enabled = True
Else
DTP4.Enabled = False
End If
End Sub
If Check1.Value = 1 Then
cn.Execute "UPDATE khgl SET 来电时间 =  '" & DTP1.Value & "'"
Else
cn.Execute " UPDATE khgl SET 来电时间 = null"
End IfIf Check2.Value = 1 Then
cn.Execute "UPDATE khgl SET 去电时间 =  '" & DTP2.Value & "' "
Else
cn.Execute " UPDATE khgl SET 去电时间 = null"
End If
If Check3.Value = 1 Then
cn.Execute "UPDATE khgl SET 询价时间 =  '" & DTP3.Value & "'"
Else
cn.Execute " UPDATE khgl SET 询价时间 = null"
End If
If Check4.Value = 1 Then
cn.Execute "UPDATE khgl SET 下次联系时间 = '" & DTP4.Value & "'"
Else
cn.Execute " UPDATE khgl SET 下次联系时间 = null"
End If
以上是修改代码,四个check控制四个dtpicker,很奇怪的一个问题,一清空日期,都清空,当dtpicker在激活状态下存入数据,存入的数据没有规则,一会在来电时间里,一会在去电时间里!!