多个复选框,用于将值输出到文本框

时间:2016-01-17 23:14:30

标签: vba ms-access

下面的代码应该确保表格上的所有复选框都被勾选,如果它们全部勾选,则显示文本框并接受,如果有任何遗漏,则显示"拒绝&#34 ;。代码有效但我现在无法保存记录,我收到一条消息,说明此时无法保存记录:

Option Compare Database

Private Sub Form_AfterUpdate()

   If Me.vcQuestion1Answer And Me.vcQuestion2Answer And Me.vcQuestion3Answer And Me.vcQuestion4Answer And Me.vcQuestion5Answer And Me.vcQuestion6Answer And Me.vcQuestion7Answer And Me.vcQuestion8Answer And Me.vcQuestion9Answer And Me.vcQuestion10Answer Then
      Me.test = "Accepted"
   Else
      Me.test = "Rejected"
   End If
End Sub


Private Sub Form_Click()

   If Me.vcQuestion1Answer And Me.vcQuestion2Answer And Me.vcQuestion3Answer And Me.vcQuestion4Answer And Me.vcQuestion5Answer And Me.vcQuestion6Answer And Me.vcQuestion7Answer And Me.vcQuestion8Answer And Me.vcQuestion9Answer And Me.vcQuestion10Answer Then
      Me.test = "Accepted"
   Else
      Me.test = "Rejected"
   End If
End Sub


Private Sub Form_Current()
  If Me.vcQuestion1Answer And Me.vcQuestion2Answer And Me.vcQuestion3Answer And Me.vcQuestion4Answer And Me.vcQuestion5Answer And Me.vcQuestion6Answer And Me.vcQuestion7Answer And Me.vcQuestion8Answer And Me.vcQuestion9Answer And Me.vcQuestion10Answer Then
      Me.test = "Accepted"
   Else
      Me.test = "Rejected"
   End If
End Sub

非常感谢任何帮助!!

0 个答案:

没有答案