By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,470 Members | 949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,470 IT Pros & Developers. It's quick & easy.

Form Error validation vs before update

P: 35
Hi, hope u are all well.

I only have a few textboxes to validate on a form; if I use the "before update" event on the form it seems that field validation on the table is triggered first and the before update is useless. Am I supposed to untick "Unique Value", "Required" (for foreign key) and other fields validation in order for the before update to work well? Didn't want to do that.

I was thinking about doing the whole form validation using the event "Form Error" and trap all the errors numbers so that I can use field validation on my tables. Anything wrong with that?
Why does everyone use "before Update", it drives me nuts. Or maybe I need to read more.

Thank You
1 Week Ago #1
Share this Question
Share on Google+
1 Reply

P: 79
I can't replicate that. This works for me - inhibits validation on the table level:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  3.     Cancel = IsNull(Me!SalesPerson.Value)
  5.     If Cancel = True Then
  6.         MsgBox "Please select a sales person."
  7.         Me!SalesPerson.SetFocus
  8.     End If
  10. End Sub
1 Week Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.