收入汇总表结构
khjl 文本
byfy 数字
syfy 数字
Private Sub front_30hz_Click()
Dim sr(11) As String '声明一个整型变量
Dim intI, intJ As Integer '声明一个整型变量
Dim dblSYFY, dblBYFY As Double
Dim strsql As String
Set db = CurrentDb()
Set recName = db.OpenRecordset("select * from 片区经理")
Set strName = recName![xm]
intI = 0
Do Until recName.EOF
sr(intI) = strName
intI = intI + 1
recName.MoveNext
Loop
recName.Close
For intI = 0 To 10
Set recName = db.OpenRecordset("select sum(总金额a),sum(上月费用a) into " + dblBYFY + "," + dblSYFY + "," + " from 客户清单 where 经理名称='" + sr(intI) + "' ")
Set recName = db.OpenRecordset("select top 30 * from 客户清单 where 经理名称='" + sr(intI) + "' ")
For intJ = 0 To 29
Set strName = recName![总金额a]
Set strName1 = recName![上月费用a]
dblBYFY = dblBYFY + strName
dblSYFY = dblSYFY + strName1
recName.MoveNext
Next intJ
Next intI
recName.Close
End Sub
执行到Set recName = db.OpenRecordset("select sum(总金额a),sum(上月费用a) into " + dblBYFY + "," + dblSYFY + "," + " from 客户清单 where 经理名称='" + sr(intI) + "' ")
这句话提示类型不对,不知道是哪个类型不对?请高手指点。
[此贴子已经被作者于2006-4-24 17:22:15编辑过]
|