Office中国论坛/Access中国论坛
标题:
紧急请教:代码问题
[打印本页]
作者:
ljwei692
时间:
2003-11-21 22:20
标题:
紧急请教:代码问题
下面这段代码在原有MDB数据库中正常运行,可当我把数据表导到SQL中后却无法正常运行,这到底是为什么?是不是升迁数据后好多对象都不能用了?恳求各位高手解答,谢谢!
Set CostCode = db.OpenRecordset("SELECT [Account Code_BSF].[Account Code], [Account Code_BSF].T1, [Account Code_BSF].T6 FROM [Account Code_BSF] where [WBS Code]= " & str1)
With CostCode
Dim descrip As String
descrip = DLookup("[subject]", "[inv reg entry]", "[invoice reg no]=" & [Invoice Reg No] & " ")
Dim SuppCode As String
SuppCode = DLookup("[supplier code]", "[inv reg entry]", "[invoice reg no]=" & [Invoice Reg No] & " ")
Dim mAccountCode, mT1, mT6
maccoundcode = ![Account Code]
mT1 = ![T1]
mT6 = ![T6]
Set CostSplit = db.OpenRecordset("select * from [invoice_cost element] where [Invoice reg no2:]=" & [Invoice Reg No] & " and [Account Code]='" & ![Account Code] & "' and [T1]='" & ![T1] & "' and [T6]='" & ![T6] & "'")
With CostSplit
If CostSplit.RecordCount = 0 Then
CostSplit.AddNew
Else
CostSplit.Edit
End If
![Invoice Reg No2:] = [Invoice Reg No]
![Amount splited] = SplitAmount
![Account Code] = maccoundcode
![T1] = mT1
![T6] = mT6
![Description] = descrip
If Len(SuppCode) > 4 Then
![T4] = SuppCode
Else: ![T5] = SuppCode
End If
CostSplit.Update
End With
CostSplit.Close
End With
CostCode.Close
作者:
zhuyiwen
时间:
2003-11-22 03:47
DAO的方法不能用在ADP中
作者:
ljwei692
时间:
2003-11-26 18:36
谢谢!这个问题我已经解决,通过一批UPDATA 来实现的。不过我这个是只升迁数据表,前端DAO都不能用了,我需要一个一个该过来。
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3