PMFJI, so,
Have this code for if they enter it by hand. And have code in the getdir button function that does your strtran there?
HTH
Beth
>I like it! But, now I have an embarrasing development. The textbox value could also be populated using the GETDIR function, so there may not be any KeyPress events fired. Sorry...
>
>>Well, making it more complicated just so not to use variables <g>
>>
>>
>>loForm = Createobject('myForm')
>>loForm.Show(1)
>>
>>define class myForm as Form
>> add object myTextBox as Textbox
>>
>> procedure myTextBox.KeyPress(nKeyCode, nShiftAltCtrl)
>>
>> nodefault
>> if nKeyCode # 92 or At('\', this.Value) = 0
>> Dodefault(nKeyCode, nShiftAltCtrl)
>> if ((nKeyCode = 92) or (nKeyCode = 127 and substr(this.Value, this.SelStart, 1) == '\' and substr(this.Value, this.SelStart - 1, 2) # '\\')) and nShiftAltCtrl = 0
>> Dodefault(nKeyCode, nShiftAltCtrl)
>> endif
>> endif
>>
>> endproc
>>
>>enddefine
>>
>>
>>[Update] By the way, I realize that you can still press DEL or select text and then overwrite/delete, but do not feel like adding more code, after all this might not even be what Jay needs, maybe I completely misunderstood him.