>Hi!
>
>Then at the top of the InteractiveChange store the value of SelStart in variable, then restore it back at the end of the event. Each time when you change focus or refresh control, the insertion point is moved to the first character in the textbox. Just restore it - instead of the len(this.Text) use stored value.
How can I miss this simple idea? :) Thanks, it worked just fine.
>
>>>Hi!
>>>
>>>Try:
>>>
>>>This.SetFocus()
>>>this.SelLength=0
>>>this.SelStart=len(this.Text)
>>>
>>>HTH.
>>>
>>
>>Vlad,
>>
>>The problem is, that the Lender name is modified, e.g. originally was 1st Bank Boston and the person needs to change it to First Bank Boston. So, each time I have to be on the position, I left it before. I don't want to create my own class for this, though it might be necessary...
>>
>>>>Hi everybody,
>>>>
>>>>I have two grids on the form + 2 grid Highlighters by Nick Nekloidov. First grid is based on BldMstr table and displayes Status, Lender Code, Lender Name, Old Lender Code, Old Lender Name. The second grid is based on LenderView and displayes lenders from Lookup Lender table based on the first letter in Lender Name field of the BldMstr table. In other words, when I navigate from record to record I requery() the view, if the first letter changes. I also perform a "soft" seek based on the 4 first letters of Lender Name. It works fine.
>>>>However, I added a possibility to edit Lender Name directly on the BldMstr grid. Here is my code in InteractiveChange event of Lender Name textbox:
>>>>
>>>>********************************************************************
>>>>* Description.......: Lender Name.InteractiveChange
>>>>* Calling Samples...:
>>>>* Parameter List....:
>>>>* Created by........:
>>>>* Modified by.......: Nadya Nosonovsky 09/05/2001 09:59:46 AM
>>>>********************************************************************
>>>>if this.tag<>this.value
>>>> local lcOldValue
>>>> select BldMstr
>>>> if !empty(OldValue)
>>>> lcOldValue=BldMstr.OldValue
>>>> else
>>>> lcOldValue=BldMstr.Lender + '|' + this.tag
>>>> endif
>>>> if thisform.ProcType = 'Trxnmstr'
>>>> replace RevLend with 'E', ;
>>>> Matched with 'E', ;
>>>> OldValue with m.lcOldValue in BldMstr
>>>> else
>>>> replace RevLend with 'E', ;
>>>> OldValue with m.lcOldValue in BldMstr
>>>> endif
>>>> thisform.KeyValue=left(this.value,1)
>>>> lcLetter=thisform.KeyValue
>>>> requery('LenderView')
>>>> =seek(left(this.value,4),'LenderView')
>>>> thisform.grdLender.refresh()
>>>>* thisform.grdLender.SetFocus()
>>>>*!* this.SetFocus()
>>>>endif
>>>>dodefault()
>>>>
>>>>As you can see, I commented out two last lines, because it causes "reverse" typing, e.g. the user tries to quickly type "first", but it shows like "tsrif".
>>>>
>>>>So, my question is: is it possible to highlight the record in grdLender, but have ability to work with grdBldMstr? It's not critical and my manager and user accepted, that the record on the second grid is highlighted only after he/she leaves this column, but it would be nice to have this record highlighted at the same type, he/she types.
>>>>
>>>>Thanks in advance.
If it's not broken, fix it until it is.
My Blog