How do I set a field to the table so that it will accept only the number 0 or a 12-digit number
Can someone advise me??
How do I set a field to the table so that it will accept only the number 0 or a 12-digit number
Can someone advise me??
I would do this via my form. Example:
'Purpose: Not allow more than 12 characters
If Len(Forms.YourFormNameHere.SomeFieldName.Text) > 12 Then
DoCmd.Beep
Forms.YourFormNameHere.SomeFieldName.Text = Left(Forms.YourFormNameHere.SomeFieldName.Text, 12)
Forms.YourFormNameHere.SomeFieldName.SelStart = 12
End If
HTH
in the form in which you can edit that field under after update event I would put something like this:
Code:Private Sub textbox1_AfterUpdate() If textBox1.Text.Length <= 12 Then MsgBox("Must Have 12 Digits") TextBox1.Text = Strings.Left(TextBox1.Text, TextBox1.Text.Length - 1) End If End Sub