标题: “参数不足,期待是1” [打印本页] 作者: petrelai 时间: 2004-4-8 23:36 标题: “参数不足,期待是1” Dim id, date2 As String
Me.单据类别 = 2
Me.单据日期.Value = Date
date2 = "S" & Right(Format([单据日期], "YYMMDD"), 5)
id = DMax("[单据编号]", "[销售出库]", "[单据编号] Like '" & date2 & "??'")
If IsNull(id) Then
Me.单据编号 = date2 & "01"
Me.单据编号.SetFocus
Else
Me.单据编号 = date2 & Format(CStr(CInt(Right(id, 2)) + 1), "00")
Me.单据编号.SetFocus
End If
Dim bian, ku, wan, wei, qi, qian, zi, shu, shao
Dim e As Currency
Dim ri As Date
Dim db As DAO.Database
Dim xiaoshuo, kuchunbiao, xiaori As DAO.Recordset
Dim strXs, strXs1, strXs2 As String
Set db = CurrentDb()
[B]strXs = "select 销售出库明细.商品编号,销售出库明细.商品类别,销售出库明细.品名规格,销售出库明细.进货价,销售出库明细.商品售价,销售出库明细.数量 from 销售出库明细 where 销售出库明细.销售出库ID = '" & Forms!报价窗口!销售出库ID & "'"[/B]运行到这里时就出现主题里所说的问题了。Set xiaoshuo = db.OpenRecordset(strXs, dbOpenDynaset)
Do While Not Rs.EOF
bian = xiaoshuo("商品编号")
shu = xiaoshuo("数量")
shao = xiaoshuo("商品售价")
strXs1 = "select 库存表.商品编号,库存表.商品进价 where 库存表.商品编号 = '" & bian & "'" & "and 库存表.完结 = " & False & ""
Set kuchunbiao = db.OpenRecordset(strXs1, dbOpenDynaset)
xiaoshuo("进货价") = kuchunbiao("商品进价")
kuchunbiao("库存量") = kuchunbiao("库存量") - shu
If kuchunbiao("库存量") = 0 Then
kuchunbiao("完结") = True
End If
kuchunbiao.Update