Hello Everyone!
I am usung a year calender table (e.g. 1998) and set in the
OnRowChange event( VCL modified not standard TDBGrid)
(ONRowChange will be triggered when you move the record pointer
up or down.)
a Range in a second table which is displayed in a second DBGrid
with an Table.Indexname with 3 keyfields.
in the OnRowchange Event ....
Table.CancelRange;
Table.Indexname := 'DATE+EMPLOYEE+TIME'; <-- the sort only works with '+'
signs and not with semicolons ';'.
Table.SetRangeStart;
............<--- start keyvalues assigned to the 3 keyfields
Table.SetRangeEnd;
....... <--- end keyvalues assigned to the 3 keyfields
Table.ApplyRange;
My first question:
1. Why does my sort only work with '+' and not with semicolons ';'?
The second step is to calculate an CalcField with the total work hours/ per
day
of this employee.
For Example at the 5th Oct. 1998 this emplyee had 3 records
with 3 hours in the first ; 4 hours in the second and 3 hours in the
third.
To calculate this total hours for this day I wrote a simply add function
were I add very keyvalue of the working hour field up to the next....
This Result for each day will be display in a calcfield of my calender table
for
the depending day.
I trigger the add function within the OnCalcFieldsEvent
So and here is my question.
After start Up of my DB App when the CalcfieldsEvent has
finished I get for every day a correct result of my total hour Table field
calculated in the calender table , expect the 1. Record.
In the 1. record of my calender table ( this is the 1. record in
my range ( range is set on the month, for example 'January'))
Hear is Table.BOF = TRUE I checked it with the Breakpoints .
Everything looks fine but it does not work. Even when a Calcfield
Event will be triggered again .
For example when I add a new record to emplyee ---> total working
hours will be increased -----> OnCalcfields Event
will be triggered , then I get the correct hours in the 1. Record, too.
Can anyone help me. With the Indexname := ''DATE;EMPLOYEE';
it work everytime.
PS: Very indexed field is a TStringField !!!
Sorry for the long explanation but I couldn´t make it shorter.
Best Regards;
Eric
IB-DATA
erich-brun...@xpoint.at