0
我在訪問VBA使這個功能:插入與可變數目
Function test_zeroSQL()
Dim nsemaine As Single
Dim var11 As Single
Dim var50 As Single
Dim var60 As Single
Dim var11b As Single
Dim var50b As Single
Dim var60b As Single
nsemaine = DatePart("ww", Date, 2, 2) - 1
If zero11() = 0 Then
var11 = 1
var11b = 1
Else
var11 = zero11()
var11b = zero11b()
End If
If zero50() = 0 Then
var50 = 1
var50b = 1
Else
var50 = zero50()
var50b = zero50b()
End If
If zero60() = 0 Then
var60 = 1
var60b = 1
Else
var60 = zero60()
var60b = zero60b()
End If
test_zeroSQL = "INSERT INTO [Taux de Service] (Semaine, [Sortie B60], [Nc B60], [Sortie B50], [Nc B50], [Sortie B11], [Nc B11])"
test_zeroSQL = test_zeroSQL & vbCrLf & "VALUES (" & nsemaine & "," & var60 & "," & var60b & "," & var50 & "," & var50b & "," & var11 & " ," & var11b & ")"
End Function
但它不工作,我有這樣的信息: 「請求值的數量必須目的地的數量一致字段「
我認爲它來自我的變量的歸屬,因爲它在我用整數替換單個元素時起作用。 儘管如此,我也檢查過我的領域是「單身」。 我不明白它可能來自哪裏...
你能幫我嗎?
非常感謝您! – Bast