passing an object name into a procedure
Posted on 2003-11-22
Private Sub HighLiteMe(oObj As Control)
oObj.SelStart = 0
oObj.SelLength = Len(oObj.Text)
This is used to highlite text in a text box and set the focus to that text box.
It works fine, but I have to hard code the object name as opposed to using a memory
variable. That is
Menu01 is the name of a text box
HighLiteMe(Menu01) works fine BUT
HighLiteMe(mTextBoxName) where mTextBoxName contains the string "Menu01" does not
work, it tells me "wrong datatype"