validation rules- access front-end for mysql

Would anyone have any examples of creating validation rules for an MS Access front-end to a MySql database? This would be for data entry in the front-end's datasheet view.

Thanks!
montarchAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
By "validation rules", you mean at the Interface level? Are you using bound forms? If you are, then typically you'd validate data in the Form's Before Update event:

Sub Form_BeforeUpdate(Cancel As Integer)
  If Len(Me.SomeTextbox)>5 Then
    "You must enter 5 or less characters"
    Cancel = True
    Exit Sub
  End If
 
  If Me.SomeOtherTextbox >10 Then
    Msgbox "You cannot enter a number greater than 10"
    Cancel = True
    Exit Sub
  End If
End Sub

If, however, you're allowing users to enter data directly in the tables, then you'd have to add constraints and such at the server.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
montarchAuthor Commented:
We're not using forms. Users enter data directly into the tables. Would you have an example of or reference to adding constraints at the server?

Thanks for your time.
0
montarchAuthor Commented:
Actually, I think that I'll create forms with a tabular layout and use your suggestion.

Thanks for your help.

Gregg.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.