代码如下,但运行时出现“您取消了前次的操作” 错误提示,应该是程序运行的顺序问题,但是没有找到问题出在哪里?
If (Weekday(Date) = 1 And (Me.Psw) = DLookup("[Psw]", "tblPsw", "[Id] = P07")) Then
DoCmd.OpenForm "frmSafeEdit_child"
DoCmd.Close acForm, "frmBxmx_child_Edit"
Exit Sub
End If
If (Weekday(Date) = 2 And (Me.Psw) = DLookup("[Psw]", "tblPsw", "[Id] = P01")) Then
DoCmd.OpenForm "frmSafeEdit_child"
DoCmd.Close acForm, "frmBxmx_child_Edit"
Exit Sub
End If
If (Weekday(Date) = 3 And (Me.Psw) = DLookup("[Psw]", "tblPsw", "[Id] = P02")) Then
DoCmd.OpenForm "frmSafeEdit_child"
DoCmd.Close acForm, "frmBxmx_child_Edit"
Exit Sub
End If
If (Weekday(Date) = 4 And (Me.Psw) = DLookup("[Psw]", "tblPsw", "[Id] = P03")) Then
DoCmd.OpenForm "frmSafeEdit_child"
DoCmd.Close acForm, "frmBxmx_child_Edit"
Exit Sub
End If
If (Weekday(Date) = 5 And (Me.Psw) = DLookup("[Psw]", "tblPsw", "[Id] = P04")) Then
DoCmd.OpenForm "frmSafeEdit_child"
DoCmd.Close acForm, "frmBxmx_child_Edit"
Exit Sub
End If
If (Weekday(Date) = 6 And (Me.Psw) = DLookup("[Psw]", "tblPsw", "[Id] = P05")) Then
DoCmd.OpenForm "frmSafeEdit_child"
DoCmd.Close acForm, "frmBxmx_child_Edit"
Exit Sub
End If
If (Weekday(Date) = 7 And (Me.Psw) = DLookup("[Psw]", "tblPsw", "[Id] = P06")) Then
DoCmd.OpenForm "frmSafeEdit_child"
DoCmd.Close acForm, "frmBxmx_child_Edit"
Else
MsgBox "您输入的授权密码错误,请重新输入", vbCritical, "警告"
Me.Psw.SetFocus
Exit Sub
End If
End Sub