Hi ,
My name is Dennis Schmidt. Thank you for using the Microsoft Newsgroups.
There are a couple of VBA functions that you could use on an event like
BeforeUpdate. They are the IsNumeric() and Len() functions. Code could
look something like this:
Dim ValueEntered
ValueEntered = Me!<control-name>
If Not IsNumeric(ValueEntered) then
MsgBox "Value is not a number"
Me!<control-name>.SetFocus
End If
If Len(ValueEntered) > 5 then
MsgBox "Value is too long"
Me!<control-name>.SetFocus
End If
I hope this helps! If you have additional questions on this topic, please
reply to this posting.
Need quick answers to questions like these? The Microsoft Knowledge Base
provides a wealth of information that you can use to troubleshoot a problem
or answer a question! It's located at
http://support.microsoft.com/support/c.asp?M=F>.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.
Regards,
Dennis Schmidt
Microsoft Support