>There is no code in the activate event of the base form. I have discovered that since the record pointer moves the data manipulation I do in the form init gets committed. VFP is a real handful. The form lets you set opt or pess buffering but apparently that is only record buffering and not table buffering though nothing seems to say that. There are soooo many of these little gotchas that unless I was really committed to this I would throw up my hands in disgust and walk away. I am still at a loss as to why the record pointer moves. The code in init goes something like this:
>
>if passedparam = 'edit'
> sele inv
> set order to tag line
> seek secondparam
> if !found()
> alert user and kill form
> else
> change some data stuff
> do a sum on another table and put the resulting value in one of the
> fields for this table. The other table is in the data envir butis not
> linked to this one.
> endif
>else
> dealing with a new record and that is not a problem.
>endif
>* there is nothing here or afterward that I can see would move the record pointer, but if I go into debug in the activate event I am on a different record!
Do Sum may make Record move as relation between tables...
To solve this, I suggest you first mark the correct record and seek again!
i.e.
CurrentKey = Table1.Key
* Huge Stuff task here may cause pointer moveSeek "&CurrentKey" in Table1
For ppl who use VFP5 without download SP3, it will sure cause record move if
there is a combox in the form on
ThisForm.Refresh!
For more interest, you can download the cboerr.zip and take a look!
http://members.tripod.com/~justok/cboerr.zipTo handle this, I suggest to do:
With Thisform.Cobox
cRowSource = .RowSource
cControlSource = .ControlSource
.RowSource = ""
.ControlSource = ""
.RowSource = "&cRowSource"
.Value = Eval(cControlSource)
.ControlSource = "&cControlSource"
endwith
Then, protect the combox searching on Refresh form and make sure it will display right value and first show!
Currently, One of my input form use this method,
the time for Add Blank then Refresh form shorten from 40 Seconds to 2 Seconds!!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.