Office中国论坛/Access中国论坛

标题: 请高手帮下!!!!!! [打印本页]

作者: ZZBZZBZZZB    时间: 2009-6-23 09:01
标题: 请高手帮下!!!!!!
Private Sub Command41_Click()

Dim rsmx As ADODB.Recordset
Dim mysql As String, aq As String
Dim tyu As String
tyu = Combo12.Value

Set rsmx = New ADODB.Recordset


mysql = "select
明细科目,总帐科目 into
aq
from
明细科目表
where
总帐科目 ='" & Combo12.Value & "'"


rsmx.Open mysql, CurrentProject.Connection, adOpenKeyset, adLockOptimistic

'更改表名"aq"为组合框的值"tyu"

DoCmd.Rename tyu
, acTable, "aq"


'rsmx.Close

End Sub
上面的是好的,下面的却通不过?为何?Private Sub Command42_Click()
Dim rsm As ADODB.Recordset
Dim mysql As String, aq As String
Dim tyu As String
tyu = Combo12.Value

Set rsm = New ADODB.Recordset


mysql = "select
日期,凭证编号,摘要,总帐科目,明细科目,借方金额,贷方金额 into aq from 清单 where 总帐科目 ='" & Combo12.Value & "'"


rsm.Open mysql, CurrentProject.Connection, adOpenKeyset, adLockOptimistic

'更改表名"aq"为组合框的值"tyu"

DoCmd.Rename tyu, acTable, "aq"


' rsmx.Close

End Sub




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3