|
在程序运行时,默认加载的是DOC1,当DOC1页面上的一个字段A发生变化时,DocView.doc会随着字段A其变化而变化,代码如下:
with Dataset do
begin
if FieldByName('Mode').AsString='A' then DocView2.DocClassID :='TECHNIQUESHEETFORM'
else if FieldByName('Mode').AsString='B' then DocView2.DocClassID :='MANAGERSHEETFORM'
else if FieldByName('Mode').AsString='C' then DocView2.DocClassID :='OPERATESHEETFORM'
else if FieldByName('Mode').AsString='D' then DocView2.DocClassID :='PERSONSHEETFORM';
DocView2.RefreshDoc(True);
end;
在实际运行中,却报错,并且报错还不一样,有时报
Access violation at address 400058C4 in module 'rtl60.bpl'. Read of address 0000005F
有时报
Access violation at address 023A4B9E in module 'CLRModel.bpl'. Read of address 00000000
请帮看下,哪个地方有问题,正确的写法又是如何写的 |
|