Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird text box issue

Status
Not open for further replies.

crewchiefpro6

Programmer
Mar 22, 2005
204
US
I have a form with many numeric textboxes on it. I have one field that if it changes will update about 20 other fields with new values. That all works great. My problem is after I update the fields I can see the selected field zip through all the textboxes as if I was pressing enter very quickly. I will stop eventually but not always in the same place.

I have code only in the one textbox's valid.

I just recently changed the textbox from the base class provided with FoxPro to one from Marcia and Andy's book (ch 4 txtNumeric).

I cannot seem to be able to SET STEP ON because every field has many events from their class and each time I click on the fields the step goes through each gotfocus, lostfocus etc. There are about 50 textboxes on the form.

The valid code is:
** see if this.value is character, if it is then convert it using val()
LOCAL lnValThisValue
lnValThisValue = 0

IF VARTYPE(THIS.VALUE) = 'C'
lnValThisValue = VAL(THIS.VALUE)
ELSE
lnValThisValue = THIS.VALUE
ENDIF

WITH THISFORM.pageframe1.leasepage
SELECT model
REPLACE lseCash30 WITH lnValThisValue, lseCash36 WITH lnValThisValue, ;
lseCash39 WITH lnValThisValue, lseCash48 WITH lnValThisValue, lseCash60 WITH lnValThisValue
etc., etc, etc.

.REFRESH()
ENDWITH

Like I said, the highlight just takes off and ends up on the other side of the form each time, but not exactly the same place each time, normally between 1 or 2 fields however.

I don't want to change each textboxes class (never tried that one before) and I am sure there is some simple reason it does this.



Don Higgins
 
forgot to post the other code between the with and endwith which is

.txtleaseRebate30.REFRESH()
.txtleaseRebate36.REFRESH()
.txtleaseRebate39.REFRESH()
.txtleaseRebate48.REFRESH()
.txtleaseRebate60.REFRESH()

there are more of these also but they are all just refreshes.


Don Higgins
 
Alright, after spending 4 hours on this I decided to give up and take up drinking.

For giggles I copied over the class files again, rebooted the computer, drank a vodka and tonic, and went back to work. Now it only jumps 2 fields over instead of 46 - 47 fields.

Still not perfect but a whole bunch better than before and I feel much better.

Any ideas?



Don Higgins
 
Hi Don.

I just recently changed the textbox from the base class provided with FoxPro to one from Marcia and Andy's book (ch 4 txtNumeric).

The class from the book has some issues. I will send you one that I am using in production. The only problem with it is that you cannot use it in a grid and you cannot use it as an unbound control. If you want that functionality you will have to modify it yourself.



Marcia G. Akins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top