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?
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor 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
 
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
All Courses

From novice to tech pro — start learning today.