currentdb.execute 插入语法问题
currentdb.execute insert into syntax issues
我正在尝试将此代码分配给访问表单上的按钮,以便将表单中的数据输入到指定的 table(结果),清除表单,然后将焦点放回到形式。看来我的代码 currentdb.execute 部分存在语法问题。
Private Sub Command510_Click()
CurrentDb.Execute "INSERT INTO Results ([QC specialist],[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],[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],[57],[58],[59],[60],[61],[62],[63],[64],[65],[66],[67],[68],[Comment (1)] _
,[Comment (2)],[Comment (3)],[Comment (4)],[Comment (5)],[Comment (6)],[Comment (7)],[Comment (8)],[Comment (9)],[Comment (10)],[Comment (11)],[Comment (12)],[Comment (13)],[Comment (14)],[Comment (15)] _
,[Comment (16)],[Comment (17)],[Comment (18)],[Comment (19)],[Comment (20)],[Comment (21)],[Comment (22)],[Comment (23)],[Comment (24)],[Comment (25)],[Comment (26)],[Comment (27)],[Comment (28)] _
,[Comment (29)],[Comment (30)],[Comment (31)],[Comment (32)],[Comment (33)],[Comment (34)],[Comment (35)],[Comment (36)],[Comment (37)],[Comment (38)],[Comment (39)],[Comment (40)],[Comment (41)] _
,[Comment (42)],[Comment (43)],[Comment (44)],[Comment (45)],[Comment (46)],[Comment (47)],[Comment (48)],[Comment (49)],[Comment (50)],[Comment (51)],[Comment (52)],[Comment (53)],[Comment (54)] _
,[Comment (55)],[Comment (56)],[Comment (57)],[Comment (58)],[Comment (59)],[Comment (60)],[Comment (61)],[Comment (62)],[Comment (63)],[Comment (64)],[Comment (65)],[Comment (66)],[Comment (67)],[Comment (68)],[Loan Number],[Submission Date])" _
& "VALUES ('" & Me.[Combo147] & "','" & Me.[Combo165] & "','" & Me.[Combo170] & "','" & Me.[Combo172] & "','" & Me.[Combo174] & "','" & Me.[Combo176] & "','" & Me.[Combo178] & "','" & _
Me.[Combo214] & "','" & Me.[Combo216] & "','" & Me.[Combo218] & "','" & Me.[Combo220] & "','" & Me.[Combo222] & "','" & Me.[Combo224] & "','" & Me.[Combo226] & "','" & Me.[Combo228] & "','" & _
Me.[Combo230] & "','" & Me.[Combo232] & "','" & Me.[Combo237] & "','" & Me.[Combo239] & "','" & Me.[Combo241] & "','" & Me.[Combo243] & "','" & Me.[Combo245] & "','" & Me.[Combo247] & "','" & _
Me.[Combo249] & "','" & Me.[Combo251] & "','" & Me.[Combo253] & "','" & Me.[Combo255] & "','" & Me.[Combo257] & "','" & Me.[Combo259] & "','" & Me.[Combo261] & "','" & Me.[Combo263] & "','" & _
Me.[Combo265] & "','" & Me.[Combo267] & "','" & Me.[Combo269] & "','" & Me.[Combo271] & "','" & Me.[Combo273] & "','" & Me.[Combo275] & "','" & Me.[Combo277] & "','" & Me.[Combo279] & "','" & _
Me.[Combo281] & "','" & Me.[Combo283] & "','" & Me.[Combo285] & "','" & Me.[Combo287] & "','" & Me.[Combo289] & "','" & Me.[Combo291] & "','" & Me.[Combo293] & "','" & Me.[Combo295] & "','" & _
Me.[Combo297] & "','" & Me.[Combo299] & "','" & Me.[Combo301] & "','" & Me.[Combo303] & "','" & Me.[Combo305] & "','" & Me.[Combo307] & "','" & Me.[Combo309] & "','" & Me.[Combo311] & "','" & _
Me.[Combo313] & "','" & Me.[Combo315] & "','" & Me.[Combo317] & "','" & Me.[Combo319] & "','" & Me.[Combo321] & "','" & Me.[Combo323] & "','" & Me.[Combo325] & "','" & Me.[Combo327] & "','" & _
Me.[Combo333] & "','" & Me.[Combo335] & "','" & Me.[Combo337] & "','" & Me.[Combo339] & "','" & Me.[Combo341] & "','" & Me.[Combo343] & "','" & Me.[Text347] & "','" & Me.[Text349] & "','" & _
Me.[Text351] & "','" & Me.[Text353] & "','" & Me.[Text355] & "','" & Me.[Text357] & "','" & Me.[Text359] & "','" & Me.[Text361] & "','" & Me.[Text363] & "','" & Me.[Text365] & "','" & _
Me.[Text367] & "','" & Me.[Text371] & "','" & Me.[Text373] & "','" & Me.[Text375] & "','" & Me.[Text377] & "','" & Me.[Text379] & "','" & Me.[Text395] & "','" & Me.[Text397] & "','" & _
Me.[Text399] & "','" & Me.[Text401] & "','" & Me.[Text403] & "','" & Me.[Text405] & "','" & Me.[Text407] & "','" & Me.[Text409] & "','" & Me.[Text411] & "','" & Me.[Text413] & "','" & _
Me.[Text415] & "','" & Me.[Text417] & "','" & Me.[Text419] & "','" & Me.[Text421] & "','" & Me.[Text423] & "','" & Me.[Text425] & "','" & Me.[Text427] & "','" & Me.[Text429] & "','" & _
Me.[Text431] & "','" & Me.[Text433] & "','" & Me.[Text437] & "','" & Me.[Text439] & "','" & Me.[Text441] & "','" & Me.[Text443] & "','" & Me.[Text445] & "','" & Me.[Text447] & "','" & _
Me.[Text449] & "','" & Me.[Text451] & "','" & Me.[Text453] & "','" & Me.[Text455] & "','" & Me.[Text457] & "','" & Me.[Text459] & "','" & Me.[Text461] & "','" & Me.[Text463] & "','" & _
Me.[Text465] & "','" & Me.[Text467] & "','" & Me.[Text469] & "','" & Me.[Text471] & "','" & Me.[Text473] & "','" & Me.[Text475] & "','" & Me.[Text477] & "','" & Me.[Text479] & "','" & _
Me.[Text481] & "','" & Me.[Text483] & "','" & Me.[Text485] & "','" & Me.[Text487] & "','" & Me.[Text489] & "','" & Me.[Text491] & "','" & Me.[Text493] & "','" & Me.[Text495] & "','" & _
Me.[Text497] & "','" & Me.[Text501] & "','" & Me.[Text504] & "','" & Me.[Text163] & "')"
'clear fields
cmdClear_Click
'focus on top
Me.Combo147.SetFocus
End Sub
提前致谢!
确实应该重组数据,但同时连接。
CurrentDb.Execute "INSERT INTO Results ([QC specialist],[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],[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],[57],[58],[59],[60],[61],[62],[63],[64],[65],[66],[67],[68],[Comment (1)]," & _
"[Comment (2)],[Comment (3)],[Comment (4)],[Comment (5)],[Comment (6)],[Comment (7)],[Comment (8)],[Comment (9)],[Comment (10)],[Comment (11)],[Comment (12)],[Comment (13)],[Comment (14)],[Comment (15)]," & _
"[Comment (16)],[Comment (17)],[Comment (18)],[Comment (19)],[Comment (20)],[Comment (21)],[Comment (22)],[Comment (23)],[Comment (24)],[Comment (25)],[Comment (26)],[Comment (27)],[Comment (28)]," & _
"[Comment (29)],[Comment (30)],[Comment (31)],[Comment (32)],[Comment (33)],[Comment (34)],[Comment (35)],[Comment (36)],[Comment (37)],[Comment (38)],[Comment (39)],[Comment (40)],[Comment (41)]," & _
"[Comment (42)],[Comment (43)],[Comment (44)],[Comment (45)],[Comment (46)],[Comment (47)],[Comment (48)],[Comment (49)],[Comment (50)],[Comment (51)],[Comment (52)],[Comment (53)],[Comment (54)]," & _
"[Comment (55)],[Comment (56)],[Comment (57)],[Comment (58)],[Comment (59)],[Comment (60)],[Comment (61)],[Comment (62)],[Comment (63)],[Comment (64)],[Comment (65)],[Comment (66)],[Comment (67)],[Comment (68)],[Loan Number],[Submission Date]) " & _
考虑querydef parameterization。这是一个典型的需求,参数化不仅仅是关于 sql 注入,而是从数据插值中适当地抽象 SQL 代码。
将您的参数化、准备好的 SQL 语句(无数据)保存为 MS Access 查询对象,避免任何双引号或字符串连接的需要。然后在 VBA 中,引用这个保存的查询,将表单控件的实际值绑定到参数占位符,然后执行查询。
SQL (保存一次为存储查询对象;所有列假定为短文本类型)
PARAMETERS [Combo147Param] TEXT(255), [Combo165Param] TEXT(255), [Combo170Param] TEXT(255), [Combo172Param] TEXT(255), [Combo174Param] TEXT(255), [Combo176Param] TEXT(255), [Combo178Param] TEXT(255),
[Combo214Param] TEXT(255), [Combo216Param] TEXT(255), [Combo218Param] TEXT(255), [Combo220Param] TEXT(255), [Combo222Param] TEXT(255), [Combo224Param] TEXT(255), [Combo226Param] TEXT(255), [Combo228Param] TEXT(255),
[Combo230Param] TEXT(255), [Combo232Param] TEXT(255), [Combo237Param] TEXT(255), [Combo239Param] TEXT(255), [Combo241Param] TEXT(255), [Combo243Param] TEXT(255), [Combo245Param] TEXT(255), [Combo247Param] TEXT(255),
[Combo249Param] TEXT(255), [Combo251Param] TEXT(255), [Combo253Param] TEXT(255), [Combo255Param] TEXT(255), [Combo257Param] TEXT(255), [Combo259Param] TEXT(255), [Combo261Param] TEXT(255), [Combo263Param] TEXT(255),
[Combo265Param] TEXT(255), [Combo267Param] TEXT(255), [Combo269Param] TEXT(255), [Combo271Param] TEXT(255), [Combo273Param] TEXT(255), [Combo275Param] TEXT(255), [Combo277Param] TEXT(255), [Combo279Param] TEXT(255),
[Combo281Param] TEXT(255), [Combo283Param] TEXT(255), [Combo285Param] TEXT(255), [Combo287Param] TEXT(255), [Combo289Param] TEXT(255), [Combo291Param] TEXT(255), [Combo293Param] TEXT(255), [Combo295Param] TEXT(255),
[Combo297Param] TEXT(255), [Combo299Param] TEXT(255), [Combo301Param] TEXT(255), [Combo303Param] TEXT(255), [Combo305Param] TEXT(255), [Combo307Param] TEXT(255), [Combo309Param] TEXT(255), [Combo311Param] TEXT(255),
[Combo313Param] TEXT(255), [Combo315Param] TEXT(255), [Combo317Param] TEXT(255), [Combo319Param] TEXT(255), [Combo321Param] TEXT(255), [Combo323Param] TEXT(255), [Combo325Param] TEXT(255), [Combo327Param] TEXT(255),
[Combo333Param] TEXT(255), [Combo335Param] TEXT(255), [Combo337Param] TEXT(255), [Combo339Param] TEXT(255), [Combo341Param] TEXT(255), [Combo343Param] TEXT(255), [Text347Param] TEXT(255), [Text349Param] TEXT(255),
[Text351Param] TEXT(255), [Text353Param] TEXT(255), [Text355Param] TEXT(255), [Text357Param] TEXT(255), [Text359Param] TEXT(255), [Text361Param] TEXT(255), [Text363Param] TEXT(255), [Text365Param] TEXT(255),
[Text367Param] TEXT(255), [Text371Param] TEXT(255), [Text373Param] TEXT(255), [Text375Param] TEXT(255), [Text377Param] TEXT(255), [Text379Param] TEXT(255), [Text395Param] TEXT(255), [Text397Param] TEXT(255),
[Text399Param] TEXT(255), [Text401Param] TEXT(255), [Text403Param] TEXT(255), [Text405Param] TEXT(255), [Text407Param] TEXT(255), [Text409Param] TEXT(255), [Text411Param] TEXT(255), [Text413Param] TEXT(255),
[Text415Param] TEXT(255), [Text417Param] TEXT(255), [Text419Param] TEXT(255), [Text421Param] TEXT(255), [Text423Param] TEXT(255), [Text425Param] TEXT(255), [Text427Param] TEXT(255), [Text429Param] TEXT(255),
[Text431Param] TEXT(255), [Text433Param] TEXT(255), [Text437Param] TEXT(255), [Text439Param] TEXT(255), [Text441Param] TEXT(255), [Text443Param] TEXT(255), [Text445Param] TEXT(255), [Text447Param] TEXT(255),
[Text449Param] TEXT(255), [Text451Param] TEXT(255), [Text453Param] TEXT(255), [Text455Param] TEXT(255), [Text457Param] TEXT(255), [Text459Param] TEXT(255), [Text461Param] TEXT(255), [Text463Param] TEXT(255),
[Text465Param] TEXT(255), [Text467Param] TEXT(255), [Text469Param] TEXT(255), [Text471Param] TEXT(255), [Text473Param] TEXT(255), [Text475Param] TEXT(255), [Text477Param] TEXT(255), [Text479Param] TEXT(255),
[Text481Param] TEXT(255), [Text483Param] TEXT(255), [Text485Param] TEXT(255), [Text487Param] TEXT(255), [Text489Param] TEXT(255), [Text491Param] TEXT(255), [Text493Param] TEXT(255), [Text495Param];
INSERT INTO Results ([QC specialist],[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],[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],[57],[58],[59],[60],[61],[62],[63],[64],[65],[66],[67],[68],[Comment (1)]
,[Comment (2)],[Comment (3)],[Comment (4)],[Comment (5)],[Comment (6)],[Comment (7)],[Comment (8)],[Comment (9)],[Comment (10)],[Comment (11)],[Comment (12)],[Comment (13)],[Comment (14)],[Comment (15)]
,[Comment (16)],[Comment (17)],[Comment (18)],[Comment (19)],[Comment (20)],[Comment (21)],[Comment (22)],[Comment (23)],[Comment (24)],[Comment (25)],[Comment (26)],[Comment (27)],[Comment (28)]
,[Comment (29)],[Comment (30)],[Comment (31)],[Comment (32)],[Comment (33)],[Comment (34)],[Comment (35)],[Comment (36)],[Comment (37)],[Comment (38)],[Comment (39)],[Comment (40)],[Comment (41)]
,[Comment (42)],[Comment (43)],[Comment (44)],[Comment (45)],[Comment (46)],[Comment (47)],[Comment (48)],[Comment (49)],[Comment (50)],[Comment (51)],[Comment (52)],[Comment (53)],[Comment (54)]
,[Comment (55)],[Comment (56)],[Comment (57)],[Comment (58)],[Comment (59)],[Comment (60)],[Comment (61)],[Comment (62)],[Comment (63)],[Comment (64)],[Comment (65)],[Comment (66)],[Comment (67)]
,[Comment (68)],[Loan Number],[Submission Date])
VALUES ([Combo147Param], [Combo165Param], [Combo170Param], [Combo172Param], [Combo174Param], [Combo176Param], [Combo178Param],
[Combo214Param], [Combo216Param], [Combo218Param], [Combo220Param], [Combo222Param], [Combo224Param], [Combo226Param], [Combo228Param],
[Combo230Param], [Combo232Param], [Combo237Param], [Combo239Param], [Combo241Param], [Combo243Param], [Combo245Param], [Combo247Param],
[Combo249Param], [Combo251Param], [Combo253Param], [Combo255Param], [Combo257Param], [Combo259Param], [Combo261Param], [Combo263Param],
[Combo265Param], [Combo267Param], [Combo269Param], [Combo271Param], [Combo273Param], [Combo275Param], [Combo277Param], [Combo279Param],
[Combo281Param], [Combo283Param], [Combo285Param], [Combo287Param], [Combo289Param], [Combo291Param], [Combo293Param], [Combo295Param],
[Combo297Param], [Combo299Param], [Combo301Param], [Combo303Param], [Combo305Param], [Combo307Param], [Combo309Param], [Combo311Param],
[Combo313Param], [Combo315Param], [Combo317Param], [Combo319Param], [Combo321Param], [Combo323Param], [Combo325Param], [Combo327Param],
[Combo333Param], [Combo335Param], [Combo337Param], [Combo339Param], [Combo341Param], [Combo343Param], [Text347Param], [Text349Param],
[Text351Param], [Text353Param], [Text355Param], [Text357Param], [Text359Param], [Text361Param], [Text363Param], [Text365Param],
[Text367Param], [Text371Param], [Text373Param], [Text375Param], [Text377Param], [Text379Param], [Text395Param], [Text397Param],
[Text399Param], [Text401Param], [Text403Param], [Text405Param], [Text407Param], [Text409Param], [Text411Param], [Text413Param],
[Text415Param], [Text417Param], [Text419Param], [Text421Param], [Text423Param], [Text425Param], [Text427Param], [Text429Param],
[Text431Param], [Text433Param], [Text437Param], [Text439Param], [Text441Param], [Text443Param], [Text445Param], [Text447Param],
[Text449Param], [Text451Param], [Text453Param], [Text455Param], [Text457Param], [Text459Param], [Text461Param], [Text463Param],
[Text465Param], [Text467Param], [Text469Param], [Text471Param], [Text473Param], [Text475Param], [Text477Param], [Text479Param],
[Text481Param], [Text483Param], [Text485Param], [Text487Param], [Text489Param], [Text491Param], [Text493Param], [Text495Param])
VBA (定时调用)
Dim qdef As QueryDef
Set qdef = CurrentDb.QueryDefs("myparameterized_savedquery")
qdef![Combo147Param] = Me.[Combo147] : qdef![Combo243Param] = Me.[Combo243]
qdef![Combo165Param] = Me.[Combo165] : qdef![Combo245Param] = Me.[Combo245]
qdef![Combo170Param] = Me.[Combo170] : qdef![Combo247Param] = Me.[Combo247]
qdef![Combo172Param] = Me.[Combo172] : qdef![Combo249Param] = Me.[Combo249]
qdef![Combo174Param] = Me.[Combo174] : qdef![Combo251Param] = Me.[Combo251]
qdef![Combo176Param] = Me.[Combo176] : qdef![Combo253Param] = Me.[Combo253]
qdef![Combo178Param] = Me.[Combo178] : qdef![Combo255Param] = Me.[Combo255]
qdef![Combo214Param] = Me.[Combo214] : qdef![Combo257Param] = Me.[Combo257]
qdef![Combo216Param] = Me.[Combo216] : qdef![Combo259Param] = Me.[Combo259]
qdef![Combo218Param] = Me.[Combo218] : qdef![Combo261Param] = Me.[Combo261]
qdef![Combo220Param] = Me.[Combo220] : qdef![Combo263Param] = Me.[Combo263]
qdef![Combo222Param] = Me.[Combo222] : qdef![Combo265Param] = Me.[Combo265]
qdef![Combo224Param] = Me.[Combo224] : qdef![Combo267Param] = Me.[Combo267]
qdef![Combo226Param] = Me.[Combo226] : qdef![Combo269Param] = Me.[Combo269]
qdef![Combo228Param] = Me.[Combo228] : qdef![Combo271Param] = Me.[Combo271]
qdef![Combo230Param] = Me.[Combo230] : qdef![Combo273Param] = Me.[Combo273]
qdef![Combo232Param] = Me.[Combo232] : qdef![Combo275Param] = Me.[Combo275]
qdef![Combo237Param] = Me.[Combo237] : qdef![Combo277Param] = Me.[Combo277]
qdef![Combo239Param] = Me.[Combo239] : qdef![Combo279Param] = Me.[Combo279]
qdef![Combo241Param] = Me.[Combo241] : qdef![Combo281Param] = Me.[Combo281]
qdef![Combo283Param] = Me.[Combo283] : qdef![Combo323Param] = Me.[Combo323]
qdef![Combo285Param] = Me.[Combo285] : qdef![Combo325Param] = Me.[Combo325]
qdef![Combo287Param] = Me.[Combo287] : qdef![Combo327Param] = Me.[Combo327]
qdef![Combo289Param] = Me.[Combo289] : qdef![Combo333Param] = Me.[Combo333]
qdef![Combo291Param] = Me.[Combo291] : qdef![Combo335Param] = Me.[Combo335]
qdef![Combo293Param] = Me.[Combo293] : qdef![Combo337Param] = Me.[Combo337]
qdef![Combo295Param] = Me.[Combo295] : qdef![Combo339Param] = Me.[Combo339]
qdef![Combo297Param] = Me.[Combo297] : qdef![Combo341Param] = Me.[Combo341]
qdef![Combo299Param] = Me.[Combo299] : qdef![Combo343Param] = Me.[Combo343]
qdef![Combo301Param] = Me.[Combo301] : qdef![Text347Param] = Me.[Text347]
qdef![Combo303Param] = Me.[Combo303] : qdef![Text349Param] = Me.[Text349]
qdef![Combo305Param] = Me.[Combo305] : qdef![Text351Param] = Me.[Text351]
qdef![Combo307Param] = Me.[Combo307] : qdef![Text353Param] = Me.[Text353]
qdef![Combo309Param] = Me.[Combo309] : qdef![Text355Param] = Me.[Text355]
qdef![Combo311Param] = Me.[Combo311] : qdef![Text357Param] = Me.[Text357]
qdef![Combo313Param] = Me.[Combo313] : qdef![Text359Param] = Me.[Text359]
qdef![Combo315Param] = Me.[Combo315] : qdef![Text361Param] = Me.[Text361]
qdef![Combo317Param] = Me.[Combo317] : qdef![Text363Param] = Me.[Text363]
qdef![Combo319Param] = Me.[Combo319] : qdef![Text365Param] = Me.[Text365]
qdef![Combo321Param] = Me.[Combo321] : qdef![Text367Param] = Me.[Text367]
qdef![Text371Param] = Me.[Text371] : qdef![Text425Param] = Me.[Text425]
qdef![Text373Param] = Me.[Text373] : qdef![Text427Param] = Me.[Text427]
qdef![Text375Param] = Me.[Text375] : qdef![Text429Param] = Me.[Text429]
qdef![Text377Param] = Me.[Text377] : qdef![Text431Param] = Me.[Text431]
qdef![Text379Param] = Me.[Text379] : qdef![Text433Param] = Me.[Text433]
qdef![Text395Param] = Me.[Text395] : qdef![Text437Param] = Me.[Text437]
qdef![Text397Param] = Me.[Text397] : qdef![Text439Param] = Me.[Text439]
qdef![Text399Param] = Me.[Text399] : qdef![Text441Param] = Me.[Text441]
qdef![Text401Param] = Me.[Text401] : qdef![Text443Param] = Me.[Text443]
qdef![Text403Param] = Me.[Text403] : qdef![Text445Param] = Me.[Text445]
qdef![Text405Param] = Me.[Text405] : qdef![Text447Param] = Me.[Text447]
qdef![Text407Param] = Me.[Text407] : qdef![Text449Param] = Me.[Text449]
qdef![Text409Param] = Me.[Text409] : qdef![Text451Param] = Me.[Text451]
qdef![Text411Param] = Me.[Text411] : qdef![Text453Param] = Me.[Text453]
qdef![Text413Param] = Me.[Text413] : qdef![Text455Param] = Me.[Text455]
qdef![Text415Param] = Me.[Text415] : qdef![Text457Param] = Me.[Text457]
qdef![Text417Param] = Me.[Text417] : qdef![Text459Param] = Me.[Text459]
qdef![Text419Param] = Me.[Text419] : qdef![Text461Param] = Me.[Text461]
qdef![Text421Param] = Me.[Text421] : qdef![Text463Param] = Me.[Text463]
qdef![Text423Param] = Me.[Text423]
qdef.Execute dbFailOnError
Set qdef = Nothing
正如@Andre 评论的那样,请考虑不同的模式设置以避免这些宽表。规范化您的数据库表以实现正确的一对多、多对多关系。
我正在尝试将此代码分配给访问表单上的按钮,以便将表单中的数据输入到指定的 table(结果),清除表单,然后将焦点放回到形式。看来我的代码 currentdb.execute 部分存在语法问题。
Private Sub Command510_Click()
CurrentDb.Execute "INSERT INTO Results ([QC specialist],[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],[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],[57],[58],[59],[60],[61],[62],[63],[64],[65],[66],[67],[68],[Comment (1)] _
,[Comment (2)],[Comment (3)],[Comment (4)],[Comment (5)],[Comment (6)],[Comment (7)],[Comment (8)],[Comment (9)],[Comment (10)],[Comment (11)],[Comment (12)],[Comment (13)],[Comment (14)],[Comment (15)] _
,[Comment (16)],[Comment (17)],[Comment (18)],[Comment (19)],[Comment (20)],[Comment (21)],[Comment (22)],[Comment (23)],[Comment (24)],[Comment (25)],[Comment (26)],[Comment (27)],[Comment (28)] _
,[Comment (29)],[Comment (30)],[Comment (31)],[Comment (32)],[Comment (33)],[Comment (34)],[Comment (35)],[Comment (36)],[Comment (37)],[Comment (38)],[Comment (39)],[Comment (40)],[Comment (41)] _
,[Comment (42)],[Comment (43)],[Comment (44)],[Comment (45)],[Comment (46)],[Comment (47)],[Comment (48)],[Comment (49)],[Comment (50)],[Comment (51)],[Comment (52)],[Comment (53)],[Comment (54)] _
,[Comment (55)],[Comment (56)],[Comment (57)],[Comment (58)],[Comment (59)],[Comment (60)],[Comment (61)],[Comment (62)],[Comment (63)],[Comment (64)],[Comment (65)],[Comment (66)],[Comment (67)],[Comment (68)],[Loan Number],[Submission Date])" _
& "VALUES ('" & Me.[Combo147] & "','" & Me.[Combo165] & "','" & Me.[Combo170] & "','" & Me.[Combo172] & "','" & Me.[Combo174] & "','" & Me.[Combo176] & "','" & Me.[Combo178] & "','" & _
Me.[Combo214] & "','" & Me.[Combo216] & "','" & Me.[Combo218] & "','" & Me.[Combo220] & "','" & Me.[Combo222] & "','" & Me.[Combo224] & "','" & Me.[Combo226] & "','" & Me.[Combo228] & "','" & _
Me.[Combo230] & "','" & Me.[Combo232] & "','" & Me.[Combo237] & "','" & Me.[Combo239] & "','" & Me.[Combo241] & "','" & Me.[Combo243] & "','" & Me.[Combo245] & "','" & Me.[Combo247] & "','" & _
Me.[Combo249] & "','" & Me.[Combo251] & "','" & Me.[Combo253] & "','" & Me.[Combo255] & "','" & Me.[Combo257] & "','" & Me.[Combo259] & "','" & Me.[Combo261] & "','" & Me.[Combo263] & "','" & _
Me.[Combo265] & "','" & Me.[Combo267] & "','" & Me.[Combo269] & "','" & Me.[Combo271] & "','" & Me.[Combo273] & "','" & Me.[Combo275] & "','" & Me.[Combo277] & "','" & Me.[Combo279] & "','" & _
Me.[Combo281] & "','" & Me.[Combo283] & "','" & Me.[Combo285] & "','" & Me.[Combo287] & "','" & Me.[Combo289] & "','" & Me.[Combo291] & "','" & Me.[Combo293] & "','" & Me.[Combo295] & "','" & _
Me.[Combo297] & "','" & Me.[Combo299] & "','" & Me.[Combo301] & "','" & Me.[Combo303] & "','" & Me.[Combo305] & "','" & Me.[Combo307] & "','" & Me.[Combo309] & "','" & Me.[Combo311] & "','" & _
Me.[Combo313] & "','" & Me.[Combo315] & "','" & Me.[Combo317] & "','" & Me.[Combo319] & "','" & Me.[Combo321] & "','" & Me.[Combo323] & "','" & Me.[Combo325] & "','" & Me.[Combo327] & "','" & _
Me.[Combo333] & "','" & Me.[Combo335] & "','" & Me.[Combo337] & "','" & Me.[Combo339] & "','" & Me.[Combo341] & "','" & Me.[Combo343] & "','" & Me.[Text347] & "','" & Me.[Text349] & "','" & _
Me.[Text351] & "','" & Me.[Text353] & "','" & Me.[Text355] & "','" & Me.[Text357] & "','" & Me.[Text359] & "','" & Me.[Text361] & "','" & Me.[Text363] & "','" & Me.[Text365] & "','" & _
Me.[Text367] & "','" & Me.[Text371] & "','" & Me.[Text373] & "','" & Me.[Text375] & "','" & Me.[Text377] & "','" & Me.[Text379] & "','" & Me.[Text395] & "','" & Me.[Text397] & "','" & _
Me.[Text399] & "','" & Me.[Text401] & "','" & Me.[Text403] & "','" & Me.[Text405] & "','" & Me.[Text407] & "','" & Me.[Text409] & "','" & Me.[Text411] & "','" & Me.[Text413] & "','" & _
Me.[Text415] & "','" & Me.[Text417] & "','" & Me.[Text419] & "','" & Me.[Text421] & "','" & Me.[Text423] & "','" & Me.[Text425] & "','" & Me.[Text427] & "','" & Me.[Text429] & "','" & _
Me.[Text431] & "','" & Me.[Text433] & "','" & Me.[Text437] & "','" & Me.[Text439] & "','" & Me.[Text441] & "','" & Me.[Text443] & "','" & Me.[Text445] & "','" & Me.[Text447] & "','" & _
Me.[Text449] & "','" & Me.[Text451] & "','" & Me.[Text453] & "','" & Me.[Text455] & "','" & Me.[Text457] & "','" & Me.[Text459] & "','" & Me.[Text461] & "','" & Me.[Text463] & "','" & _
Me.[Text465] & "','" & Me.[Text467] & "','" & Me.[Text469] & "','" & Me.[Text471] & "','" & Me.[Text473] & "','" & Me.[Text475] & "','" & Me.[Text477] & "','" & Me.[Text479] & "','" & _
Me.[Text481] & "','" & Me.[Text483] & "','" & Me.[Text485] & "','" & Me.[Text487] & "','" & Me.[Text489] & "','" & Me.[Text491] & "','" & Me.[Text493] & "','" & Me.[Text495] & "','" & _
Me.[Text497] & "','" & Me.[Text501] & "','" & Me.[Text504] & "','" & Me.[Text163] & "')"
'clear fields
cmdClear_Click
'focus on top
Me.Combo147.SetFocus
End Sub
提前致谢!
确实应该重组数据,但同时连接。
CurrentDb.Execute "INSERT INTO Results ([QC specialist],[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],[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],[57],[58],[59],[60],[61],[62],[63],[64],[65],[66],[67],[68],[Comment (1)]," & _
"[Comment (2)],[Comment (3)],[Comment (4)],[Comment (5)],[Comment (6)],[Comment (7)],[Comment (8)],[Comment (9)],[Comment (10)],[Comment (11)],[Comment (12)],[Comment (13)],[Comment (14)],[Comment (15)]," & _
"[Comment (16)],[Comment (17)],[Comment (18)],[Comment (19)],[Comment (20)],[Comment (21)],[Comment (22)],[Comment (23)],[Comment (24)],[Comment (25)],[Comment (26)],[Comment (27)],[Comment (28)]," & _
"[Comment (29)],[Comment (30)],[Comment (31)],[Comment (32)],[Comment (33)],[Comment (34)],[Comment (35)],[Comment (36)],[Comment (37)],[Comment (38)],[Comment (39)],[Comment (40)],[Comment (41)]," & _
"[Comment (42)],[Comment (43)],[Comment (44)],[Comment (45)],[Comment (46)],[Comment (47)],[Comment (48)],[Comment (49)],[Comment (50)],[Comment (51)],[Comment (52)],[Comment (53)],[Comment (54)]," & _
"[Comment (55)],[Comment (56)],[Comment (57)],[Comment (58)],[Comment (59)],[Comment (60)],[Comment (61)],[Comment (62)],[Comment (63)],[Comment (64)],[Comment (65)],[Comment (66)],[Comment (67)],[Comment (68)],[Loan Number],[Submission Date]) " & _
考虑querydef parameterization。这是一个典型的需求,参数化不仅仅是关于 sql 注入,而是从数据插值中适当地抽象 SQL 代码。
将您的参数化、准备好的 SQL 语句(无数据)保存为 MS Access 查询对象,避免任何双引号或字符串连接的需要。然后在 VBA 中,引用这个保存的查询,将表单控件的实际值绑定到参数占位符,然后执行查询。
SQL (保存一次为存储查询对象;所有列假定为短文本类型)
PARAMETERS [Combo147Param] TEXT(255), [Combo165Param] TEXT(255), [Combo170Param] TEXT(255), [Combo172Param] TEXT(255), [Combo174Param] TEXT(255), [Combo176Param] TEXT(255), [Combo178Param] TEXT(255),
[Combo214Param] TEXT(255), [Combo216Param] TEXT(255), [Combo218Param] TEXT(255), [Combo220Param] TEXT(255), [Combo222Param] TEXT(255), [Combo224Param] TEXT(255), [Combo226Param] TEXT(255), [Combo228Param] TEXT(255),
[Combo230Param] TEXT(255), [Combo232Param] TEXT(255), [Combo237Param] TEXT(255), [Combo239Param] TEXT(255), [Combo241Param] TEXT(255), [Combo243Param] TEXT(255), [Combo245Param] TEXT(255), [Combo247Param] TEXT(255),
[Combo249Param] TEXT(255), [Combo251Param] TEXT(255), [Combo253Param] TEXT(255), [Combo255Param] TEXT(255), [Combo257Param] TEXT(255), [Combo259Param] TEXT(255), [Combo261Param] TEXT(255), [Combo263Param] TEXT(255),
[Combo265Param] TEXT(255), [Combo267Param] TEXT(255), [Combo269Param] TEXT(255), [Combo271Param] TEXT(255), [Combo273Param] TEXT(255), [Combo275Param] TEXT(255), [Combo277Param] TEXT(255), [Combo279Param] TEXT(255),
[Combo281Param] TEXT(255), [Combo283Param] TEXT(255), [Combo285Param] TEXT(255), [Combo287Param] TEXT(255), [Combo289Param] TEXT(255), [Combo291Param] TEXT(255), [Combo293Param] TEXT(255), [Combo295Param] TEXT(255),
[Combo297Param] TEXT(255), [Combo299Param] TEXT(255), [Combo301Param] TEXT(255), [Combo303Param] TEXT(255), [Combo305Param] TEXT(255), [Combo307Param] TEXT(255), [Combo309Param] TEXT(255), [Combo311Param] TEXT(255),
[Combo313Param] TEXT(255), [Combo315Param] TEXT(255), [Combo317Param] TEXT(255), [Combo319Param] TEXT(255), [Combo321Param] TEXT(255), [Combo323Param] TEXT(255), [Combo325Param] TEXT(255), [Combo327Param] TEXT(255),
[Combo333Param] TEXT(255), [Combo335Param] TEXT(255), [Combo337Param] TEXT(255), [Combo339Param] TEXT(255), [Combo341Param] TEXT(255), [Combo343Param] TEXT(255), [Text347Param] TEXT(255), [Text349Param] TEXT(255),
[Text351Param] TEXT(255), [Text353Param] TEXT(255), [Text355Param] TEXT(255), [Text357Param] TEXT(255), [Text359Param] TEXT(255), [Text361Param] TEXT(255), [Text363Param] TEXT(255), [Text365Param] TEXT(255),
[Text367Param] TEXT(255), [Text371Param] TEXT(255), [Text373Param] TEXT(255), [Text375Param] TEXT(255), [Text377Param] TEXT(255), [Text379Param] TEXT(255), [Text395Param] TEXT(255), [Text397Param] TEXT(255),
[Text399Param] TEXT(255), [Text401Param] TEXT(255), [Text403Param] TEXT(255), [Text405Param] TEXT(255), [Text407Param] TEXT(255), [Text409Param] TEXT(255), [Text411Param] TEXT(255), [Text413Param] TEXT(255),
[Text415Param] TEXT(255), [Text417Param] TEXT(255), [Text419Param] TEXT(255), [Text421Param] TEXT(255), [Text423Param] TEXT(255), [Text425Param] TEXT(255), [Text427Param] TEXT(255), [Text429Param] TEXT(255),
[Text431Param] TEXT(255), [Text433Param] TEXT(255), [Text437Param] TEXT(255), [Text439Param] TEXT(255), [Text441Param] TEXT(255), [Text443Param] TEXT(255), [Text445Param] TEXT(255), [Text447Param] TEXT(255),
[Text449Param] TEXT(255), [Text451Param] TEXT(255), [Text453Param] TEXT(255), [Text455Param] TEXT(255), [Text457Param] TEXT(255), [Text459Param] TEXT(255), [Text461Param] TEXT(255), [Text463Param] TEXT(255),
[Text465Param] TEXT(255), [Text467Param] TEXT(255), [Text469Param] TEXT(255), [Text471Param] TEXT(255), [Text473Param] TEXT(255), [Text475Param] TEXT(255), [Text477Param] TEXT(255), [Text479Param] TEXT(255),
[Text481Param] TEXT(255), [Text483Param] TEXT(255), [Text485Param] TEXT(255), [Text487Param] TEXT(255), [Text489Param] TEXT(255), [Text491Param] TEXT(255), [Text493Param] TEXT(255), [Text495Param];
INSERT INTO Results ([QC specialist],[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],[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],[57],[58],[59],[60],[61],[62],[63],[64],[65],[66],[67],[68],[Comment (1)]
,[Comment (2)],[Comment (3)],[Comment (4)],[Comment (5)],[Comment (6)],[Comment (7)],[Comment (8)],[Comment (9)],[Comment (10)],[Comment (11)],[Comment (12)],[Comment (13)],[Comment (14)],[Comment (15)]
,[Comment (16)],[Comment (17)],[Comment (18)],[Comment (19)],[Comment (20)],[Comment (21)],[Comment (22)],[Comment (23)],[Comment (24)],[Comment (25)],[Comment (26)],[Comment (27)],[Comment (28)]
,[Comment (29)],[Comment (30)],[Comment (31)],[Comment (32)],[Comment (33)],[Comment (34)],[Comment (35)],[Comment (36)],[Comment (37)],[Comment (38)],[Comment (39)],[Comment (40)],[Comment (41)]
,[Comment (42)],[Comment (43)],[Comment (44)],[Comment (45)],[Comment (46)],[Comment (47)],[Comment (48)],[Comment (49)],[Comment (50)],[Comment (51)],[Comment (52)],[Comment (53)],[Comment (54)]
,[Comment (55)],[Comment (56)],[Comment (57)],[Comment (58)],[Comment (59)],[Comment (60)],[Comment (61)],[Comment (62)],[Comment (63)],[Comment (64)],[Comment (65)],[Comment (66)],[Comment (67)]
,[Comment (68)],[Loan Number],[Submission Date])
VALUES ([Combo147Param], [Combo165Param], [Combo170Param], [Combo172Param], [Combo174Param], [Combo176Param], [Combo178Param],
[Combo214Param], [Combo216Param], [Combo218Param], [Combo220Param], [Combo222Param], [Combo224Param], [Combo226Param], [Combo228Param],
[Combo230Param], [Combo232Param], [Combo237Param], [Combo239Param], [Combo241Param], [Combo243Param], [Combo245Param], [Combo247Param],
[Combo249Param], [Combo251Param], [Combo253Param], [Combo255Param], [Combo257Param], [Combo259Param], [Combo261Param], [Combo263Param],
[Combo265Param], [Combo267Param], [Combo269Param], [Combo271Param], [Combo273Param], [Combo275Param], [Combo277Param], [Combo279Param],
[Combo281Param], [Combo283Param], [Combo285Param], [Combo287Param], [Combo289Param], [Combo291Param], [Combo293Param], [Combo295Param],
[Combo297Param], [Combo299Param], [Combo301Param], [Combo303Param], [Combo305Param], [Combo307Param], [Combo309Param], [Combo311Param],
[Combo313Param], [Combo315Param], [Combo317Param], [Combo319Param], [Combo321Param], [Combo323Param], [Combo325Param], [Combo327Param],
[Combo333Param], [Combo335Param], [Combo337Param], [Combo339Param], [Combo341Param], [Combo343Param], [Text347Param], [Text349Param],
[Text351Param], [Text353Param], [Text355Param], [Text357Param], [Text359Param], [Text361Param], [Text363Param], [Text365Param],
[Text367Param], [Text371Param], [Text373Param], [Text375Param], [Text377Param], [Text379Param], [Text395Param], [Text397Param],
[Text399Param], [Text401Param], [Text403Param], [Text405Param], [Text407Param], [Text409Param], [Text411Param], [Text413Param],
[Text415Param], [Text417Param], [Text419Param], [Text421Param], [Text423Param], [Text425Param], [Text427Param], [Text429Param],
[Text431Param], [Text433Param], [Text437Param], [Text439Param], [Text441Param], [Text443Param], [Text445Param], [Text447Param],
[Text449Param], [Text451Param], [Text453Param], [Text455Param], [Text457Param], [Text459Param], [Text461Param], [Text463Param],
[Text465Param], [Text467Param], [Text469Param], [Text471Param], [Text473Param], [Text475Param], [Text477Param], [Text479Param],
[Text481Param], [Text483Param], [Text485Param], [Text487Param], [Text489Param], [Text491Param], [Text493Param], [Text495Param])
VBA (定时调用)
Dim qdef As QueryDef
Set qdef = CurrentDb.QueryDefs("myparameterized_savedquery")
qdef![Combo147Param] = Me.[Combo147] : qdef![Combo243Param] = Me.[Combo243]
qdef![Combo165Param] = Me.[Combo165] : qdef![Combo245Param] = Me.[Combo245]
qdef![Combo170Param] = Me.[Combo170] : qdef![Combo247Param] = Me.[Combo247]
qdef![Combo172Param] = Me.[Combo172] : qdef![Combo249Param] = Me.[Combo249]
qdef![Combo174Param] = Me.[Combo174] : qdef![Combo251Param] = Me.[Combo251]
qdef![Combo176Param] = Me.[Combo176] : qdef![Combo253Param] = Me.[Combo253]
qdef![Combo178Param] = Me.[Combo178] : qdef![Combo255Param] = Me.[Combo255]
qdef![Combo214Param] = Me.[Combo214] : qdef![Combo257Param] = Me.[Combo257]
qdef![Combo216Param] = Me.[Combo216] : qdef![Combo259Param] = Me.[Combo259]
qdef![Combo218Param] = Me.[Combo218] : qdef![Combo261Param] = Me.[Combo261]
qdef![Combo220Param] = Me.[Combo220] : qdef![Combo263Param] = Me.[Combo263]
qdef![Combo222Param] = Me.[Combo222] : qdef![Combo265Param] = Me.[Combo265]
qdef![Combo224Param] = Me.[Combo224] : qdef![Combo267Param] = Me.[Combo267]
qdef![Combo226Param] = Me.[Combo226] : qdef![Combo269Param] = Me.[Combo269]
qdef![Combo228Param] = Me.[Combo228] : qdef![Combo271Param] = Me.[Combo271]
qdef![Combo230Param] = Me.[Combo230] : qdef![Combo273Param] = Me.[Combo273]
qdef![Combo232Param] = Me.[Combo232] : qdef![Combo275Param] = Me.[Combo275]
qdef![Combo237Param] = Me.[Combo237] : qdef![Combo277Param] = Me.[Combo277]
qdef![Combo239Param] = Me.[Combo239] : qdef![Combo279Param] = Me.[Combo279]
qdef![Combo241Param] = Me.[Combo241] : qdef![Combo281Param] = Me.[Combo281]
qdef![Combo283Param] = Me.[Combo283] : qdef![Combo323Param] = Me.[Combo323]
qdef![Combo285Param] = Me.[Combo285] : qdef![Combo325Param] = Me.[Combo325]
qdef![Combo287Param] = Me.[Combo287] : qdef![Combo327Param] = Me.[Combo327]
qdef![Combo289Param] = Me.[Combo289] : qdef![Combo333Param] = Me.[Combo333]
qdef![Combo291Param] = Me.[Combo291] : qdef![Combo335Param] = Me.[Combo335]
qdef![Combo293Param] = Me.[Combo293] : qdef![Combo337Param] = Me.[Combo337]
qdef![Combo295Param] = Me.[Combo295] : qdef![Combo339Param] = Me.[Combo339]
qdef![Combo297Param] = Me.[Combo297] : qdef![Combo341Param] = Me.[Combo341]
qdef![Combo299Param] = Me.[Combo299] : qdef![Combo343Param] = Me.[Combo343]
qdef![Combo301Param] = Me.[Combo301] : qdef![Text347Param] = Me.[Text347]
qdef![Combo303Param] = Me.[Combo303] : qdef![Text349Param] = Me.[Text349]
qdef![Combo305Param] = Me.[Combo305] : qdef![Text351Param] = Me.[Text351]
qdef![Combo307Param] = Me.[Combo307] : qdef![Text353Param] = Me.[Text353]
qdef![Combo309Param] = Me.[Combo309] : qdef![Text355Param] = Me.[Text355]
qdef![Combo311Param] = Me.[Combo311] : qdef![Text357Param] = Me.[Text357]
qdef![Combo313Param] = Me.[Combo313] : qdef![Text359Param] = Me.[Text359]
qdef![Combo315Param] = Me.[Combo315] : qdef![Text361Param] = Me.[Text361]
qdef![Combo317Param] = Me.[Combo317] : qdef![Text363Param] = Me.[Text363]
qdef![Combo319Param] = Me.[Combo319] : qdef![Text365Param] = Me.[Text365]
qdef![Combo321Param] = Me.[Combo321] : qdef![Text367Param] = Me.[Text367]
qdef![Text371Param] = Me.[Text371] : qdef![Text425Param] = Me.[Text425]
qdef![Text373Param] = Me.[Text373] : qdef![Text427Param] = Me.[Text427]
qdef![Text375Param] = Me.[Text375] : qdef![Text429Param] = Me.[Text429]
qdef![Text377Param] = Me.[Text377] : qdef![Text431Param] = Me.[Text431]
qdef![Text379Param] = Me.[Text379] : qdef![Text433Param] = Me.[Text433]
qdef![Text395Param] = Me.[Text395] : qdef![Text437Param] = Me.[Text437]
qdef![Text397Param] = Me.[Text397] : qdef![Text439Param] = Me.[Text439]
qdef![Text399Param] = Me.[Text399] : qdef![Text441Param] = Me.[Text441]
qdef![Text401Param] = Me.[Text401] : qdef![Text443Param] = Me.[Text443]
qdef![Text403Param] = Me.[Text403] : qdef![Text445Param] = Me.[Text445]
qdef![Text405Param] = Me.[Text405] : qdef![Text447Param] = Me.[Text447]
qdef![Text407Param] = Me.[Text407] : qdef![Text449Param] = Me.[Text449]
qdef![Text409Param] = Me.[Text409] : qdef![Text451Param] = Me.[Text451]
qdef![Text411Param] = Me.[Text411] : qdef![Text453Param] = Me.[Text453]
qdef![Text413Param] = Me.[Text413] : qdef![Text455Param] = Me.[Text455]
qdef![Text415Param] = Me.[Text415] : qdef![Text457Param] = Me.[Text457]
qdef![Text417Param] = Me.[Text417] : qdef![Text459Param] = Me.[Text459]
qdef![Text419Param] = Me.[Text419] : qdef![Text461Param] = Me.[Text461]
qdef![Text421Param] = Me.[Text421] : qdef![Text463Param] = Me.[Text463]
qdef![Text423Param] = Me.[Text423]
qdef.Execute dbFailOnError
Set qdef = Nothing
正如@Andre 评论的那样,请考虑不同的模式设置以避免这些宽表。规范化您的数据库表以实现正确的一对多、多对多关系。