程序又改进了,不过没有反映。这次没有错误提示,就是没有效果。把“Me.lianjie”改成“Forms!窗体1.lianjie”也没有反映。
Private Sub 下单日期_Exit(Cancel As Integer)
Me.下单日期.BackColor = RGB(255, 255, 255)
Me.lianjie
Me.精品任务单_子表.Requery
End Sub
Public Function lianjie()
If ((Me.精品任务编号 = "") And (Me.下单日期 = "") And (Me.任务日期 = "")) Then
Me.Form!精品任务单_子表.LinkMasterFields = ""
Me.Form!精品任务单_子表.LinkChildFields = ""
ElseIf ((Me.精品任务编号 <> "") And (Me.下单日期 = "") And (Me.任务日期 = "")) Then
Me.Form!精品任务单_子表.LinkMasterFields = "精品任务编号"
Me.Form!精品任务单_子表.LinkChildFields = "精品任务编号"
ElseIf ((Me.精品任务编号 = "") And (Me.下单日期 <> "") And (Me.任务日期 = "")) Then
Me.Form!精品任务单_子表.LinkMasterFields = "下单日期"
Me.Form!精品任务单_子表.LinkChildFields = "下单日期"
ElseIf ((Me.精品任务编号 = "") And (Me.下单日期 = "") And (Me.任务日期 <> "")) Then
Me.Form!精品任务单_子表.LinkMasterFields = "任务日期"
Me.Form!精品任务单_子表.LinkChildFields = "任务日期"
ElseIf ((Me.精品任务编号 <> "") And (Me.下单日期 <> "") And (Me.任务日期 = "")) Then
Me.Form!精品任务单_子表.LinkMasterFields = "精品任务编号;下单日期"
Me.Form!精品任务单_子表.LinkChildFields = "精品任务编号;下单日期"
ElseIf ((Me.精品任务编号 = "") And (Me.下单日期 <> "") And (Me.任务日期 <> "")) Then
Me.Form!精品任务单_子表.LinkMasterFields = "下单日期;任务日期"
Me.Form!精品任务单_子表.LinkChildFields = "下单日期;任务日期"
ElseIf ((Me.精品任务编号 <> "") And (Me.下单日期 = "") And (Me.任务日期 <> "")) Then
Me.Form!精品任务单_子表.LinkMasterFields = "精品任务编号;任务日期"
Me.Form!精品任务单_子表.LinkChildFields = "精品任务编号;任务日期"
ElseIf ((Me.精品任务编号 <> "") And (Me.下单日期 <> "") And (Me.任务日期 <> "")) Then
Me.Form!精品任务单_子表.LinkMasterFields = "精品任务编号;下单日期;任务日期"
Me.Form!精品任务单_子表.LinkChildFields = "精品任务编号;下单日期;任务日期"
End If
End Function
[此贴子已经被作者于2006-4-9 20:23:56编辑过]
|