How can I restrict the user from entering text(string) in a field with out changing the Field "Type". So field type is string but user can only enter Numbers,
i thought it would be like that , but didnt work
if Bug_Fields("BG_USER_17").IsNumeric = false then
msgbox"Please enter numbers only"
Bug_FieldCanChange = false
I would really appreciate if you could answer this
First of all, why not just change the field type in Customize/Project Entities ?
Second, you've used IsNumeric incorrectly.
You've identified the correct workflow function, but your code could use a tweak.
One of the values passed in to _FieldCanChange is 'NewValue'.
So you need to do something like:
<font class="small">Code:</font><hr /><pre>
Function Bug_FieldCanChange(FieldName, NewValue)
Select Case FieldName
If IsNumeric(NewValue) Then
Bug_FieldCanChange = True
Bug_FieldCanChange = False
msgbox"Please enter numbers only", vbOKOnly + vbExclamation
Bug_FieldCanChange = DefaultRes