>>>The only way you can have a performance problem with reccount() is, not with the function itself, but in opening the table - for example, if it starts with thousands of deleted records, and you have SET DELETED ON. Also, some users have reported performance problems (again, when opening tables), with certain antivirus products.
>>
>>Good point!
>
>I have SET DELETED ON at the beginning of the program.... sigh.... so I had to resort to this... what do you think???
>
>What I want to do is Enable or Disable a command button (cmdRelease) if I have at LEAST one record that is not deleted in the table poshold.... SET DELETED is ON
>
>
>LOCAL llEOF, llBOF
>
>*TMT 07/21/09 llEOF and llBOF
>llEOF = .F.
>llBOF = .F.
>
>SELECT poshold
>GO bottom
>IF EOF()
> STORE .T. to llEOF
>ENDIF
>GO TOP
>IF BOF()
> STORE .T. to llBOF
>ENDIF
>DO case
> *No records at all
> CASE llBOF AND llEOF
> Thisform.cmdrelease.Enabled = .F.
> *One (or more) record(s) (at least one is not deleted), period
> CASE NOT llBOF AND NOT llEOF
> Thisform.cmdrelease.Enabled = .T.
> *All records are deleted
> CASE NOT llBOF AND llEOF
> Thisform.cmdrelease.Enabled = .F.
>ENDCASE
>GO TOP IN poshold
>
>Thisform.Closable=.F.
>
>
>I could tighten this up and just have...
>
>
>DO case
> *One (or more) record(s) (at least one is not deleted), period
> CASE NOT llBOF AND NOT llEOF
> Thisform.cmdrelease.Enabled = .T.
>ENDCASE
>
>
>since that was the only condition that made the cmdRelease Enable to be True... (that we have at least ONE record that is not deleted).
>
>Tommy
You could do
SELECT poshold
LOCATE
Thisform.cmdrelease.Enabled = NOT EOF()
Locate will try and find the first record if it's at EOF then it found none.
Charles
"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers