Hello
When I sort my grid with varios buttons with set filter().
But if the filter don't find any records an error comes up:
record is out of range.
Here is the code for one button:
clear
thisform.label3.caption = "ATT GÖRA IDAG"
set filter to avslutad <> .T. and startdatum = (date())
thisform.grid1.refresh
thisform.grid1.setfocus
go top
LOCAL lnCount
lnRecNo = RECN()
COUNT FOR (avslutad) <> .T. and (startdatum) = date() ;
AND !DELETED() TO lnCount
GO lnRecNo
THISFORM.label4.Caption = ALLT(STR(lnCount))
Is it maybe the count function that causes the problem??
Need help.
Thanks
//Holm
When I sort my grid with varios buttons with set filter().
But if the filter don't find any records an error comes up:
record is out of range.
Here is the code for one button:
clear
thisform.label3.caption = "ATT GÖRA IDAG"
set filter to avslutad <> .T. and startdatum = (date())
thisform.grid1.refresh
thisform.grid1.setfocus
go top
LOCAL lnCount
lnRecNo = RECN()
COUNT FOR (avslutad) <> .T. and (startdatum) = date() ;
AND !DELETED() TO lnCount
GO lnRecNo
THISFORM.label4.Caption = ALLT(STR(lnCount))
Is it maybe the count function that causes the problem??
Need help.
Thanks
//Holm