Ms access 运行时错误';424';

Ms access 运行时错误';424';,ms-access,Ms Access,要求: If Me.OrigRTL.Value Is Null Then DoCmd.SetWarnings False DoCmd.OpenQuery "OrigDates" Me.Refresh DoCmd.SetWarnings True Else DoCmd.GoToControl "OrigRtL" End If End Sub 我希望在特定控件为Null时运行查询 但是,我每次都会看到这个错误: 错误: If Me.OrigRTL.Value Is Null Then Do

要求:

If Me.OrigRTL.Value Is Null Then

DoCmd.SetWarnings False
DoCmd.OpenQuery "OrigDates"
Me.Refresh
DoCmd.SetWarnings True

Else
DoCmd.GoToControl "OrigRtL"

End If
End Sub
我希望在特定控件为
Null
时运行查询

但是,我每次都会看到这个错误:

错误:

If Me.OrigRTL.Value Is Null Then

DoCmd.SetWarnings False
DoCmd.OpenQuery "OrigDates"
Me.Refresh
DoCmd.SetWarnings True

Else
DoCmd.GoToControl "OrigRtL"

End If
End Sub
“需要对象”

表单称为
PLanningForm
,控件
Null
OrigRTL

感谢您的帮助

代码:

If Me.OrigRTL.Value Is Null Then

DoCmd.SetWarnings False
DoCmd.OpenQuery "OrigDates"
Me.Refresh
DoCmd.SetWarnings True

Else
DoCmd.GoToControl "OrigRtL"

End If
End Sub

请不要使用设置警告()您无法转到具有焦点的控件。您应该始终报告给出错误的行。请不要使用set warings(),因为您无法转到具有焦点的控件。您应该始终报告给出错误的行。逐步浏览代码并找到它。