我有一个if / then语句,它将根据拍子操作号打开一个表单。问题是,我最近遇到了一个问题,有些人没有拍子动作号码。如果没有拍拍操作编号,如何构架此代码,以便根据位置编号打开表格。
If Me.txtPATS <> "" Then
If Me.Action_Type <> "Job Opening" Then
DoCmd.OpenForm "sfrmPAR", , , "PATS_ActionID=" & Me.PATS_ActionID, acFormEdit
End If
If Me.Action_Type = "Job Opening" Then
DoCmd.OpenForm "sfrmPARVacancy", , , "PATS_ActionID=" & Me.PATS_ActionID, acFormEdit
Else
DoCmd.OpenForm "sfrmPAR", , , "[Position_ #]='" & Me.txtPos & "'", acFormEdit
End If
If txt.PATS = Null Then
DoCmd.OpenForm "sfrmPARVacancy", , , Action_Type = " & Me.Action_Type, acFormEdit"
End If
End If
答案 0 :(得分:0)
类似的东西:
If Nz(Me!txtPATS.Value) <> "" Then
If Me.Action_Type <> "Job Opening" Then
DoCmd.OpenForm "sfrmPAR", , , "PATS_ActionID=" & Me.PATS_ActionID, acFormEdit
End If
If Me.Action_Type = "Job Opening" Then
DoCmd.OpenForm "sfrmPARVacancy", , , "PATS_ActionID=" & Me.PATS_ActionID, acFormEdit
Else
DoCmd.OpenForm "sfrmPAR", , , "[Position_ #]='" & Me.txtPos & "'", acFormEdit
End If
If IsNull(txt.PATS) Then
DoCmd.OpenForm "sfrmPARVacancy", , , Action_Type = " & Me.Action_Type, acFormEdit"
End If
End If