JP,
I got that also, but as the ActiveControl property was part of your original
code, I thought it must work for you.
What is ActiveControl?
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Jean-Pierre D via OfficeKB.com" wrote in message
...
Hi Bob,
I get an error message on the 'ctl.active.control' in your onlynumbers
sub....
any ideas for improvement ?
Thanks,
JP
Bob Phillips wrote:
Pass the control to the Sub
Private Sub nw_premieNP_change()
OnlyNumbers nw_premieNP
End Sub
Private Sub nw_secondNP_change()
OnlyNumbers nw_secondNP
End Sub
and then the following sub:
Private Sub OnlyNumbers(ctl As Object)
With ctl.ActiveControl
If Not IsNumeric(.Value) And .Value < vbNullString Then
MsgBox "Sorry, alleen getallen toegestaan"
.Value = vbNullString
End If
End With
End Sub
Hi,
[quoted text clipped - 25 lines]
Thanks,
Jean-Pierre
--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200508/1