我是菜鸟,求助各位大侠,帮帮忙!
原句是这样的:
    '检测有没有足够的库存
    fMainForm.m_checkado.RecordSource = "select sum(select 库存数量 from 库存状况 where 仓库编号=仓库.编号 and 货物编号=" + 货物编号.Text + ") as 库存量 from 仓库,货物信息 where 仓库.编号=" + Str(原存放仓库编号) + " and 货物信息.编号=" + 货物编号.Text
    fMainForm.m_checkado.Refresh
    Dim max1 As String
    
    On Error Resume Next
    max1 = fMainForm.m_checkado.Recordset.Fields(0).Value
    
    '如果超过最高限量
    Dim a1, b1 As Long
    a1 = 数量.Text: b1 = max1    If a1 > b1 Then
        MsgBox "调拔失败,不能调拔" + 数量.Text + ",原仓库库存剩余量为" + Str(max1)
        Exit Sub
    End If
我的问题是,谁能帮我分析一下这句是什么意思,帮帮忙,具体一点:
"select sum(select 库存数量 from 库存状况 where 仓库编号=仓库.编号 and 货物编号=" + 货物编号.Text + ") as 库存量 from 仓库,货物信息 where 仓库.编号=" + Str(原存放仓库编号) + " and 货物信息.编号=" + 货物编号.Text
这是我从网上下载的一个源码,不改动就没问题,我把数据库的表名和字段名改了后就出现问题了:
    fMainForm.m_checkado.RecordSource = "select sum(select L3 from sheet12 where L2='sheet02.B1' and L2='" + 货物编号.Text + "') as 库存量 from sheet02,sheet08 where sheet02.B1='" + Str(原存放仓库编号) + "' and sheet08.H1='" + 货物编号.Text + "'"
    fMainForm.m_checkado.Refresh
调试的时候,总是提示:实时错误“3021”,BOF或EOF中有一个是真,或者当前的记录已被删除,所需的操作要求一个当前的记录。在线等,请大家帮帮忙!