Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.01.31;
Скачать: CL | DM;

Вниз

Запись в поле...   Найти похожие ветки 

 
ЕвгенийА   (2001-12-30 19:06) [0]

Не могу записать в поле,
посмотрите что не так...
Ошибку пишет что-то вроде того что не дан доступ для редактирования....
вот:


Form6.Table1.Edit;
Form6.Table1.First;
for j:=1 to Form6.Table1.RecordCount do begin
if j=1 then
Form6.Table1.FieldByName("Col").Asinteger:=N;
if j=2 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u10[t]);
if j=3 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u12[t]);
if j=4 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u13[t]);
if j=5 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u14[t]);
if j=6 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u15[t]);
if j=7 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u16[t]);
if j=8 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u17[t]);
if j=9 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u18[t]);
if j=10 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u19[t]);
if j=11 then
Form6.Table1.FieldByName("Col").Asinteger:=round(sumU1[t]);
if j=12 then
Form6.Table1.FieldByName("Col").Asinteger:=round(sumU2[t]);
if j=13 then
Form6.Table1.FieldByName("Col").Asinteger:=round(i20[t]);
if j=14 then
Form6.Table1.FieldByName("Col").Asinteger:=round(i22[t]);
if j=15 then
Form6.Table1.FieldByName("Col").Asinteger:=round(i23[t]);
if j=16 then
Form6.Table1.FieldByName("Col").Asinteger:=round(i24[t]);
if j=17 then
Form6.Table1.FieldByName("Col").Asinteger:=round(i25[t]);
if j=18 then
Form6.Table1.FieldByName("Col").Asinteger:=round(sumI1[t]);
if j=19 then
Form6.Table1.FieldByName("Col").Asinteger:=round(sumI2[t]);




Form6.Table1.Next;
end;

Form6.Table1.Post;


 
panov   (2001-12-30 19:09) [1]

Edit выдается на каждую редактируемую запись.
Точно так же, как и Post.


 
Wizard_Ex   (2002-01-02 13:49) [2]

Form6.Table1.First;
for j:=1 to Form6.Table1.RecordCount do begin
Form6.Table1.Edit;
if j=1 then
Form6.Table1.FieldByName("Col").Asinteger:=N;
if j=2 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u10[t]);
if j=3 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u12[t]);
if j=4 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u13[t]);
if j=5 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u14[t]);
if j=6 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u15[t]);
if j=7 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u16[t]);
if j=8 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u17[t]);
if j=9 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u18[t]);
if j=10 then
Form6.Table1.FieldByName("Col").Asinteger:=round(u19[t]);
if j=11 then
Form6.Table1.FieldByName("Col").Asinteger:=round(sumU1[t]);
if j=12 then
Form6.Table1.FieldByName("Col").Asinteger:=round(sumU2[t]);
if j=13 then
Form6.Table1.FieldByName("Col").Asinteger:=round(i20[t]);
if j=14 then
Form6.Table1.FieldByName("Col").Asinteger:=round(i22[t]);
if j=15 then
Form6.Table1.FieldByName("Col").Asinteger:=round(i23[t]);
if j=16 then
Form6.Table1.FieldByName("Col").Asinteger:=round(i24[t]);
if j=17 then
Form6.Table1.FieldByName("Col").Asinteger:=round(i25[t]);
if j=18 then
Form6.Table1.FieldByName("Col").Asinteger:=round(sumI1[t]);
if j=19 then
Form6.Table1.FieldByName("Col").Asinteger:=round(sumI2[t]);
Form6.Table1.Post;
Form6.Table1.Next;
end;

Думаю вообще что case лучше подойдет...

типа
case Form6.Table1.FieldByName("Col").Asinteger of
1 : Form6.Table1.FieldByName("Col").Asinteger:=N;
2 : Form6.Table1.FieldByName("Col").Asinteger:=round(u10[t]);
3 : Form6.Table1.FieldByName("Col").Asinteger:=round(u12[t]);
else xxxx
end;

......



Страницы: 1 вся ветка

Текущий архив: 2002.01.31;
Скачать: CL | DM;

Наверх




Память: 0.45 MB
Время: 0.005 c
7-100091
ReNoiZer
2001-10-18 17:57
2002.01.31
Убедительная просьба к Mystic...


1-100012
Havez
2002-01-13 18:45
2002.01.31
Выделение строки DBGrid цветом


3-99873
EternalWonderer
2001-12-26 15:21
2002.01.31
Вставка данных в поле LONG в ORACLE


4-100110
Song
2001-12-02 22:50
2002.01.31
Узнать, что программа уже запущена


4-100095
Miwa
2001-11-30 20:07
2002.01.31
SendMessage





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский