Y
yibbit
Hi
I have a block of code that will check & format a phone number. I want the
same code to check the fax #, cell#, etc... i.e. send the text box on the
form to a function and do my checking from there. How do I send a control to
a function?
code:
Sub Phone_Number_AfterUpdate()
number_check (???)
End Sub
function number_check(ctrl as ????)
Do Until InStr(1, ctrl.Value, "(") = 0
ctrl.Value = Left(ctrl.Value, InStr(1, ctrl.Value, "(") - 1) _
& Right(ctrl.Value, Len(ctrl.Value) - InStr(1, ctrl.Value, "("))
Loop
etc...
end function
I have a block of code that will check & format a phone number. I want the
same code to check the fax #, cell#, etc... i.e. send the text box on the
form to a function and do my checking from there. How do I send a control to
a function?
code:
Sub Phone_Number_AfterUpdate()
number_check (???)
End Sub
function number_check(ctrl as ????)
Do Until InStr(1, ctrl.Value, "(") = 0
ctrl.Value = Left(ctrl.Value, InStr(1, ctrl.Value, "(") - 1) _
& Right(ctrl.Value, Len(ctrl.Value) - InStr(1, ctrl.Value, "("))
Loop
etc...
end function