Dim djbh As WinFor m.ComboBox = e.Form.Controls("单据编号")
Dim cmd As New SQ LCommand
Dim dt As DataTable
Dim cmb As WinForm.ComboBox
cmd.Conn ecti
cmd.Comma ndText = "S EL EC T fbillno as 单据编号,{t_Supplier}.Fname as 供应商 ,{POOrder}.fdate as 日期 ,{t_Department}.FName as 部门,{t_ICItem}.fname as 物料名称,{t_ICItem}.FModel as 规格型号, " &
"{t_MeasureUnit}.fname As 单位 ,{t_Currency}.Fname As 币别,{POOrderEntry}.FQty As 数量,{t_emp}.FName As 业务员, b.fname As 制单人 ,{t_user}.fname As 审核人, {POOrder}.FCheckDate As 审核时间 " &
"From ({POOrder} left join {t_Supplier} on {POOrder}.FSupplyID = {t_Supplier}.FItemID left join {t_Department} on {POOrder}.FDeptID = {t_Department}.FItemID " &
"left join {POOrderEntry} on {POOrder}.FInterID = {POOrderEntry}.FInterID inner join {t_ICItem} on {POOrderEntry}.FItemID = {t_ICItem}.FItemID inner join {t_MeasureUnit} on {t_ICItem}.FUnitID = {t_MeasureUnit}.FMeasureUnitID " &
"inner join {t_emp} on {POOrder}.FEmpID = {t_emp}.fitemid inner join {t_Currency} on {POOrder}.FCurrencyID = {t_Currency}.FCurrencyID left join {t_User} on {POOrder}.fcheckerid = {t_User}.FUserID) " &
"left join {t_User} b on {POOrder} .FBillerID = b .FUserID WHERE fbillno = '" & djbh.Value & "'"
dt = cmd.ExecuteReader()
cmb = e.Form.Controls("供应商")
cmb.ComboList= dt.GetComboListString("供应商")
cmb = e.Form.Controls("单据编号")
cmb.ComboList= dt.GetComboListString("单据编号")
cmb = e.Form.Controls("物料名称")
cmb.ComboList= dt.GetComboListString("物料名称")
cmb = e.Form.Controls("部门")
cmb.ComboList= dt.GetComboListString("部门")
cmb = e.Form.Controls("规格型号")
cmb.ComboList= dt.GetComboListString("规格型号")
Tables("窗口2_Table1").DataSource = dt
Tables("窗口2_Table1").DataTable.DataCols("数量").Decimals = 1
Tables("窗口2_Table1").DataTable.DataCols("数量").SetFormat("0.0")
Tables("窗口2_Table1").AutoSizeCols() '自动列宽