ich habe einen code geschrieben, bei den ein table (stammdaten) zum einen die selben daten erhalten soll wie ein table (variable daten, aufbauend auf stammdaten), zum anderen es weitere Felder automatisch füllen soll (bis jetzt nur das Date-Feld).
Obwohl ich im code keinen Fehler sehe und dieser anfangs funktioniert hat, schreibt er JEDES Feld exact die selbe Anzahl, wie es Datensätze in der Stammtabelle gibt. Wer weiß rat?
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20:
| hauptform.table4.autocalcfields := false; hauptform.table2.autocalcfields := false; hauptform.query2.autocalcfields := false; hauptform.table2.first; hauptform.table4.disablecontrols; hauptform.table2.disablecontrols; while not (hauptform.table2.Eof) do begin hauptform.Table4.Append; hauptform.table4hauptgebiet.value := hauptform.table2hauptbereich.asinteger; hauptform.table4nebengebiet.value := hauptform.table2unterbereich.value; hauptform.table4anzahl.value := hauptform.table2anzahl.value; hauptform.table4verteiler.value := hauptform.table2verteiler.value; hauptform.table4datumderverteilung.value := strtodate(combobox1.text); hauptform.table2.next; end; hauptform.table4.enablecontrols; hauptform.table2.enablecontrols; hauptform.table2.autocalcfields := true; hauptform.table4.autocalcfields := true; hauptform.query2.autocalcfields := true; |
edit: ich habe nur betreffend der Tabellen nur autocalcfields hinzugefügt.