Text and only text datatype

  • Thread starter Thread starter Golfinray
  • Start date Start date
G

Golfinray

My managers keep putting dates in a text field. Is there any way to use
validation where they can't put dates in a text field or n/a or some other
comment in a date field? I have all the datatypes set but they still manage
to enter stuff in the wrong place on the form and it then ends up in the
table. Thanks so much!!!!
 
My managers keep putting dates in a text field. Is there any way to use
validation where they can't put dates in a text field or n/a or some other
comment in a date field? I have all the datatypes set but they still manage
to enter stuff in the wrong place on the form and it then ends up in the
table. Thanks so much!!!!

If they are putting something like "This is due on 7/25" into a text field,
then it will be pretty complicated to prevent!

You can use the textbox's BeforeUpdate event on a form to trap cases where
they're putting *just* a date:

Private Sub controlname_BeforeUpdate(Cancel as Integer)
If IsDate(Me!controlname) Then
MsgBox "Please put dates in the date field, not here", vbOKOnly
Cancel = True
<if you want to be nice then>
Me!datefield = Me!controlname ' copy what they entered
Me!controlname.Undo
End If
End Sub
 
Back
Top