Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Validation MS Access对记录集的引用。记录计数_Validation_Ms Access_Vba - Fatal编程技术网

Validation MS Access对记录集的引用。记录计数

Validation MS Access对记录集的引用。记录计数,validation,ms-access,vba,Validation,Ms Access,Vba,我需要弄清楚我的电脑里是否有记录 主要表格[frmShiftDay] 子窗体[frmShiftMachinesSubform] 子表单[frmMachineOutputSubform] 我根本就不能把它作为参考。谢谢 ElseIf Me!frmMachineOutputSubform.Form!frmMachineOutputSubform.Recordset.RecordCount = 0 Then MsgBox "Product Name is missing", vbCritica

我需要弄清楚我的电脑里是否有记录

  • 主要表格[frmShiftDay]
  • 子窗体[frmShiftMachinesSubform]
  • 子表单[frmMachineOutputSubform]
  • 我根本就不能把它作为参考。谢谢

    ElseIf Me!frmMachineOutputSubform.Form!frmMachineOutputSubform.Recordset.RecordCount = 0 Then
        MsgBox "Product Name is missing", vbCritical + vbOKOnly, "Required Data!"
        Me.frmShiftMachinesSubform.Form.frmMachineOutputSubform.SetFocus
        Exit Sub
    

    我想你错过了最后一张“表格”

    试试这个

    ElseIf Me.frmMachineOutputSubform.frmMachineOutputSubform.Recordset.RecordCount = 0 Then
    

    不,那也不行。。。我只能让它工作,如果我有下面的VBA在我的子窗体,但我需要它在我的主窗体。下面的代码仅适用于“Subform”>>>>ElseIf Me.frmmachineoutputsoform.Form.Recordset.RecordCount=0,那么我想知道这些!当你用句号替换它们时会发生什么?我试过了,没有!并替换为句号,但仍然。您是否只能引用一个子表单?任何想法都会发生同样的事情。是否有其他方法可以检查我是否有基本相同的记录?我确实尝试过在我的subsub表单上用=count([myid])放一个文本框,但它只会在我添加一个新记录时更新记录计数。你们能想到的任何方法都非常感谢。谢谢
    ElseIf Me.frmMachineOutputSubform.frmMachineOutputSubform.Recordset.RecordCount = 0 Then