2016-07-12 64 views
1

我想在以下更新查詢中調用此VBA函數,並且出現此錯誤。我被卡住了,我不知道該怎麼做。函數簽名對我來說似乎沒問題。MS Access:您輸入的表達式太複雜

enter image description here

Compute([ep].[ReferenceNumber],[ep].[ITU3Number],[ep].[AuthorizationNumber],[ep].[Ent],[ep].[Indicator],[ep].[LineCode],[ep].[ProductLinee],[ep].[Inp_ProfitCenterCode],[ep].[Inp_ParisBOCode],[ep].[StartDate],[ep].[EndDate],[ep].[ExtractionDate],[ep].[OffBalance],[ep].[IType],[ep].[Counterparty],[ep].[WAL],[ep].[Inp_BackupLineIndicator],[ep].[Indicator],[ep].[FinalRating],[ep].[Amount],[ep].[Currency],[ep].[Historical],[ep].[rice],[ep].[MaturityIndicator],[ep].[pproachType],[ep].[SignatureDate],[ep].[IMaturityDate],[ep].[ProductType],[ep].[Inp_StepupDuration],[ep].[ProbabilityOfStepup],[ep].[SCF],[ep].[ICollateralSCF],[ep].[MobilFlag,[ep].[MarginBp],[ep].[ExtensionCode],[ep].[ExtensionYear],[ep].[UsageType],"a","a")

+0

我不確定是否有計算功能。你有沒有截斷這個名字? – ThunderFrame

+0

是爲了保密!只是假設它是相同的。 – Json

+0

最好不要把它放在截圖中! – ThunderFrame

回答

2

表達太長訪問過程:

可接受的最大長度似乎是約560個字符的參數的最大數量似乎是29。

例如,通過截斷一些字段,這可以工作:

Compute([ep].[ReferenceNumber],[ep].[ITU3Number],[ep].[AuthorizationNumber],[ep].[Ent],[ep].[Indicator],[ep].[LineCode],[ep].[ProductLinee],[ep].[Inp_ProfitCenterCode],[ep].[Inp_ParisBOCode],[ep].[StartDate],[ep].[EndDate],[ep].[ExtractionDate],[ep].[OffBalance],[ep].[IType],[ep].[Counterparty],[ep].[WAL],[ep].[Inp_BackupLineIndicator],[ep].[Indicator],[ep].[FinalRating],[ep].[Amount],[ep].[Currency],[ep].[Historical],[ep].[rice],[ep].[MaturityIndicator],[ep].[pproachType],[ep].[SignatureDate],[ep].[IMaturityDate],[ep].[ProductType],[ep].[Inp_StepupDuration])

這工作:

Compute(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29)

但這種失敗:

Compute(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30)

所以,你可以做這樣的事情:

Compute(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,SubCompute(29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56))

+0

讓我試試.. tnx。儘管我不確定是否可以調用函數作爲參數。 – Json

+0

是的,你可以使用函數*返回值*作爲參數。 VBA將評估內部函數並將結果傳遞給外部函數。而且因爲它是VBA,你可以返回你無法輕易從Access SQL傳遞的數組和其他對象。 – ThunderFrame