>I have a form that is behaving strangely. I am using a dataenvironment, buffer mode 3, setting an index and have this in the dataenvironment init method:
>
>sele depot (name of main table and initially selected alias)
>go bott
>
>When the form appears, all the fields are greyed out and the record pointer is at eof(). The form works other than that, but when I use a previous (skip -1) to move off this record, the code below gives me additional problems.
>
>I have used an piece of code to check the status of the record buffer before moving to a new record for years and never had a problem. I use optimistic row buffering for tables and this routine: (abbreviated)
>
>lstatus = getfldstate(-1)
>
>This should return a numeric with one digit for each field. I then look at this to see if any fields are not ones.
>
>Lstatus is coming back as a null. Is this because I was at EOF()?
>
>Where might I look to see how I am getting to eof() rather than bottom?
>
>VFP 5.0a
Potter,
If you use -1 then return value is a character string.
NULL returns if you're at eof(). You could use nvl() there :
nvl(getfldstate(-1),replicate("1",fcount()+1)).
There are a lot of things that might put you at eof.
But first I would check for a relation. And if there is a relaition an orphaned child key might be the reason.
Set deleted on and all recs deleted, set key, set filter etc.
Cetin