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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table behavior

Status
Not open for further replies.

Paul25441

Programmer
Mar 31, 2007
8
BE
Hello all,

I'm using a table containing following fields:id number, firstname, lastname,etc..
I'm using this table in a form to add some more information about the concerned person. This is working fine, but some times it happen's that the firstname and only the firstname) in record 1 is replaced by the firstname of the record with which I'm workin at the moment ( example: I'm at record 456, the first name there is Christian, when I reopen the form at record 1, the firtname there is now Christian instread of John)

How to avoid this?

regards, Paul
 
Are you doing any Seeks in the form in Textbox Valid methods?
Or
Are you moving the record pointer off the record you are Adding / Editing in a GotFocus or LostFocus Method?

If the answer to any of these questions is Yes, You may not be saving the recno() of the record being edited and after the seek you are not returning there.

Example ZipCode.Valid()

local lnReturn
Alltrim(this.value)
if indexseek(this.value,.T.,FormTable,ZipIndex]
thisform.city.value=zipcode.city
thisform.state=zipcode.state
lnReturn=1 && I Assume City&State tab order is before zip
else
store '' to thisform.city.value,thisform.state.value
lnReturn=-2 && I Assume City&State tab order is before zip
endif
return lnReturn

Here you moved off the record pointer and never went back.

if you do something like this
create a form property called fnRecno
at the top of the method add
thisform.fnRecno=recno()
do the method code....
goto (thisform.fnRecno)
Else
Someone else may have a better idea.
endif



David W. Grewe (Dave)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top