G
gwoodby
Say i wanted to have a numbersonly function
I would Declare this in a new module, but when i call it
Function MyFunction(NewText as string)
On Error GoTo ErrorHandler
If IsNumeric(Chr(strTempAscii)) Or Chr(strTempAscii) = "-" Or _
Chr(strTempAscii) = "/" Or Chr(strTempAscii) = "\" Then
Else
strTempAscii = ""
TxtDtoAtto2.Text = Left(TxtDtoAtto2.Text, Len(TxtDtoAtto2.Text) -
1)
End If
ErrorHandler:
End Function
When i call it Like
Private Sub TxtDtoAtto2_Change()
MyFunction( TxtDtoAtto2)
End sub
Private Sub TxtDtoAtto2_KeyPress(ByVal KeyAscii As
MSForms.ReturnInteger)
strTempAscii = ""
strTempAscii = KeyAscii
End Sub
it doesnt work, Is there something im not doing?
I would Declare this in a new module, but when i call it
Function MyFunction(NewText as string)
On Error GoTo ErrorHandler
If IsNumeric(Chr(strTempAscii)) Or Chr(strTempAscii) = "-" Or _
Chr(strTempAscii) = "/" Or Chr(strTempAscii) = "\" Then
Else
strTempAscii = ""
TxtDtoAtto2.Text = Left(TxtDtoAtto2.Text, Len(TxtDtoAtto2.Text) -
1)
End If
ErrorHandler:
End Function
When i call it Like
Private Sub TxtDtoAtto2_Change()
MyFunction( TxtDtoAtto2)
End sub
Private Sub TxtDtoAtto2_KeyPress(ByVal KeyAscii As
MSForms.ReturnInteger)
strTempAscii = ""
strTempAscii = KeyAscii
End Sub
it doesnt work, Is there something im not doing?