我用了速达5000,发现其里面的过滤功能做得很好, 对Lookup型字段有现成的值可选,fkData型字根据不同类型可以进行不同输入.这样使用户用起来很容易.  如按仓库查询某订购入库单选中仓库字段时其相应仓库名称列表值会让你查找.  以前我做了个通用的. 但没有这么人性化.不知那么高手看怎样设计为好?

解决方案 »

  1.   

    先读入字段,然后判断他的类型,就显示不同的输入方式,
    fType :TfieldType;
     fType :=ads.Fields[i].DataType; //用于得到field的类型,这个结果不是string,你要自己去转换
        Case fType  of
            ftWideString,ftString,ftFixedChar : strType:='Text';
            ftDate,ftDateTime : strType :='Date';
            ftBoolean :strType :='Boolean';
            ftMemo :strType :='memo';
            ftSmallint,ftInteger,ftWord,ftAutoInc :strType:='Integer' ;
            ftFloat,ftCurrency,ftbcd :strtype:='float';
      

  2.   

    同意bbm011(方军) ,根据不同的类型生成不同的控件,再把DataSet里的值传入Combobox里可以选择也可以手工输入.