文本框表单字段必填

时间:2018-12-20 17:57:31

标签: ms-access

我将以下VBA代码以表格的形式插入到我的文本框中。它仅在我输入某些内容然后删除我输入的内容时才有效。如果我转到下一个框,则出现错误信息。有什么方法可以要求填写文本框吗?

Private Sub master_bill_a_BeforeUpdate(Cancel As Integer)
If IsNull(Me.master_bill_a) Then
    Cancel = True
    MsgBox "You must enter a value for 'YourControlNameOrYourDescription'. 
Please make a valid entry or press ESC to Cancel"
    'You could set the focus on the specific control if your wish, change 
the background color, ...
End If
End Sub

0 个答案:

没有答案
相关问题